the problem is, if sometimes numbers add up, which is intended, they have a chance to fall out of the scale i want to be in, which is not intended.
Is it possible to make some if statements or something like that, so the whole thing stays tuned?
live_loop :root_note do
#8
set :notea, (ring 0,0,0,0,0,0,0,0).tick(:asdfgw4)
sleep 0.25 # how long each root is hold
end
live_loop :root2 do
#7
set :pitchi, get(:notea) + 5
sleep 0.25
set :pitchi, get(:notea)
sleep 0.25
set :pitchi, get(:notea) +3
sleep 0.25
set :pitchi, get(:notea)
sleep 0.25
set :pitchi, get(:notea) + 3
sleep 0.25
set :pitchi, get(:notea) + 0
sleep 0.25
set :pitchi, get(:notea)
sleep 0.25
end
live_loop :root3 do
#5
set :pitchi1, get(:pitchi) + 0
sleep 0.25
set :pitchi1, get(:pitchi) + 3
sleep 0.25
set :pitchi1, get(:pitchi)
sleep 0.25
set :pitchi1, get(:pitchi) + 3
sleep 0.25
set :pitchi1, get(:pitchi)
sleep 0.25
end
#3
live_loop :root4 do
set :pitchi2, get(:pitchi1)
sleep 0.25
set :pitchi2, get(:pitchi1)
sleep 0.25
set :pitchi2, get(:pitchi1) + 1
sleep 0.25
end
live_loop :one21 do
use_synth :chiplead
play (ring :g3).choose, pitch: get(:pitchi2)
sleep 0.25
end
One way to do this is to rethink your approach.
Here, you add various amounts onto a ‘root note’ to end up with other notes.
The problem then is that different scales have different notes in them - so for example adding three semitones on to a particular note might sound fine in one scale, but not in another.
How could we get around this problem?
Perhaps instead of jumping up by a certain number of semitones, (which is not guaranteed to stay in the same scale), we work with degrees. Degrees are note markers within a scale.
(The functions to look for in the Lang section of the documentation are degree and chord_degree).
live_loop :roots do
#8
set :degr, 1
sleep 0.5
end
live_loop :roots1 do
#7
set :degr1, get(:degr)
sleep 0.5
set :degr1, get(:degr) + 1
sleep 0.5
set :degr1, get(:degr)
sleep 0.5
set :degr1, get(:degr)
sleep 0.5
set :degr1, get(:degr)
sleep 0.5
set :degr1, get(:degr)
sleep 0.5
set :degr1, get(:degr)
sleep 0.5
end
live_loop :roots2 do
#5
set :degr2, get(:degr1)
sleep 0.5
set :degr2, get(:degr1)
sleep 0.5
set :degr2, get(:degr1)
sleep 0.5
set :degr2, get(:degr1)
sleep 0.5
set :degr2, get(:degr1)
sleep 0.5
end
live_loop :roots3 do
#3
set :degr3, get(:degr2)
sleep 0.5
set :degr3, get(:degr2)
sleep 0.5
set :degr3, get(:degr2) + 1
sleep 0.5
end
live_loop :degrees do
play degree(get(:degr3), :C3, :minor), sustain: 0.1, release: 0.1
sleep 0.5
end