Skip to content

Instantly share code, notes, and snippets.

@rbnpi rbnpi/bransleDeLaTorche.rb
Last active May 24, 2019

Embed
What would you like to do?
Bransle_de_la_Torche by Paretorius (1571-1621) played by Sonic Pi Hear it on https://soundcloud.com/user-999157198-370666210/bransledelatorche
#Praetorius (1571-1621) Bransle_de_la_Torche
#short and sweet, trasncribed for Sonic Pi by Robin Newman May 2019
#bransleDeLaTorche.rb
use_synth :saw
use_bpm 160
#plarray plays the array notes, with corresponding array durations to give their lengths
define :plarray do |notes,durations,amp=1,pan=0,skip=false|
in_thread do
if skip #drop last note
notes=notes.reverse.drop(1).reverse
durations=durations.reverse.drop(1).reverse
end
notes.zip(durations).each do |n,d|
play n,sustain: d*0.9,release: d*0.2,amp: amp,pan: pan
sleep d
end
end
end
define :percussion do |skip|
in_thread do
32.times do
sample :drum_cymbal_closed,amp: 2
sleep 2
sample :drum_cymbal_closed,amp: 1.5
sleep 1
sample :drum_cymbal_closed,amp: 1.5
sleep 1
end
if !skip
4.times do #cymbal roll during last bar
density 8 do
sample :drum_cymbal_closed
sleep 1
end
end
end
end
end
with_fx :reverb,room: 0.6,amp: 0.4,mix: 0.7 do |v| #reverb and dynamics control
set :v,v
at [0,8*4,16*4,24*4,32*4,32*4+8*4,32*4+16*4,32*4+24*4],[0.4,0.3,0.5,0.7,0.5,0.3,0.5,1] do |av| #dynamics adjustments
control get(:v),amp: av
end
a1=[:D5,:E5,:F5,:F5,:E5,:E5,:E5,:D5,:D5,:D5,:D5,:Cs5,:A4,:D5,:E5,:F5,:F5,:E5,:F5,:G5,:A5,:F5,:E5,:D5,:Cs5,:D5,:E5,:D5,:D5,:D5,:E5,:F5,:F5,:E5,:E5,:E5,:D5,:D5,:D5,:D5,:Cs5,:A4,:D5,:E5,:F5,:F5,:E5,:F5,:G5,:A5,:F5,:E5,:D5,:Cs5,:D5,:E5,:D5,:D5,:A5,:G5,:F5,:G5,:A5,:F5,:G5,:E5,:F5,:G5,:E5,:A5,:G5,:F5,:E5,:D5,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.3,skip)
plarray(a3,b3,0.8,-0.6,skip)
plarray(a4,b4,0.8,0.6,skip)
with_synth :dsaw do
plarray(a5,b5,0.7,0,skip)
end
percussion(skip)
sleep 32*4 #need sleep as parts played in threads: gives delay before repeat
skip=false #second time play last bar
end
end #reverb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.