Skip to content

Instantly share code, notes, and snippets.

@rbnpi
Last active December 10, 2019 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbnpi/b214be4e87848ca5f74397c43034306b to your computer and use it in GitHub Desktop.
Save rbnpi/b214be4e87848ca5f74397c43034306b to your computer and use it in GitHub Desktop.
Fantasia by Milano da Francesco (1497 to 1543) played by Sonic Pi. I tweak the :pluck synth to sound more mellow and lute-like, and add a simple drum part.
#milfan58.rb
#Fantasia by Milano (da) Francesco 1497 to 1543
#The most reknowned Lutist of his time.
#I used the :pluck synth tweeked to give a more ethereal lute like sound.
#I also added a rather crude drum part.
with_fx :reverb, room: 0.8,mix: 0.7 do
use_synth :pluck #change defaults to give a smoother sound
use_synth_defaults attack: 0.05,attack_level: 0.2,decay: 0.1
with_fx :level, amp: 4 do #raise final level of parts
in_thread do #drum part first 24 bars
24.times do
use_bpm 152
use_sample_defaults amp: 0.5
sample :tabla_ghe1,pan: -0.4
sleep 2
sample :tabla_ghe1,pan: 0.4
sleep 2
sample :tabla_ghe1,pan: -0.4
sleep 3
sample :tabla_ghe1,pan: 0.4
sleep 0.5
sample :tabla_ghe1,pan: 0.4
sleep 0.5
end
end
a1=[]
b1=[]
a1[0]=[:r,:C5,:C5,:A4,:Bf4,:C5,:F4,:F4,:F4,:D4,:E4,:F4,:Bf3,:Bf4,:Bf4,:G4,:A4,:Bf4,:A4,:G4,:A4,:G4,:E4,:F4,:G4,:F4,:E4,:F4,:A4,:G4,:G4,:A4,:Bf4,:G4,:A4,:B4,:C5,:G4,:C5,:A4,:r,:r,:F4,:C5,:Bf4,:A4,:G4,:F4,:E4,:D4,:r,:r,:F4,:Bf4,:G4,:A4,:G4,:F4,:E4,:D4,:C4,:C5,:Bf4,:A4,:G4,:F4,:E4,:D4,:G4,:F4,:E4,:A4,:r,:G4,:F4,:E4,:D4,:C4,:Bf3,:A3,:G3,:r,:F4,:G4,:Bf4,:A4,:F4,:G4,:A4,:Bf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0,1.0]
a1[2]=[:F4,:C5,:Bf4,:A4,:G4,:F4,:E4]
b1[2]=[1.0,0.5,0.5,0.5,0.5,0.5,0.5]
a1[3]=[:D4,:Bf4,:Bf4,:A4]
b1[3]=[1.0,1.0,2.0,4.0]
c1=[152,150,148,132]
in_thread do
for i in 0..a1.length-1
use_bpm c1[i]
if c1[i]==132 #trigger drum part for last bar
in_thread do
sample :tabla_ghe1,pan: -0.4
sleep 4
sample :tabla_ghe1,pan: 0.4
sleep 2
with_fx :gverb,room: 20,mix: 0.225 do #mphasise last 5 drum hits
4.times do
sample :tabla_ghe1,pan: -0.4,amp: 1.1
sleep 0.5
end
sample :tabla_ghe1,pan: -0.4,amp: 1.5 #last one start of bar by itself
end
end
end
for j in 0..a1[i].length-1
play a1[i][j],amp: 0.5,sustain: b1[i][j],pan: -0.5
sleep b1[i][j]
end
end
end
a2=[]
b2=[]
a2[0]=[:r,:r,:Bf3,:Bf3,:G3,:r,:A3,:Bf3,:Ef3,:F3,:G3,:A3,:Bf3,:C4,:F3,:C4,:r,:Bf3,:G3,:Bf3,:A3,:Bf3,:C4,:A3,:Bf3,:C4,:D4,:E4,:C4,:C4,:Bf3,:A3,:G3,:F3,:r,:r,:C4,:A3,:F3,:Bf3,:G3,:C4,:r,:Bf3,:A3,:G3,:F3,:Bf3,:A3,:r,:r,:r,:C4,:Bf3,:A3,:G3,:r,:C4,:Bf3,:C4,:r,:r,:r,:r,:A3,:r,:G3,:F3,:E3,:F3,:A3,:D4,:C4,:Bf3,:A3,:Bf3,:A3,:G3,:F3,:r,:r,:r,:r,:A4,:r,:G4,:F4,:Ef4,:D4,:Bf3,:C4,:D4,:Ef4,:r,:D4,:Bf3,:C4,:F4,:D4,:Ef4,:r,:D4,:Bf3,:C4,:C4,:A3,:Bf3,:r,:A3,:F3,:G3,:C4,:A3,:Bf3,:r,:A3,:F3,:G3,:C4,:A3,:Bf3,:r,:A3,:F3,:G3,:A3,:Bf3,:G3]
b2[0]=[8.0,8.0,2.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3[i][j],pan: 0.5
sleep b3[i][j]
end
end
end
end #level
end#reverb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment