Last active
May 1, 2017 17:06
-
-
Save bellbind/dcc6b9c85b8d45a0beca to your computer and use it in GitHub Desktop.
[sonic-pi]vivaldi - la Primavera
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# La Primavera (Vivaldi) | |
# Scale: Just Intornation | |
# E major (E=1, B=3/2, Gs=5/4, Fs=9/8, Ds=15/8, A=4/3, Cs=5/3) | |
def mult(n, m) | |
hz_to_midi(midi_to_hz(n) * m) | |
end | |
#jE5 = mult(:A5, 3.0/4) | |
jE5 = mult(:C5, 5.0/4) | |
jiscale = { | |
E5: jE5, | |
B5: mult(jE5, 3.0/2), | |
B4: mult(jE5, 3.0/4), | |
Gs5: mult(jE5, 5.0/4), | |
Fs5: mult(jE5, 9.0/8), | |
Ds6: mult(jE5, 15.0/8), | |
Ds5: mult(jE5, 15.0/16), | |
A5: mult(jE5, 4.0/3), | |
Cs6: mult(jE5, 5.0/3), | |
} | |
# FYI: Equal Temperament | |
etscale = { | |
E5: :E5, B5: :B5, B4: :B4, Gs5: :Gs5, Fs5: :Fs5, | |
Ds6: :Ds6, Ds5: :Ds5, A5: :A5, Cs6: :Cs6, | |
} | |
define :part1 do |s| | |
play_pattern_timed [s[:E5]], 0.5 | |
play_pattern_timed [s[:Gs5], s[:Gs5], s[:Gs5]], 0.5 | |
play_pattern_timed [s[:Fs5], s[:E5]], 0.25 | |
play_pattern_timed [s[:B5]], 1.5, release: 1.5 | |
end | |
define :part2 do |s| | |
play_pattern_timed [s[:B5], s[:A5]], 0.25 | |
play_pattern_timed [s[:Gs5], s[:Gs5], s[:Gs5]], 0.5 | |
play_pattern_timed [s[:Fs5], s[:E5]], 0.25 | |
play_pattern_timed [s[:B5]], 1.5, release: 1.5 | |
end | |
define :part3 do |s, cont| | |
play_pattern_timed [s[:B5], s[:A5]], 0.25 | |
play_pattern_timed [s[:Gs5]], 0.5 | |
play_pattern_timed [s[:A5], s[:B5]], 0.25 | |
play_pattern_timed [s[:A5], s[:Gs5]], 0.5 | |
if cont then | |
play_pattern_timed [s[:Fs5], s[:Ds5], s[:B4]], 0.5 # B major | |
else | |
play_pattern_timed [s[:Fs5]], 1.0, release: 1.0 | |
end | |
end | |
define :part4 do |s| | |
play_pattern_timed [s[:E5], s[:B5]], 0.5 | |
play_pattern_timed [s[:A5], s[:Gs5]], 0.25 | |
play_pattern_timed [s[:A5], s[:B5], s[:Cs6]], 0.5 | |
play_pattern_timed [s[:B5]], 1.0, release: 1.0 | |
end | |
define :part5 do |s, cont| | |
play_pattern_timed [s[:E5], s[:Cs6]], 0.5 | |
play_pattern_timed [s[:B5]], 1.0, release: 1.0 | |
play_pattern_timed [s[:A5], s[:Gs5]], 0.5 | |
play_pattern_timed [s[:Fs5], s[:E5]], 0.25 | |
#if cont then | |
play_pattern_timed [s[:Fs5], s[:E5]], 1.0, release: 1.0 | |
#else | |
# play_pattern_timed [s[:Fs5]], 1.0, release: 1.0 | |
#end | |
end | |
use_bpm 120 | |
use_synth :blade | |
define :lapremavera do |s| | |
with_fx :reverb do | |
use_synth_defaults amp: 1 | |
2.times do |i| | |
part1 s | |
part2 s | |
part3 s, i == 0 | |
use_synth_defaults amp: 0.75 | |
end | |
use_synth_defaults amp: 1.5 | |
2.times do |i| | |
sleep 0.25 | |
part4 s | |
part4 s | |
part5 s, i == 0 | |
use_synth_defaults amp: 0.75 | |
end | |
end | |
end | |
puts "Equal Temperament" | |
lapremavera etscale | |
sleep 2.0 | |
puts "Just Intornation" | |
lapremavera jiscale |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment