Skip to content

Instantly share code, notes, and snippets.

@rbnpi
Created Jun 2, 2019
Embed
What would you like to do?
Recerada Segunda by Diego Ortiz 16th century) from midi by Michael Robinson. Use run_file "path-to-Ortiz2-RF.rb" command to run it.
#Ortiz2-RF.rb
#Recerada Segunda by Diego Ortiz 16th century) from midi by Michael Robinson
#midi file at http://www.standingstones.com/em_midi.html
#converted for Sonic Pi by Robin Newman, June 2019
#use run_file "path-to-Ortiz2-RF.rb" to play it
use_bpm 100
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.7,amp: 0.8,mix: 0.6 do
use_synth :tri
use_bpm 100
a1=[:G4,:B4,:C5,:D5,:B4,:C5,:C4,:E4,:F4,:G4,:E4,:D4,:G4,:B4,:C5,:D5,:B4,:A4,:D4,:Fs4,:G4,:A4,:Fs4,:G4,:G4,:B4,:C5,:D5,:B4,:C5,:F4,:A4,:B4,:C5,:A4,:B4,:G5,:E5,:Fs5,:D5,:C5,:B4,:A4,:G4,:D5,:C5,:B4,:A4,:B4,:A4,:G4,:F4,:G4,:D5,:B4,:C5,:G4,:F4,:E4,:D4,:C4,:C5,:B4,:G4,:B4,:C5,:D5,:B4,:A4,:D4,:Fs4,:G4,:A4,:Fs4,:G4,:G4,:B4,:C5,:D5,:B4,:C5,:A4,:C5,:B4,:A4,:G4,:A4,:B4,:C5,:A4,:B4,:A4,:G4,:Fs4,:G4,:C5,:B4,:A4,:G4,:A4,:G4,:D4,:C4,:B3,:A3,:G3,:D4,:B3,:G3,:B3,:C4,:D4,:r,:G4,:E4,:C4,:E4,:F4,:G4,:D4,:B3,:G3,:A3,:B3,:C4,:D4,:E4,:Fs4,:G4,:A4,:G4,:Fs4,:E4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0.5,0.75,0.25,0.5,0.5,0.5,1.0,0.5,0.5,0.75,0.25,0.25,0.25,0.5,0.75,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.5,1.0,0.5,0.5,0.75,0.25,0.25,0.25,0.5,0.5,0.5,0.5,0.75,0.25,0.5,0.5,0.5,0.5,0.75,0.25,0.5,0.5,0.5,0.5,0.75,0.25,0.5,0.5,0.5,0.5,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.5,0.25,0.25,0.25,0.25,0.5,0.5,0.75,0.25,0.25,0.25,0.5,0.5,0.5,0.5,0.75,0.25,1.0,0.5,0.5,0.5,0.5,0.75,0.25,0.5,0.5,0.5,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.75,0.25,0.25,0.25,0.5,0.75,0.25,0.25,0.25,0.5,0.75,0.25,0.5,0.5,0.75,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.5,0.75,0.25,0.5,0.5,0.5,0.5,0.75,0.25,0.5,0.5,0.5,0.5,0.75,0.25,0.5,0.5,0.5,0.5,0.5,0.75,0.25,0.25,0.25,0.5,0.5,0.5,0.75,0.25,0.25,0.25,0.5,0.5,0.5,0.75,0.25,0.25,0.25,0.5,0.5,0.5,0.75,0.25,0.25,0.25,0.5,0.5,0.5,0.5,0.75,0.25,0.25,0.25,0.5,0.5,0.5,0.25,0.25,0.25,0.25,0.5,0.5,0.5,0.5,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.75,0.25,0.5,0.5,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.75,0.25,0.5,0.5,1.0,1.0,0.5,0.25,0.25,0.25,0.25,0.25,0.25,0.5,0.5,0.5,0.75,0.25,0.25,0.25,0.5,0.5,0.5,0.75,0.25,0.25,0.25,0.5,0.5,0.75,0.25,0.25,0.25,0.5,0.5,0.5,0.5,0.5,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,2.0]
in_thread do
plarray(a1,b1,0,-0.5,0.8)
#play a1[i][j],sustain: b1[i][j]*0.9,release: b1[i][j]*0.1
end
with_fx :lpf,cutoff: 90 do
use_synth :saw
a2=[[:D4,:G4],[:D4,:G4],[:D4,:G4],[:D4,:G4],[:C4,:E4],[:C4,:E4],[:C4,:E4],[:C4,:E4],[:D4,:G4],[:D4,:G4],[:D4,:G4],[:D4,:G4],[:D4,:Fs4],[:D4,:Fs4],[:D4,:Fs4],[:D4,:G4],[:D4,:G4],[:D4,:G4],[:F4,:A4],[:F4,:A4],[:F4,:A4],[:D4,:G4],:G4,:Fs4,[:D4,:G4],[:D4,:G4],[:D4,:G4],[:D4,:G4],[:D4,:G4],[:D4,:G4],[:C4,:E4],[:C4,:E4],[:C4,:E4],[:C4,:E4],[:D4,:G4],[:D4,:G4],[:D4,:G4],[:D4,:G4],[:D4,:Fs4],[:D4,:Fs4],[:D4,:Fs4],[:D4,:G4],[:D4,:G4],[:D4,:G4],[:F4,:A4],[:F4,:A4],[:F4,:A4],[:D4,:G4],:G4,:Fs4,[:D4,:G4],[:D4,:G4],[:D4,:G4],[:D4,:G4],[:D4,:G4],[:D4,:G4],[:C4,:E4],[:C4,:E4],[:C4,:E4],[:C4,:E4],[:D4,:G4],[:D4,:G4],[:D4,:G4],[:D4,:G4],[:D4,:Fs4],[:D4,:Fs4],[:D4,:Fs4],[:D4,:G4],[:D4,:G4],[:D4,:G4],[:F4,:A4],[:F4,:A4],[:F4,:A4],[:D4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,1.0,2.0,1.0,1.5,0.5,0.5,0.5,1.5,0.5,0.5,0.5,1.5,0.5,0.5,0.5,1.5,0.5,1.0,1.5,0.5,1.0,1.5,0.5,1.0,1.0,1.0,1.0,2.0,1.0,1.5,0.5,0.5,0.5,1.5,0.5,0.5,0.5,1.5,0.5,0.5,0.5,1.5,0.5,1.0,1.5,0.5,1.0,1.5,0.5,1.0,1.0,1.0,1.0,2.0,1.0,1.5,0.5,0.5,0.5,1.5,0.5,0.5,0.5,1.5,0.5,0.5,0.5,1.5,0.5,1.0,1.5,0.5,1.0,1.5,0.5,1.0,1.0,1.0,1.0,2.0,1.0,1.5,0.5,0.5,0.5,1.5,0.5,0.5,0.5,1.5,0.5,0.5,0.5,1.5,0.5,1.0,1.5,0.5,1.0,1.5,0.5,1.0,1.0,1.0,1.0,2.0,1.0]
in_thread do
plarray(a3,b3,0,0.5,0.3)
#play a3[i][j],sustain: b3[i][j]*0.9,release: b3[i][j]*0.1
end
end #lpf
end#reverb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment