File tree 7 files changed +143
-7
lines changed 7 files changed +143
-7
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,38 @@ visualizers might look like when visualizing the same sound.
11
11
Here is a youtube video of the app displaying a waveform.<br >
12
12
<a href =" https://youtu.be/yxGM7H1RFRA " >https://youtu.be/yxGM7H1RFRA </a >
13
13
14
- ![ ] ( example6.PNG )
15
- ![ ] ( example0.PNG )
16
- ![ ] ( example3.png )
17
- ![ ] ( example1.png )
18
- ![ ] ( example2.png )
19
- ![ ] ( example4.png )
20
- ![ ] ( example5.png )
14
+ <p align =" center " >
15
+ <img src =" example6.PNG " />
16
+ </p >
17
+
18
+ <p align =" center " >
19
+ <img src =" example7.PNG " />
20
+ </p >
21
+
22
+ <p align =" center " >
23
+ <img src =" example0.PNG " />
24
+ </p >
25
+
26
+ <p align =" center " >
27
+ <img src =" example3.png " />
28
+ </p >
29
+
30
+ <p align =" center " >
31
+ <img src =" example1.png " />
32
+ </p >
33
+
34
+ <p align =" center " >
35
+ <img src =" example2.png " />
36
+ </p >
37
+
38
+ <p align =" center " >
39
+ <img src =" example4.png " />
40
+ </p >
41
+
42
+ <p align =" center " >
43
+ <img src =" example5.png " />
44
+ </p >
45
+
21
46
22
47
# Usage
23
48
Original file line number Diff line number Diff line change
1
+ in vec2 p;
2
+ out vec4 c;
3
+ void main () {
4
+ if (gl_FragCoord .x >= iRes.x- 1 ) {
5
+ float freq = log (1 . + texture(iFreqL, (exp2 (p.y / 1.5 ) - 1 .) ).r);
6
+ c = vec4 (freq);
7
+ }
8
+ else {
9
+ vec4 adjcol = texture(ia, p + vec2 (1 . / iRes.x, 0 .));
10
+ c = vec4 (adjcol);
11
+ }
12
+ }
Original file line number Diff line number Diff line change
1
+ layout (triangle_strip, max_vertices = 6 ) out ;
2
+ out vec2 p;
3
+ void main() {
4
+ /* 1------3
5
+ | \ |
6
+ | \ |
7
+ | \|
8
+ 0------2 */
9
+ const vec2 p0 = vec2 (- 1 ., - 1 .);
10
+ const vec2 p1 = vec2 (- 1 ., 1 .);
11
+ gl_Position = vec4 (p0, 0 ., 1 .);
12
+ p = p0 * .5 + .5 ;
13
+ EmitVertex(); // 0
14
+ gl_Position = vec4 (p1, 0 ., 1 .);
15
+ p = p1 * .5 + .5 ;
16
+ EmitVertex(); // 1
17
+ gl_Position = vec4 (- p1, 0 ., 1 .);
18
+ p = - p1 * .5 + .5 ;
19
+ EmitVertex(); // 2
20
+ EndPrimitive();
21
+
22
+ gl_Position = vec4 (- p1, 0 ., 1 .);
23
+ p = - p1 * .5 + .5 ;
24
+ EmitVertex(); // 2
25
+ gl_Position = vec4 (p1, 0 ., 1 .);
26
+ p = p1 * .5 + .5 ;
27
+ EmitVertex(); // 1
28
+ gl_Position = vec4 (- p0, 0 ., 1 .);
29
+ p = - p0 * .5 + .5 ;
30
+ EmitVertex(); // 3
31
+ EndPrimitive();
32
+ }
Original file line number Diff line number Diff line change
1
+ in vec2 p;
2
+ out vec4 c;
3
+
4
+ float hash(float p) {
5
+ vec3 p3 = fract (vec3 (p) * 443.8975 );
6
+ p3 += dot (p3, p3.yzx + 19.19 );
7
+ return fract ((p3.x + p3.y) * p3.z);
8
+ }
9
+
10
+ void main () {
11
+ c = texture(ia, p);
12
+ c.a = 1 .;
13
+ }
Original file line number Diff line number Diff line change
1
+ layout (triangle_strip, max_vertices = 6 ) out ;
2
+ out vec2 p;
3
+ void main() {
4
+ /* 1------3
5
+ | \ |
6
+ | \ |
7
+ | \|
8
+ 0------2 */
9
+ const vec2 p0 = vec2 (- 1 ., - 1 .);
10
+ const vec2 p1 = vec2 (- 1 ., 1 .);
11
+ gl_Position = vec4 (p0, 0 ., 1 .);
12
+ p = p0 * .5 + .5 ;
13
+ EmitVertex(); // 0
14
+ gl_Position = vec4 (p1, 0 ., 1 .);
15
+ p = p1 * .5 + .5 ;
16
+ EmitVertex(); // 1
17
+ gl_Position = vec4 (- p1, 0 ., 1 .);
18
+ p = - p1 * .5 + .5 ;
19
+ EmitVertex(); // 2
20
+ EndPrimitive();
21
+
22
+ gl_Position = vec4 (- p1, 0 ., 1 .);
23
+ p = - p1 * .5 + .5 ;
24
+ EmitVertex(); // 2
25
+ gl_Position = vec4 (p1, 0 ., 1 .);
26
+ p = p1 * .5 + .5 ;
27
+ EmitVertex(); // 1
28
+ gl_Position = vec4 (- p0, 0 ., 1 .);
29
+ p = - p0 * .5 + .5 ;
30
+ EmitVertex(); // 3
31
+ EndPrimitive();
32
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "initial_window_size" :[350 ,175 ],
3
+ "image" : {
4
+ "geom_iters" :1 ,
5
+ "clear_color" :[0 ,0 ,0 ]
6
+ },
7
+ "buffers" : {
8
+ "a" : {
9
+ "size" :" window_size" ,
10
+ "geom_iters" :1 ,
11
+ "clear_color" :[0 ,0 ,0 ]
12
+ }
13
+ },
14
+ // TODO rendering two b's doesnt help because I b doesn't read from b, it reads from a, but it needs to read from b on the second iteration
15
+ "audio_enabled" :true ,
16
+ "audio_options" : {
17
+ "fft_sync" :true ,
18
+ "diff_sync" :true ,
19
+ "fft_smooth" :0.5 ,
20
+ "wave_smooth" :0.8
21
+ }
22
+ }
You can’t perform that action at this time.
0 commit comments