youtu.be
blendMode(ADD)ネタが尽きたのでオーディオリアクティブに逃げる。
DJやVJ、クラブカルチャーにあまり興味がないのであまりやらないが、
作ってみたら意外と楽しい。
収録はloopbackっていうsoundflowerみたいなものを使った。
ていうかいつの間にかsoundflowerがPCから消えてた。
これ使ったらQuickTimeで音付きの画面収録が簡単にできた。
おすすめ。
ダウンロード:https://rogueamoeba.com/loopback/
チュートリアル:https://applech2.com/archives/47546845.html
import processing.sound.*;
SoundFile soundfile;
AudioDevice device;
FFT fft;
int bands = 512;
float a = 1;
void setup() {
size(800, 800, P3D);
background(255);
device = new AudioDevice(this, 44000, bands);
soundfile = new SoundFile(this, "tst2_.wav");
soundfile.loop();
fft = new FFT(this, bands);
fft.input(soundfile);
colorMode(HSB);
blendMode(ADD);
}
void draw() {
fft.analyze();
background(0);
translate(width/2, height/2, -1000);
rotateY(a/500);
a++;
float area = bands/1.5;
for (int f = 0; f < area; f+=1) {
float F = map(fft.spectrum[f], 0.0, 0.1, 100, 8000);
float F2 = map(fft.spectrum[f], 0.005, 0.09, 10, 360);
pushMatrix();
translate(0,
height - f* 2 * height/area,
0);
rotateY(radians(F2/3));
strokeWeight(F/10);
stroke(F2, F2*2, 10);
noFill();
box(F+1, 10, F+1);
popMatrix();
}
}