Choose MIDI Chord

Hello again, future readers who run into this. I just got rid of the phantom notes by using a very advanced technique that is going to be difficult to explain because of its level of sophistication, but I’ll try:

I turned it all off and back on.

So, in the end, the following code will in fact choose a chord, then play that chord through midi into Ableton. From there, you will have to find a software synth that behaves well with what Sonic Pi is throwing at it. So far the Native Instruments plugins are working great. The built-in Ableton synths are not.

chords = [(chord :C, :minor7), (chord :Ab, :major7), (chord :Eb, :major7), (chord :Bb, "7")].ring

thisChord1 = chords.choose

define :midi_chord do |notes, *args|
  notes.each do |note|
    midi note, *args
  end
end

live_loop :channel16 do
  midi_chord thisChord1, release: 0.6, channel: 16
  sleep 0.5
end

Thanks!

1 Like

okay

So the pb is not coming from sonic pi ;-). Right ?
i suggest that there is a question of midi notes off signal to send correctly to switch off already received notes into Ableton Live

First you can see that SP is behaving properly by temporarily changing midi note *args to play note *args in the midi_chord defined function. That way you will hear the chord played locally.

Secondly I suspect you problem is in the choice of synth. It will have to be polyphonic to play the chord. If not, it will latch onto one of the notes which may change. (4 arriving more or less at the same time(. I tried the code sending the midi to Qsynth and it works perfectly there.

I often find that it’s easy to get an external synth in a state where it has received a note_on event but not the corresponding note_off.

The solution is either to power the synth down and back up again or to call midi_all_notes_off.

Hope you’re having fun!

2 Likes

I haven’t obsessively coded like this in over a decade. I jumped on your Patreon immediately. Thank you for this.

1 Like

I hadn’t even considered that the built-in synths I tested with in Ableton may have been monophonic. I have never used them. But that would explain why all of the Native Instruments synths I threw at it worked, since I only threw polyphonic synths at it from that point on, since I was looking for a pad sound.

Today I’m trying to fire off the monophonic Minitar and Sirin through Ableton using the non-chord midi commands, so I’m looking forward to that much simpler code. :slight_smile: