Sonic Pi listens on port 4560 for OSC messages and routes them into Time State automatically
Sonic Pi listens for OSC on localhost:4560 by default. Incoming messages are inserted into Time State. Code can sync or get on these paths exactly as with MIDI or cue events. To receive from remote machines, enable ‘Receive Remote OSC Messages’ in Preferences. The OSC path wildcard system (*, **, ?, {a,b}, [a-z]) applies to OSC paths for flexible event routing.
Examples
live_loop :foo do use_real_time a, b, c = sync “/osc*/trigger/prophet” synth :prophet, note: a, cutoff: b, sustain: c end
Assessment
Write a live_loop that waits for an OSC message at path /trigger/bass and uses the received value as the MIDI note. Explain why use_real_time is recommended.