-
Notifications
You must be signed in to change notification settings - Fork 2
/
r.pde
105 lines (77 loc) · 3.41 KB
/
r.pde
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*---- YOUR CUSTOM CODE BELOW --------------------------*/
/*---- PUT OWN VARIABLES JUST BEFORE customSetup()------*/
// name vars starting with your letter to avoid duplicate variables!
// float aXpos = 0;
// int aSpeed = 0;
void rSetup() { // custom setup = runs once
}
void rDraw() { // custom draw = renders fooorever
float supererTurn = (maxAudio);
//SETTINGS [change, but don't delete any]
credits = "Lilian.Dolder"; // put your name[s] here!
myTextFont = "No Parking.ttf"; // set font
myTextSize = height*.6; // *NEW* set text size (0 - height)
useLowerCase = false; // *NEW* optionally set true for lowercase
myTextLength = 60; // custom cut length
processType(); // takes care of type for you, turn off if using custom
background(0); // default background
//backgroundFade(30); // very experimental.. sorta fails in 3D
pushMatrix(); // only adjusts translate/scale within matrix
translate(width/2, height/2); // suggestion to draw from center out
rotateY(radians(frameCount*1));
if (avgAudio>40) {
//rotateY(ampWave*2);
}
if (pointPaths != null) { // draw if points ready
for (int i = 0; i < pointPaths.length; i++) {
noFill();
stroke(255);
beginShape(); // just demo shape below!
for (int j=0; j < pointPaths[i].length; j++) {
int audioWaveIndex = floor(map(j, 0, pointPaths[i].length, 0, in.bufferSize()));
float audioWave = in.right.get(audioWaveIndex)*ampWave;
curveVertex(pointPaths[i][j].x+audioWave*4, pointPaths[i][j].y, 105);//floor(easeAudio)
curveVertex(pointPaths[i][j].x+audioWave*4, pointPaths[i][j].y, 10);
} // j
endShape();
/*
// blink laser
xstroke(random(55), random(100, 255), random(55, 150));
xbeginShape(); // just demo shape below!
for (int j=0; j < pointPaths[i].length; j++) {
int audioWaveIndex = floor(map(j, 0, pointPaths[i].length, 0, in.bufferSize()));
float audioWave = in.right.get(audioWaveIndex)*ampWave;
xcurveVertex(pointPaths[i][j].x+audioWave*4, pointPaths[i][j].y, 105);//floor(easeAudio)
xcurveVertex(pointPaths[i][j].x+audioWave*4, pointPaths[i][j].y, 10);
} // j
xendShape();
*/
} // i
popMatrix();
} // if points
// cool laser
pushMatrix(); // only adjusts translate/scale within matrix
translate(width/2, height/2); // suggestion to draw from center out
rotateY(radians(frameCount*1));
if (avgAudio>40) {
//rotateY(ampWave*2);
}
if (pointPaths != null) { // draw if points ready
//float ablue =
xstroke(random(100), random(100, 255), random(55, 150));
// xstroke map(avgAudio, 0, maxAudio, 0, 255),map(avgAudio, 0, maxAudio, 0, 255),map(avgAudio, 0, maxAudio, 0, 255);
xbeginShape(); // just demo shape below!
for (int i = 0; i < pointPaths.length; i+=1) {
for (int j=0; j < pointPaths[i].length; j+=50) {
int audioWaveIndex = floor(map(j, 0, pointPaths[i].length, 0, in.bufferSize()));
float audioWave = in.right.get(audioWaveIndex)*ampWave;
xcurveVertex(pointPaths[i][j].x+audioWave*2, pointPaths[i][j].y, 10);//floor(easeAudio)
xcurveVertex(pointPaths[i][j].x+audioWave*2, pointPaths[i][j].y, 105);
} // j
} // i
xendShape();
popMatrix();
} // if pointsPath
} // draw
/*---- YOUR CUSTOM CODE ABOVE ------------------------*/
/***** DON'T EDIT BELOW *******************************/