Skip to content

Instantly share code, notes, and snippets.

@rbnpi
Created Jun 2, 2019
Embed
What would you like to do?
recerada Tercera by Diego Ortiz 916th centry) from midi by Michael Robinson. use run_file "path-to-Ortiz3-RF.rb" to run it
#Ortiz3-RF.rb
#recerada Tercera by Diego Ortiz 916th centry) from midi by Michael Robinson
#converted for Sonic Pi by Robin Newman, June 2019
#midi file at http://www.standingstones.com/em_midi.html
#use run_file "path-to-Ortiz3-RF.rb" to run 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
a1=[:F3,:G3,:A3,:G3,:A3,:Bf3,:A3,:F3,:G3,:A3,:Bf3,:C4,:A3,:C4,:D4,:E4,:D4,:E4,:F4,:F3,:G3,:A3,:G3,:A3,:Bf3,:A3,:F3,:G3,:A3,:Bf3,:C4,:A3,:Bf3,:A3,:G3,:F3,:E3,:D3,:C3,:C4,:r,:Bf3,:A3,:G3,:F3,:F3,:E3,:D3,:C3,:Bf2,:A2,:G2,:F2,:C4,:C4,:A3,:C4,:Bf3,:A3,:G3,:C4,:C4,:A3,:C4,:Bf3,:A3,:G3,:F3,:F4,:F4,:D4,:F4,:E4,:D4,:C4,:C4,:C4,:A3,:C4,:Bf3,:A3,:G3,:F3,:C4,:C4,:A3,:C4,:Bf3,:A3,:G3,:F3,:G3,:A3,:Bf3,:C4,:A3,:Bf3,:C4,:D4,:E4,:F4,:F3,:F3,:G3,:A3,:Bf3,:C4,:D4,:E4,:F4,:G4,:F4,:E4,:D4,:C4,:Bf3,:A3,:G3,:F3,:E3,:D3,:C3,:D3,:E3,:F3,:G3,:A3,:Bf3,:C4,:Bf3,:A3,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,1.0,0.5,0.5,0.5,1.0,1.5,0.5,0.5,0.5,1.0,1.5,0.5,1.0,0.5,0.5,0.5,0.5,0.25,0.25,0.25,0.25,0.5,1.0,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.25,0.25,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.25,0.25,0.25,0.25,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,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,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,1.0]
in_thread do
plarray(a1,b1,12,-0.5)
#play note(a1[i][j])+12,sustain: b1[i][j]*0.9,release: b1[i][j]*0.1,pan: -0.5
end
with_fx :lpf,cutoff: 90 do
use_synth :tri
a2=[[:F4,:A4],[:F4,:A4],[:F4,:A4],[:F4,:Bf4],[:F4,:Bf4],[:F4,:A4],[:F4,:A4],[:E4,:G4],[:E4,:G4],[:F4,:A4],[:F4,:A4],[:F4,:A4],[:F4,:Bf4],[:F4,:Bf4],[:F4,:A4],[:E4,:G4],[:D4,:F4],:F4,:E4,[:F4,:A4],[:F4,:A4],[:F4,:A4],[:F4,:A4],[:F4,:Bf4],[:F4,:Bf4],[:F4,:A4],[:F4,:A4],[:E4,:G4],[:E4,:G4],[:F4,:A4],[:F4,:A4],[:F4,:A4],[:F4,:Bf4],[:F4,:Bf4],[:F4,:A4],[:E4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0,2.0,2.0,1.0,1.0,1.0,2.0,1.0,2.0,1.0,2.0,1.0,1.0,1.0,1.0,2.0,1.0,1.0,1.0,1.0,1.0,2.0,2.0,1.0,1.0,1.0,2.0,1.0,2.0,1.0,2.0,1.0,1.0,1.0,1.0,2.0,1.0,1.0,1.0,1.0,1.0,2.0,2.0,1.0,1.0,1.0,2.0,1.0,2.0,1.0,2.0,1.0,1.0,1.0,1.0,2.0,1.0,1.0,1.0,1.0,1.0,2.0,2.0,1.0,1.0,1.0,2.0,1.0,2.0,1.0,2.0,1.0,1.0,1.0,1.0,3.0,3.0,3.0,3.0]
in_thread do
plarray(a3,b3,0,0.4,0.5)
#play a3[i][j],sustain: b3[i][j]*0.9,release: b3[i][j]*0.1,pan: 0.4,amp: 0.4
end
end #lpf
end #reverb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment