-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsend_OSC_to_sonicPi_basic
More file actions
38 lines (31 loc) · 870 Bytes
/
send_OSC_to_sonicPi_basic
File metadata and controls
38 lines (31 loc) · 870 Bytes
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
// processing code to send OSC messages to sonic pi (v3)#
// just basic proof of concept currently!
// change netAddress to that of your pi, set it to accept external OSC messages. port no should be right
import netP5.*;
import oscP5.*;
OscP5 oscP5;
NetAddress sonicPi;
void setup() {
oscP5 = new OscP5(this, 8000);
sonicPi = new NetAddress("192.168.1.148", 4559); // to pi, port for SPi
}
void draw() {
int note = int(random(40,80));
int cutOff = int(random(50,100));
sendOscTest(note, cutOff);
delay(1000);
}
void sendOscTest(int pitch, int cutOff) {
OscMessage test = new OscMessage("/trigger/prophet/");
test.add(pitch);
test.add(cutOff);
test.add(1);
oscP5.send(test, sonicPi);
println(test);
}
// in sonicPi, use this:
live_loop :foo do
use_real_time
a, b, c = sync "/osc/trigger/prophet"
synth :prophet, note: a, cutoff: b, sustain: c
end