-
Notifications
You must be signed in to change notification settings - Fork 0
/
particles.js
58 lines (43 loc) · 900 Bytes
/
particles.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
function setup() {
createCanvas(
c.settings.width,
c.settings.height
);
// load background-image-overlay
bgLayer = loadImage('assets/images/background.png');
// Create an Audio input
mic = new p5.AudioIn();
mic.start();
fft = new p5.FFT();
fft.setInput(mic);
}
function draw() {
colorMode(HSL);
if( h < 360 ){
h = h + 0.4;
} else {
h = 0;
}
background( h, s, l );
particles.push(new particle( h, s, l ));
runPSystem();
if ( !looping ) {
var mouseText = "SM" // SoundeMode on
} else {
var mouseText = "VM" // VariableMode on
}
fill(0, 102, 153, 51);
// text(mouseText, mouseX + 20, mouseY);
// init background-image-overlay
//image(bgLayer, 0, 0, width, height);
}
function mousePressed() {
if( !looping ){
saveCanvas("img","png");
//noLoop();
looping = 1;
}else{
//loop();
looping = 0;
}
}