Open Stage Control and Sonic Pi : note parameter

Bonjour !

I explore open stage control to send osc message to sonic pi.

if you want to send a note as a parameter you must not type the : before the name of the note.

If you send the osc message from sonic pi you can use :c3 directly as a parameter. If you send from a differnt program probably best to use a string as “c3” without the : and this will work OK. You can also use this within sonic pi.

I altered your program to use both methods sending osc from inside sonic pi
(I think perhaps you meant to use :sustain or :release rather than :delay when playing the note)

use_osc "localhost",4559

live_loop :send do
  osc "/play","c3",4
  sleep 6
  osc "/play",:c4,4
  sleep 6
end

live_loop :test1 do
  b = sync "/osc/play"
  sample :guit_e_fifths
end

live_loop :test2 do
  use_synth :tri
  c = sync "/osc/play"
  puts c
  play c[0],sustain: c[1]
end

Hope you enjoy playing with OSC and sonic pi. It brings lots of possibilities.

Interesting observation!

I’ve now improved the note name handling to cope with a : prefix in string versions of notes:

play ":C3"

Thanks Sam. A useful change that can help to reduce confusion!

1 Like