Midi chords creation from an external synth

Hello!

I tried to make midi chords from my Waldorf Blofled but I got error message. I don’t have any problems with SP’s internal synths. I am novice in SonicPi, so any help would much appreciated!

Here is my code:

live_audio :input5, input: 5,stereo: true

#midi chord

live_loop :example1 do
  midi (chord :e3, :minor), channel: 1, port: "blofeld"
  sleep 0.5
end

#chord with SonicPi internal synth

live_loop :example2 do
  play (chord :e3, :minor)
  sleep 0.5
end
1 Like

Hi @Nikos,

as far as I know not yet supported natively. But there is a workaround:

# https://github.com/samaaron/sonic-pi/issues/1691
# Use: midi_chord chord(:c4,:major), sustain:0.2
define :midi_chord do |notes, *args|
  notes.each do |note|
    midi note, *args
  end
end

You can put this into your init file .sonic-pi.rb init.rb (in Linux you’ll find that file here: ~/.sonic-pi.rg ~/.sonic-pi/; in other OSSes accordingly).

3 Likes

Thank you very much @Martin ! I used the code and it works well!

Glad it works for you!

But I was just the messenger. The merrit goes to @robin.newman and Pierre de Wilde, see https://github.com/samaaron/sonic-pi/issues/1691.

2 Likes

Many thanks to @robin.newman and Pierre de Wilde too!:slightly_smiling_face:

2 Likes

I love the way this site is working and how stuff gets passed around. It all allows the Sonic Pi community to grow in their understanding of this great program. Even in this case where I posted a simple solution and Pierre jumped in to improve it. I learned from that too!

3 Likes

Would there be a way to tick through a chord to make an arp. This code brings up an error saying " undefined method ‘each’ ":

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

live_loop :arp do
tick
midi_chord chord(:as3, :major).look, sustain: 0.5, channel: 1
sleep 1
end

Thanks!