Hi, i am currently working on a project in my school where i have to create a music with Sonic Pi. Unfortunately, i can’t seem to go past this problem. I created 2 different piano part, one that play first and the second one later however, once i put my second part in my program it dosent play it??? Like it wasnt there. I though there was problem with the program so i played it by itself however it work fine. Please help
This is my program
use_bpm 88
#Introduction
# Our chord sequence
vol=1000
p1 = [chord(:C3,"minor"),
chord(:G2,"7"),
chord(:Bb2,"major"),
chord(:G2,"7"),
]
# the main piano
with_fx :level, amp: 2 do
with_fx :reverb do
with_synth :piano do
p1.each {
|c|
cc = c
play c, decay: 1
play c+12
sleep 2.7
}
end
end
end
#PART 1
# Our chord sequence
vol=1000
p1 = [chord(:C3,"minor"),
chord(:G2,"7"),
chord(:Bb2,"major"),
chord(:G2,"7"),
]
# the main piano
with_fx :level, amp: 1 do
with_fx :reverb do
with_synth :piano do
live_loop :piano do
p1.each {
|c|
cc = c
play c, decay: 1
play c+12
sleep 4
}
end
end
end
end
use_synth :piano
use_bpm 88
define :play_phrase do
play_pattern_timed [48, 70, 68, 67, 65, 63, 65, 67, 65, 60, 55, 58, 60, 58, 60, 63, 65, 65, 65, 60, 60],
[1, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 1, 0.5, 3.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 1, 1, 1, 0.5, 0.5]
end
# this thread plays the phrase consistently
with_fx :pan, pan: -0.5 do
in_thread(name: :steady) do
1.times do
play_phrase
sleep 5
end
end
end
#PART 2
p2 = [chord(:F3,"major7"),
chord(:E3,"minor7"),
chord(:D3,"minor7"),
chord(:D3,"m7-5"),
chord(:C3,"major7"),
]
# the main piano
with_fx :level, amp: 3 do
with_fx :reverb do
with_synth :piano do
live_loop :piano do
p2.each {
|c|
cc = c
play c, decay: 1
play c+12
sleep 5
play c+12
sleep 2
play c+12
sleep 1
}
end
end
end
end
use_synth :piano
use_bpm 88
define :play_phrase do
play_pattern_timed [64, 60, 57, 64, 60, 57, 64, 60, 57, 64, 60, 57, 62, 59, 55, 62, 59, 55, 62, 59, 55, 62, 59, 55, 60, 57, 53, 60, 57, 53, 60, 57, 53, 60, 57, 53, 59, 55, 52, 59, 55, 52, 59, 55, 52, 59, 55, 52, 59, 55, 52],
[0.3, 0.3, 0.3, 0.3, 0.3, 0.3]
end
# this thread plays the phrase consistently
with_fx :pan, pan: -0.5 do
in_thread(name: :steady) do
1.times do
play_phrase
sleep 5
end
end
end
# First part in piano without chords
use_synth :piano
use_bpm 88
define :play_phrase do
play_pattern_timed [48, 70, 68, 67, 65, 63, 65, 67, 65, 60, 55, 58, 60, 58, 60, 63, 65, 65, 65, 60, 60],
[1, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 1, 0.5, 3.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 1, 1, 1, 0.5, 0.5]
end
# this thread plays the phrase consistently
with_fx :pan, pan: -0.5 do
in_thread(name: :steady) do
1.times do
play_phrase
sleep 5
end
end
end
# Second Part in piano without cords
use_synth :piano
use_bpm 88
define :play_phrase do
play_pattern_timed [64, 60, 57, 64, 60, 57, 64, 60, 57, 64, 60, 57, 62, 59, 55, 62, 59, 55, 62, 59, 55, 62, 59, 55, 60, 57, 53, 60, 57, 53, 60, 57, 53, 60, 57, 53, 59, 55, 52, 59, 55, 52, 59, 55, 52, 59, 55, 52, 59, 55, 52],
[0.3, 0.3, 0.3, 0.3, 0.3, 0.3]
end
# this thread plays the phrase consistently
with_fx :pan, pan: -0.5 do
in_thread(name: :steady) do
1.times do
play_phrase
sleep 5
end
end
end