Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Palestrina (c. 1525-1594) Hosanna played by Sonic Pi from a midi file by Michael Robinson. Use run_file "path-to-PalesHos-RF.rb" to run it.
#PalesHos-RF.rb
#Giovanni Pierluigi de Palestrina (c. 1525-1594) Hosanna
#transcribed for Sonic Pi by Robin Newman, June 2019 from a midi file by Michael Robinson
#http://www.standingstones.com/em_midi.html
use_bpm 90
define :plarray do |notes,durations,tp=0,pan=0,vol=1,s=0.9,r=0.1|
#puts offsetclass
notes.zip(durations).each do |n,d|
if n.respond_to?(:each)
n.each do |nv|
play (note(nv)+tp),sustain: s*d, release: r*d, pan: pan, amp: vol
end
else
play (note(n)+tp),sustain: s*d, release: r*d, pan: pan, amp: vol
end
sleep d
end
end
with_fx :reverb,room: 0.8,amp: 1.5,mix: 0.7 do
with_fx :lpf,cutoff: 90 do #use lpf to reduce percussiveness of saw synth
use_synth :saw
a1=[:D5,:D5,:G4,:D5,:C5,:D5,:C5,:Bf4,:A4,:Bf4,:A4,:G4,:G4,:F4,:Bf4,:A4,:D5,:D5,:E5,:F5,:E5,:D5,:C5,:Bf4,:A4,:G4,:A4,:G4,:A4,:Bf4,:A4,:D5,:r,:r,:A4,:Bf4,:C5,:D5,:C5,:F5,:F5,:E5,:A4,:r,:A4,:Bf4,:C5,:D5,:C5,:F5,:E5,:D5,:E5,:D5,:F5,:r,:E5,:D5,:C5,:Bf4,:A4,:G4,:F4,:F5,:r,:E5,:D5,:C5,:Bf4,:A4,:G4,:G4,:G4,:A4,:Bf4,:C5,:D5,:C5,:Bf4,:A4,:C5,:Bf4,:A4,:C5,:D5,:E5,:F5,:E5,:D5,:C5,:r,:G4,:A4,:Bf4,:C5,:r,:G4,:A4,:Bf4,:C5,:C5,:D5,:E5,:F5,:E5,:D5,:C5,:Bf4,:A4,:C5,:Bf4,:A4,:C5,:D5,:E5,:F5,:E5,:D5,:D5,:Cs5,:D5,:r,:F4,:G4,:A4,:Bf4,:G4,:Bf4,:A4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