An Interference Sequencer

Well i thought about generating interfering patterns which then create for example melodie, sleeps, releases etc. could be used with almost eveything i guess…

Have u already tried such approach?

I think this will make it easier to sync melodies and basslines because i can use roots now
i will try to generate a song with it :slight_smile:

Ps: i Love how freaking flexible sonic pi is
Sorry for updating so much i will stop for now, xD i guess ill post at the end of the day, but without ur help i am sometimes lost haha


set_mixer_control! amp: 1


#-----------------------------------------SETS----------------------------------------
set :rslep, 1
set :sleeps1,1
set :sleeps2,1
set :sleeps3,1

set :degr3,1
set :degr2,1
set :degr1,1
set :degr,1


set :rel1, 1
set :rel2, 1
set :rel3,1
set :rel4, 1

set_mixer_control! amp: 1

#----------------------------------------------METRONOM-----------------------------------------
live_loop :metro do
 sleep 2
end


#-------------------------------------------SLEEP----------------------------------------------------------------------------------
live_loop :root_sleeps do
 #8
 set :sleeps1, (ring 0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25 ).tick(:asdfgw4)
 sleep 0.25
end

live_loop :rslep do
 #7
 set :sleeps2, get(:sleeps1)
 sleep get(:sleeps2)
 
 set :sleeps2, get(:sleeps1) + (ring 0.25, 0).tick(:safnhiogqq4)
 sleep get(:sleeps2)
 
 set :sleeps2, get(:sleeps1)
 sleep get(:sleeps2)
 
 set :sleeps2, get(:sleeps1)
 sleep get(:sleeps2)
 
 set :sleeps2, get(:sleeps1)
 sleep get(:sleeps2)
 
 set :sleeps2, get(:sleeps1)
 sleep get(:sleeps2)
 
 set :sleeps2, get(:sleeps1)
 sleep get(:sleeps2)
end


live_loop :rslep1 do
 #6
 set :sleeps3, get(:sleeps2) + 0.25
 sleep get(:sleeps3)
 
 set :sleeps3, get(:sleeps2)
 sleep get(:sleeps3)
 
 set :sleeps3, get(:sleeps2)
 sleep get(:sleeps3)
 
 set :sleeps3, get(:sleeps2)
 sleep get(:sleeps3)
 
 set :sleeps3, get(:sleeps2) + (ring 0.25, 0).tick(:safnhiogqq4)
 sleep get(:sleeps3)
end


#----------------------------------------DEGREES------------------------------------------------------------------------------------------
live_loop :roots do
 #8
 set :degr, (ring 1,1,1,1,1,1,2).tick(:gije3)
 sleep get(:sleeps3)
end

live_loop :roots1 do
 #7
 set :degr1, get(:degr)
 sleep get(:sleeps3)
 
 set :degr1, get(:degr)
 sleep get(:sleeps3)
 
 set :degr1, get(:degr)
 sleep get(:sleeps3)
 
 set :degr1, get(:degr) +5
 sleep get(:sleeps3)
 
 set :degr1, get(:degr)
 sleep get(:sleeps3)
 
 set :degr1, get(:degr)
 sleep get(:sleeps3)
 
 set :degr1, get(:degr)
 sleep get(:sleeps3)
end

live_loop :roots2 do
 #5
 set :degr2, get(:degr1) + 3
 sleep get(:sleeps3)
 
 set :degr2, get(:degr1)
 sleep get(:sleeps3)
 
 set :degr2, get(:degr1)
 sleep get(:sleeps3)
 
 set :degr2, get(:degr1) + 1
 sleep get(:sleeps3)
 
 set :degr2, get(:degr1)
 sleep get(:sleeps3)
end

live_loop :roots3 do
 #3
 set :degr3, get(:degr2)
 sleep get(:sleeps3)
 
 set :degr3, get(:degr2)
 sleep get(:sleeps3)
 
 set :degr3, get(:degr2) + 9
 sleep get(:sleeps3)
end


#---------------------------------------RELEASE-----------------------------------------------------------------------------#
live_loop :rels do
 #8
 set :rel1, (ring 0.125, 0.125,0.125,0.125,0.125,0.125,0.125,0.125).tick(:gouteh)
 sleep get(:sleeps3)
end

live_loop :rels1 do
 #7
 set :rel2, get(:rel1)
 sleep get(:sleeps3)
 
 set :rel2, get(:rel1)
 sleep get(:sleeps3)
 
 set :rel2, get(:rel1) + (ring 0.25).tick(:fpkhjg)
 sleep get(:sleeps3)
 
 set :rel2, get(:rel1)
 sleep get(:sleeps3)
 
 set :rel2, get(:rel1)
 sleep get(:sleeps3)
 
 set :rel2, get(:rel1) +0.25
 sleep get(:sleeps3)
 
 set :rel2, get(:rel1)
 sleep get(:sleeps3)
end

live_loop :rels2 do
 #5
 set :rel3, get(:rel2) +0.25
 sleep get(:sleeps3)
 
 set :rel3, get(:rel2)
 sleep get(:sleeps3)
 
 set :rel3, get(:rel2)
 sleep get(:sleeps3)
 
 set :rel3, get(:rel2) + (ring 0.25).tick(:olhwe)
 sleep get(:sleeps3)
 
 set :rel3, get(:rel2)
 sleep get(:sleeps3)
end

live_loop :rels3 do
 #3
 
 set :rel4, get(:rel3) + 0.25
 sleep get(:sleeps3)
 
 set :rel4, get(:rel3)
 sleep get(:sleeps3)
 
 set :rel4, get(:rel3) + (ring 0.25).tick(:olhwfsdfse)
 sleep get(:sleeps3)
end


#--------------------------------------------PLAYER------------------------------------------
live_loop :degrees, sync: :metro do
 
 play degree(get(:degr3), :C3, :minor), release: get(:rel3),  amp: 5
 
 sleep get(:sleeps3)
 
end

Here´s a quick sample

1 Like

Nice! I had to give sleeps3 an initial value before running otherwise ti defaults to nil and the :degrees live_loop crashes.
So added set :sleeps3, 1 at the start. (if you set it to 0 loop will object too)
Then it ran fine

1 Like

Yeah i had to start it 3-4 times to load all sets and gets i guess.
Could u tell me where i have to put that?
i tried different locations but wasn´t succesful

I put it as the very first line.

Why doesn´t it change what get(:sleeps3) recieves?, maybe because the live loop overwrites it?

It’s a matter of ordering. @samaaron will probably be able to explain it better, but (I think) the live_loop that ends up breaking manages to be evaluated before the set(:sleeps3) has had a chance to store the value in Time-State.
A workaround would be to make sure the set happens first (for example, you could execute the set in a separate buffer)

Damn i just forgot to restart sonic pi… lol

set :sleeps3, 1

set_mixer_control! amp: 1


#-----------------------------------------METRONONOM----------------------------------------
live_loop :metro do
 sleep 2
end


#-------------------------------------------SLEEP----------------------------------------------------------------------------------
live_loop :root_sleeps do
 #8
 set :sleeps1, (ring 0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25 ).tick(:asdfgw4)
 sleep 0.25
end

live_loop :rslep do
 #7
 sleep get(:sleeps1)
 set :sleeps2, get(:sleeps1)
 sleep get(:sleeps2)
 
 set :sleeps2, get(:sleeps1) + (ring 0.25, 0).tick(:safnhiogqq4)
 sleep get(:sleeps2)
 
 set :sleeps2, get(:sleeps1)
 sleep get(:sleeps2)
 
 set :sleeps2, get(:sleeps1)
 sleep get(:sleeps2)
 
 set :sleeps2, get(:sleeps1)
 sleep get(:sleeps1)
 
 set :sleeps2, get(:sleeps1)
 sleep get(:sleeps2)
 
 set :sleeps2, get(:sleeps1)
 sleep get(:sleeps2)
end

#6
live_loop :rslep1 do
 sleep get(:sleeps2)
 set :sleeps3, get(:sleeps2) + 0.25
 sleep get(:sleeps3)
 
 set :sleeps3, get(:sleeps2)
 sleep get(:sleeps3)
 
 set :sleeps3, get(:sleeps2)
 sleep get(:sleeps3)
 
 set :sleeps3, get(:sleeps2)
 sleep get(:sleeps3)
 
 set :sleeps3, get(:sleeps2) + (ring 0.25, 0).tick(:safnhiogqq4)
 
end


#----------------------------------------DEGREES------------------------------------------------------------------------------------------
live_loop :roots do
 #8
 set :degr, 1
 sleep get(:sleeps3)
end

live_loop :roots1 do
 #7
 sleep get(:sleeps3)
 set :degr1, get(:degr)
 sleep get(:sleeps3)
 
 set :degr1, get(:degr) + 2
 sleep get(:sleeps3)
 
 set :degr1, get(:degr)
 sleep get(:sleeps3)
 
 set :degr1, get(:degr)
 sleep get(:sleeps3)
 
 set :degr1, get(:degr)
 sleep get(:sleeps3)
 
 set :degr1, get(:degr)
 sleep get(:sleeps3)
 
 set :degr1, get(:degr)
 
end

live_loop :roots2 do
 #5
 sleep get(:sleeps3)
 set :degr2, get(:degr1) + 2
 sleep get(:sleeps3)
 
 set :degr2, get(:degr1)
 sleep get(:sleeps3)
 
 set :degr2, get(:degr1)
 sleep get(:sleeps3)
 
 set :degr2, get(:degr1)
 sleep get(:sleeps3)
 
 set :degr2, get(:degr1)
end

live_loop :roots3 do
 #3
 sleep get(:sleeps3)
 set :degr3, get(:degr2)
 
 sleep get(:sleeps3)
 set :degr3, get(:degr2)
 
 sleep get(:sleeps3)
 
 set :degr3, get(:degr2) + 2
 sleep get(:sleeps3)
end


#---------------------------------------RELEASE-----------------------------------------------------------------------------#
live_loop :rels do
 #8
 set :rel1, (ring 0.125, 0.125,0.125,0.125,0.125,0.125,0.125,0.125).tick(:gouteh)
 sleep get(:sleeps3)
end

live_loop :rels1 do
 #7
 sleep get(:sleeps3)
 set :rel2, get(:rel1)
 sleep get(:sleeps3)
 
 set :rel2, get(:rel1)
 sleep get(:sleeps3)
 
 set :rel2, get(:rel1) + (ring 0.25).tick(:fpkhjg)
 sleep get(:sleeps3)
 
 set :rel2, get(:rel1)
 sleep get(:sleeps3)
 
 set :rel2, get(:rel1)
 sleep get(:sleeps3)
 
 set :rel2, get(:rel1) +0.25
 sleep get(:sleeps3)
 
 set :rel2, get(:rel1)
 
end

live_loop :rels2 do
 #5
 sleep get(:sleeps3)
 set :rel3, get(:rel2) +0.25
 sleep get(:sleeps3)
 
 set :rel3, get(:rel2)
 sleep get(:sleeps3)
 
 set :rel3, get(:rel2)
 sleep get(:sleeps3)
 
 set :rel3, get(:rel2) + (ring 0.25).tick(:olhwe)
 sleep get(:sleeps3)
 
 set :rel3, get(:rel2)
end

live_loop :rels2 do
 #3
 sleep get(:sleeps3)
 set :rel4, get(:rel3) + 0.25
 sleep get(:sleeps3)
 
 set :rel4, get(:rel3)
 sleep get(:sleeps3)
 
 set :rel4, get(:rel3) + (ring 0.25).tick(:olhwfsdfse)
 
end


live_loop :degrees, sync: :metro do
 sleep get(:sleeps3)
 play degree(get(:degr3), :C3, :minor), release: get(:rel3),  amp: 5
 
end

Do u still have a copie of that code that worked for u? ^^

Actually I think you need to initiallse ALL your variables stored in the time-state BEFORE they are first retrieved, otherwise a value of nil will be retrieved.
so use multiple set <:name>,1 at the start of the program before any live_loops are started.

You could even put this in a separate buffer, and run it before starting the main program.

set :sleeps1,1
set :sleeps2,1
set :sleeps3,1
set :degr,1
set :degr3,1
set :degr2,1
#etc. maybe the rels values as well?

The intial value can be anything that will work in the contect of where the value is retrieved. Not necessarily 1, although note that sleeps must be > 0 if they are the only sleep value in a live loop.

1 Like

yep worked like a charm :smiley:
i update on the upper post :slight_smile:

1 Like