Browse Source

2020+2 a new hope ?

master
tth 4 months ago
parent
commit
85c1846a0b
  1. 2
      chuck/README.md
  2. 14
      chuck/dessiner.ck
  3. 10
      chuck/midi2osc.ck
  4. 2
      chuck/pouet.ck

2
chuck/README.md

@ -6,6 +6,8 @@ pour lancer Chuck sans connexion audio. @@ -6,6 +6,8 @@ pour lancer Chuck sans connexion audio.
## dessiner.ck
Faire des courbes de Lissajous...
## pouet.ck
## midi2osc.ck

14
chuck/dessiner.ck

@ -7,8 +7,8 @@ @@ -7,8 +7,8 @@
*
*/
7777 => int OSCPort;
31000.0 => float Amplitude;
9000 => int OSCPort;
32760.0 => float Amplitude;
OscOut xmit;
float dx, dy;
@ -20,17 +20,19 @@ clear_the_screen(); @@ -20,17 +20,19 @@ clear_the_screen();
for (0 => int foo; foo<25800; foo++) {
<<< foo >>>;
Amplitude * Math.sin(foo * 0.30001) => dx;
Amplitude * Math.cos(foo * 0.50001) => dy;
Amplitude * Math.sin(foo * 0.3001) => dx;
Amplitude * Math.cos(foo * 0.4999) => dy;
xmit.start("/joystick/xy");
Std.ftoi(dx) => xmit.add;
Std.ftoi(dy) => xmit.add;
xmit.send();
0.02::second => now;
0.025::second => now;
}
// ----------------------------------------------------
fun void clear_the_screen()
{
xmit.start("/joystick/b");
@ -40,3 +42,5 @@ xmit.start("/joystick/b"); @@ -40,3 +42,5 @@ xmit.start("/joystick/b");
50 => xmit.add; 0 => xmit.add;
xmit.send();
}
// ----------------------------------------------------

10
chuck/midi2osc.ck

@ -7,8 +7,10 @@ @@ -7,8 +7,10 @@
MidiIn input;
MidiMsg msg;
OscOut xmit;
1 => int port; // please explain
9000 => int OSCPort;
if (!input.open(port)) {
<<< "erreur open" >>>;
@ -18,12 +20,20 @@ if (!input.open(port)) { @@ -18,12 +20,20 @@ if (!input.open(port)) {
// print out device that was opened
<<< "MIDI device:", input.num(), " -> ", input.name() >>>;
xmit.dest("localhost", OSCPort);
// infinite loop
while (1) {
input => now;
while ( input.recv(msg) ) {
<<< msg.data1, msg.data2, msg.data3 >>>;
xmit.start("/joystick/b");
}

2
chuck/pouet.ck

@ -9,7 +9,7 @@ SqrOsc sl => Envelope envl => dac.left; @@ -9,7 +9,7 @@ SqrOsc sl => Envelope envl => dac.left;
SawOsc sr => Envelope envr => dac.right;
0.5 => sl.gain => sr.gain;
0.01 => envl.time; 0.06 => envr.time;
0.01 => envl.time; 0.04 => envr.time;
OscIn oscin; OscMsg msg;

Loading…
Cancel
Save