Syncing to external looper - main/secondary Q

Sorry for what may be basic Q. I’ve trawled around threads, read the tutorials and Lang section. I find it confusing and would like a basic defrag answer. I’m trying to clock Sonic Pi + Focusrite + Boss looper, and wondering:

  1. Are both directions possible:
  • Sonic Pi = main device, looper = secondary
  • Looper = main, Sonic Pi = secondary
  1. If Sonic Pi has to be main, what code to use, to set up the sync?
    I have:
    SonicPi>Mac>USB>Focusrite (audio)
    Focusrite>DIN MIDI out>Rc600 DIN MIDI in
    I haven’t done 2-way DIN - do I need to?

  2. If Looper = main is possible, what receive code to use?

Help appreciated! Also let me know if this is better not attempted :blush:

I don’t have any experience with this, but for using Sonic Pi as the main device you might want to look into the midi_clock_beat (and midi_clock_tick) commands.