The basic idea here could be to split it into two groups, one for the top and middle two notes, (since they are the same duration as each other) and another for the bottom one.
Then it’s just a matter of knowing the note values and their durations. It’s been a little while since I’ve properly read music, but as far as I can tell, the top and middle two notes are an eighth note and half note tied together, and the bottom two are an eighth note and quarter note tied together. So, using (for example) this handy note length reference for translating those lengths into durations in Sonic Pi:
We’d be able to calculate the length of the top, middle and bottom tied notes.
Finally, it’d just be a matter of playing them. Because the timing between upper and lower notes is not even, we want to avoid timing difficulties by playing them in separate threads that can play simultaneously with their own particular timing. Whether or not to use plain in_thread
, or a live_loop
depends on your own preference or situation. (For this example, I’m just demonstrating it with in_thread
).
in_thread do
# top two notes as a note array, double amp because it's divided between each note
play [top_note, middle_note], amp: 2, release: X
end
in_thread do
play bottom_note, release: Y
end