Clocking from my interface and controlling VST'S in reaper?

hi everyone thanks for your help so far :slight_smile: I have 2 questions about midi how do I set up sonic pi to receive midi clock from my midi interface?

and how do I set up sonic pi to control VST’s in reaper? I’m running Mac os10. your help with these questions would be most welcome :slight_smile:

Hi @soundwarrior,

apologies - Sonic Pi doesn’t yet have a decent way of consuming and syncing with an incoming MIDI clock. It is capable of generating one with the fns midi_clock_tick and midi_clock_beat .

One thing you can do is to sync on an incoming MIDI message (any kind, such as “note on”) and use that to start a live loop on receipt of a message from your DAW - after which the DAW and Sonic Pi should be in time with each other (assuming the BPM isn’t changed on either side).

1 Like

hi man thanks for your reply please can you give me a code example for this? thanks very much :slight_smile:

Generating MIDI clock:

# Create a live loop which continually sends out MIDI clock
# events at the current BPM
 
live_loop :clock do 
  midi_clock_beat   
  sleep 1
end

Syncing the start of a live loop on incoming MIDI:

live_loop :daw_synced, sync: "/midi/**" do
  # put your code here which will wait for the first midi message 
  # before starting to loop
end

Hope this helps :slight_smile:

1 Like