My aim isn’t to play chords, but to execute simultaneous calls to the same routine.
define :myMIDIplayer do |note|
midi_note_on note
sleep 1.0
end
define :myMIDIChordplayer do |noteArray|
in_thread do
noteArray.each {|note|
myMIDIplayer note
}
end
end
live_loop :playMIDI do
myMIDIplayer [60]
end
live_loop :playMIDIChord do
myMIDIChordplayer [60, 61]
end
Both loops sleep, but playMIDIChord
throws a ZeroTimeLoopError
error. Why does Sonic Pi think it’s not sleeping and throwing the error? Is there a way to do this without throwing an error?