From 2a8c892e330f2850f43a908f7491db28030f4c09 Mon Sep 17 00:00:00 2001 From: tth Date: Tue, 20 Jul 2021 22:24:05 +0200 Subject: [PATCH] ok --- chuck/dessiner.ck | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/chuck/dessiner.ck b/chuck/dessiner.ck index f9c018a..933b192 100644 --- a/chuck/dessiner.ck +++ b/chuck/dessiner.ck @@ -1,4 +1,38 @@ -# -# dessiner par OSC avec le laser de Gaby -# +/* + * dessiner par OSC avec le laser de Gaby + */ + +9000 => int OSCPort; +31000.0 => float Amplitude; + +OscOut xmit; +float dx, dy; + +xmit.dest("localhost", OSCPort); + +// ---- clear the screen +xmit.start("/joystick/b"); +50 => xmit.add; 1 => xmit.add; +xmit.send(); +xmit.start("/joystick/b"); +50 => xmit.add; 0 => xmit.add; +xmit.send(); + +for (0 => int foo; foo<25800; foo++) { + <<< foo >>>; + + Amplitude * Math.sin(foo * 0.70001) => dx; + Amplitude * Math.cos(foo * 0.50001) => dy; + + xmit.start("/joystick/xy"); + + Std.ftoi(dx) => xmit.add; + Std.ftoi(dy) => xmit.add; + + xmit.send(); + + 0.001::second => now; + + } +