Hi all
It’s my firsttime using set/get for mixing a song.
I’m having trouble with set/get not taking effect after playthrough of knit() in line 35
What am I missing?
Kind regards
Relaxnow
Manual changing works, but it’s hard to time switching between sections, so I wanna do it auto with knit() below
/ songform change here 0-3 /
songform = 1
Trouble spot “line 35” (set/get not working properly after knit() sequence?)
# Set/get not working properly after knit() sequence?
puts songform = knit(3,32, 2,16).look
Whole code
# 221117 1543 Unholy (Sonic Pi cover) draft 1
# 221117 1543 saved
# Hydra:
# Visual 1 "UNHOLY | SAM SMITH | CASSIE BARTHO CHOREOGRAPHY" https://youtu.be/QjV-tNRZfeQ
# Inspiration: UNHOLY | SAM SMITH | CASSIE BARTHO CHOREOGRAPHY
# https://youtu.be/QjV-tNRZfeQ
use_bpm 131
set :metronom, 0
live_loop :time, delay: 0.01 do
sleep 1
end
live_loop :metronom1, sync: :time do
stop if get[:metronom]<1
sample :elec_tick, amp: [1,0,0,0].tick
sleep 1
end
live_loop :songform, sync: :time do
tick
/ songform change here 0-3 /
songform = 1 # manual changing here works but it's hard to times switching between sections
/ set get not working properly after knit() sequence ?? /
puts songform = knit(3,32, 2,16).look
case songform
when 0 # 0 stop
set :metronom, 0
set :choir, 0
set :kick, 0
set :bassshort, 0
when 1 # 1 choir intro
set :choir, 1
set :kick, 0
set :bassshort, 0
when 2 # 2 drum + short bass intro
set :choir, 0
set :kick, 1
set :bassshort, 1
when 3
set :choir, 1
set :kick, 1
set :bassshort, 1 # should be a longer bass with slide
end
sleep 1
end
with_fx :level, amp: 4 do
#intro short bass
q= 0.5
mel = [:f4,:fs4,:gs4,:gs4, :fs4,:gs4,:a4,:gs4,:fs4, :f4,:fs4,:gs4,:fs4,:f4, :cs4,:d4,:fs4,:f4,:cs4,:d4,:cs4]
melsl = [q ,q ,q+q ,q+q , q ,q ,q ,q ,q+q+q+q , q , q , q , q ,q+q+q+q, q ,q ,q ,q ,q+q ,q+q , q+q]
# 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
lowbass = bools(1,0,0,1, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0)
highbass = bools(0,0,0,0, 0,0,0,0, 0,0,0,0, 1,0,0,1, 0,0,0,0, 0,0,0,0, 1,0,0,1, 0,0,0,0)
#kick = bools(1,0,0,0, 0,0,0,0, 0,0,0,0, 1,0,0,1, 0,0,0,0, 0,0,0,0, 1,0,0,1, 0,0,0,0)
kick = bools(1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 1,0,0,1, 0,0,0,0)
snare = bools(0,0,0,0, 0,0,0,0, 1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 1,0,0,0, 0,0,0,0)
cowbell = bools(0,0,0,0, 1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0)
/ choir /
with_fx :level, amp: 0.5 do
with_fx :reverb, room: 0.65 do
with_fx :krush, mix: 0.5 do
live_loop :choir1, sync: :time do
stop if get[:choir]<1
tick
use_synth :saw
c = line(90,115,step: 0.001).mirror.tick(:c1)
use_synth_defaults release: 0.45, cutoff: 100 #c #100
play mel.look
play mel.look-12, pan: 0.5
play mel.look+12, pan: -0.5
use_synth :blade
#play mel.look, amp: 2
sleep melsl.look
end
end
end
end
/ kick /
live_loop :kick1, sync: :time do
stop if get[:kick]<1
tick
sample :bd_haus, cutoff: [70,90,50].tick(:k1), amp: 4 if kick.look
with_fx :reverb, mix: 0.25 do
sample :sn_dolf, finish: 0.15, rate: 2, pan: 0.5 if snare.look and one_in(2)
sample :sn_dolf, finish: 0.125, rate: 1, pan: -0.5 if snare.look
end
sample :drum_cowbell, amp: rrand(0.25,0.4)+0.125, pan: rrand(-0.5,0.5) if cowbell.look
sleep 0.25
end
/ bass short sustain /
with_fx :ixi_techno, phase: 32 do |ixi_techno|
live_loop :bass1, sync: :time do
stop if get[:bassshort]<1
tick
use_synth_defaults sustain: 0.5, release: 0.12, cutoff: line(60,120, step: 0.1).reflect.look
use_synth :saw
play :cs2, pan: 0.5 if lowbass.look
use_synth :fm
play :cs2+0.05, pan: -0.5 if lowbass.look
use_synth :saw
play :d2, pan: 0.5 if highbass.look
use_synth :fm
play :d2+0.05, pan: -0.5 if highbass.look
control ixi_techno, mix: 0 # original
# control ixi_techno, mix: 1 # more spice
sleep 0.25
end
end
end