SEND SPi´s Midi to Another DAW

Hi,

as Sam asked you : would you please indicate which spi version you are using ?
When you get errors, please screenshot the error feedback zone : we will have the error message with the error details.
Cheers

Error_1

Error_2

Thank you all very much for your valuable help

This version corrected by emlyn works without runtime error.

The only problem is that when I stop the Sonic Pi´s run the sound gets hung up and only stops if I turn off the on of the Ableton´s virtual instrument.

I have an iMac with the Captain with the maximum version supported by its, the 3.1 with which I did everything published in the forum but today I did these tests with my MacBook Pro 2015 with catalina with the 3.2.2 version of Sonic Pi.

About synchronization :

I mean, when you press the Sonic pi´s run button, Ableton’s play is not activated simultaneously.

When I press Ableton’s record the midi is recorded in sync with the bpm set in both programs but I must quantize or move its beginning to Ableton’s beat 1.

Ideally, when I press the Sonic pi´s run it immediately sets Ableton’s record without me having to press it.

Thanks in advance

hi,

again i encourage everybody to always specify the sonic pi version used and the code causing the issue. the os is usefull too.
please dont change version without telling people : some errors are linked to some versions.

Always give us the full code. the debug zone sometimes doesn’t indicate the right line number so think to look at the lines above.
cheers

Error 1: The error here is that you have an erroneous call to the fn play after midi.

The code should be:

midi (chord :c4, :min), sustain: 0.6

Essentially you should use either play (for internal synths) or midi (for external MIDI synths).

Hope this helps!

Error 2: The problem here is that you’re passing a random element of the list [:e3, :minor] to your fn midi_chord as the first argument. The body of this fn first binds it to the local variable notes and then using .each attempts to work through each element which doesn’t make sense with either :e3 or :minor which are symbols not lists of notes.

You need to pass a list of notes to :midi_chord for it to work as written.

You can do this with:

midi_chord (chord :e3, :minor), sustain: 0.6

However, this means you don’t get the randomness of .choose but it’s not clear from the code what you’re trying to choose. Are you trying to choose a random note from the chord E3 Minor or are you trying to choose a random chord from a set of chords (which are yet to be defined)?

Hope that this helps.

Thank you all so much for your wonderful help.
I still need to study and practice to understand it better.
I will raise questions and new issues as they arise
Best Wishes

1 Like

Good luck and do continue to share your journey with us :slight_smile:

Thanks Sam! :grinning:

Do you have a plugin in ableton to send OSC messages? If you could Ableton to start recording and send an OSC message to Sonic Pi to start playing at the same time, you could technically get them entirely synchronized.

It sounds a bit tricky though:

  1. Sonic Pi OSC events include the source port of the OSC message, so you may need to tweak the sync event depending on how the OSC sender in Ableton works (whether it uses a static source UDP port)
  2. Sonic Pi triggers synths “in the future” by default. So you have to start recording in Ableton with a slight delay and/or reduce the sched_ahead_time in Sonic Pi.

maybe this post can help:

Sorry, I was MIA on this. Yes, @siimphh - that’s exactly what I put in the article that @nlb mentioned. You may not be able to do this with the Lite version, but LiveOSC does work. What didn’t seem to work the last time I tried, was using OSC to actually arm the transport for recording and then starting it with ‘play’. So, I used a normal MIDI map. It takes some screwing around because you need to make a small loop of just the midi send from Sonic Pi in order to have Ableton pick up on it and map it to the record button. But if you do things in the right order it does work.

Let me know if you have issues and maybe I can help. It’s been a bit since I’ve done this, and since have moved to REAPER and Bitwig Studio for the same exact thing on Linux, but if you run into some issue maybe it will trigger a memory :slight_smile:

Oh, and if you do have the full version of Ableton Live with Max For Live, another way of doing this is with the TouchOSC device and mapping any custom OSC commands you want to make with it to Ableton. I preferred to use Live OSC because it’s got a ton of commands already working and ready. But I’d check out @robin.newman’s great video.

nice idea ! Some code available ?
i guess you use the learn midi affectation to the record button into ableton live then into sonic pi send some clever midi signals but which one ?
Thanks if you can tell us more

EDIT : this is the idea non ?

live_loop :ArmTrack01 do
  
  midi_cc 20, 0
  sleep 1
  midi_cc 20, 127
  sleep 1
  
end

Hi siimphh!
Yes; I have Oscular Toolkit but i don,t know how to use it with Sonic Pi .

Thanks

Hi nlb & Hypostatic!

Thanks for the advice about LiveOSC.

I have tried but does not work for me because i am doing something bad.

In the original Hypostatic post are the files.

Have nice weekend :wink:

Hi !
Hypostatic; I love Reaper.
Please could you explain with detail,some pictures how do you set up Reaper OSC with Sonic Pi?
Maybe better by creating a new thread
Thanks in advance

@nlb

Yep, that’s correct. I’m not totally sure using 0, and 127 has an effect like ‘on and off’ - I guess I didn’t try that. I think it’s a toggle though. Any command on that channel and value toggle it. I could be wrong.

What I actually didn’t say very well was I only use the loop I was talking about for control mapping - like arming the record button. I comment out everything else, run that to set up mapping in Ableton, and then comment that out and just use a single command before I run the OSC “play” command.

To do that it helps to have just one single command (though that can work as well). I set up a small loop like what you have above with only one midi command at a time and then put Ableton into ‘midi mapping’ mode with say the ‘record’ button chosen. Then I start just the live_loop and Ableton then has that midi command (usually a midi cc in this case) internally mapped to listen for that. For whatever reason LiveOSC, does not have a way that I could find to play AND record. It can play fine with the OSC command for that (in the LiveOSC reference list I shared in my other post) but you either need to click the record button manually every time (maybe not that big of a deal) or use midi as just mentioned.

But with this method of midi-mapping you can also do just about amount of Ableton control as well. I just find the OSC commands cleaner.

ANOTHER BIG CAVEAT: You can’t seem to use both LiveOSC AND the OSC Toolkit. I think LiveOSC must be intercepting all calls, even if you use a different port. Again, I could be wrong, but never figured it out.

Hi @Lunatico !

Sure! When I get a chance and refresh my memory, I’ll write this up in another thread. It isn’t very difficult and REAPER is very efficient. I actually had much less problems than with Ableton AND there are MANY more commands to use than with Ableton and LiveOSC. Perfect for recording stems of loops for mixing.

Hi
Fantastic Hypostatic!
I wait happily for the configuration of the powerful reaper :wink: