aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2025-08-05 01:44:00 +0000
committers-ol <s+removethis@s-ol.nu>2025-08-05 01:44:22 +0000
commit8ab97cc7144c02d96d2bd382d36c56ac30f28e06 (patch)
treebc152a2e705cfaeb8965803f16acb28c2d6c6915 /examples
parentlib/osc: send bangs as I(mpulse) (diff)
downloadalive-8ab97cc7144c02d96d2bd382d36c56ac30f28e06.tar.gz
alive-8ab97cc7144c02d96d2bd382d36c56ac30f28e06.zip
builtins: add doto macro
Diffstat (limited to 'examples')
-rw-r--r--examples/glsl-view/stream-controls.alv21
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/glsl-view/stream-controls.alv b/examples/glsl-view/stream-controls.alv
new file mode 100644
index 0000000..fb37c31
--- /dev/null
+++ b/examples/glsl-view/stream-controls.alv
@@ -0,0 +1,21 @@
+([1]import* glsl-view link-time)
+([2]import osc)
+
+([3]def
+ *clock* ([8]clock false 120)
+ *oscout* ([5]osc/connect 'localhost' 9000))
+
+([6]def
+ paused? ([12]switch ([13]every 2) true false)
+ cam ([16]doto ([7]stream-source 'webcam' '2D' '/dev/video0')
+ ([11]freeze paused?)
+ ([14]step! ([15]every 0.5))))
+
+([9]draw $[10]shader"
+in vec2 uv;
+out vec4 color;
+
+void main() {
+ color = texture($cam , uv);
+ color.rgb = mix(color.rgb, color.rrr, $paused? ? 1 : 0);
+}")