-
Notifications
You must be signed in to change notification settings - Fork 2
/
k.pde
155 lines (95 loc) · 4.45 KB
/
k.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*---- 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 kSetup() { // custom setup = runs once
}
void kDraw() { // custom draw = renders fooorever
translate(width/2, height/2, -height/2);
rotateY(radians(frameCount*1));
//SETTINGS [change, but don't delete any]
credits = "lara.schai"; // put your name[s] here!
myTextFont = "FreeSans.ttf"; // set font
myTextSize = height*.8; // *NEW* set text size (0 - height)
useLowerCase = false; // *NEW* optionally set true for lowercase
myTextLength = 15; // 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
for (int k=1; k < 10; k++) {
pushMatrix(); // only adjusts translate/scale within matrix
if (maxAudio > 5) {
strokeWeight(5);
//scale(avgAudio/40);
if (pointPaths != null) { // only draw if points ready
noFill(); // optional..
for (int i = 0; i < pointPaths.length; i++) {
noFill();
stroke(255); // optional...
//fill(30); // optional...
beginShape();
for (int j=0; j < pointPaths[i].length; j++) {
int audioWaveIndex = floor(map(j, 0, pointPaths[i].length, 0, in.bufferSize()));
float audioWave = in.left.get(audioWaveIndex)*ampWave*4;
float easing = 20; // 0 = never updates, 1 = no smoothing, inbetween = shades of smooth
//if(j < pointPaths [i] length/2) {
/*
//vertex(pointPaths[i][j].x, pointPaths[i][j].y); // try other shapes
ellipse(pointPaths[i][j].x, pointPaths[i][j].y,10, 10); // try other shapes
// [i] refers to which character, [j] refers to which point in that character
}
*/
//if(j%3==2){
//vertex(pointPaths[i][j].x, pointPaths[i][j].y); // try other shapes
//line(pointPaths[i][j].x+audioWave, pointPaths[i][j].y,avgAudio, 10); // try other shapes
//ellipse(pointPaths[i][j].x+audioWave, pointPaths[i][j].y+audioWave,100, 100); // try other shapes
curveVertex(pointPaths[i][j].x+audioWave, pointPaths[i][j].y, sin(1));
//curveVertex(pointPaths[i][j].x+audioWave, pointPaths[i][j].y, 20);
//curveVertex(easeAudio, easeAudio,40);
// [i] refers to which character, [j] refers to which point in that character
strokeWeight(1);
// }
}
endShape(CLOSE);
if(k == 1){
xstroke(100, random(100, 255), random(55, 150));
xbeginShape();
for (int j=0; j < pointPaths[i].length; j++) {
int audioWaveIndex = floor(map(j, 0, pointPaths[i].length, 0, in.bufferSize()));
float audioWave = in.left.get(audioWaveIndex)*ampWave;
float easing = 20; // 0 = never updates, 1 = no smoothing, inbetween = shades of smooth
xvertex(pointPaths[i][j].x, pointPaths[i][j].y); // try other shapes
//scale(2);
//fill(255);
//line(pointPaths[i][j].x, pointPaths[i][j].y,avgAudio, avgAudio); // try other shapes
// [i] refers to which character, [j] refers to which point in that character
//strokeWeight(1);
// }
}
xendShape();
}
beginShape();
for (int j=0; j < pointPaths[i].length; j++) {
//translate(width/2, height/2, 100);
rotateY(radians(frameCount*6));
int audioWaveIndex = floor(map(j, 0, pointPaths[i].length, 0, in.bufferSize()));
float audioWave = in.left.get(audioWaveIndex)*ampWave;
float easing = 100; // 0 = never updates, 1 = no smoothing, inbetween = shades of smooth
stroke(100);
ellipse(pointPaths[i][j].x+(map(easeAudio, 0, maxAudio, 0, 100)+audioWave), pointPaths[i][j].y+(map(easeAudio, 0, maxAudio, 0, 100)+audioWave), 3, 3);
strokeWeight(1);
// }
}
endShape(CLOSE);
}
}
} else {
strokeWeight(5);
fill(255);
}
popMatrix();
}
}
/*---- YOUR CUSTOM CODE ABOVE ------------------------*/
/***** DON'T EDIT BELOW *******************************/