Deadmau - rerun breaks rythm[i]

Hi all
Trying to recreate an old translated Ableton lesson in Sonic Pi.

Trouble: If you rerun code it goes out of sync because of “i=0”

So how can I combine rythm and chord progression and still have the ability to turn on/off mixer?

Kind regards
Relaxnow


# ----------------------------------------------------------------------------------------------------------------------------#
#   Trouble:       1) If you rerun code it goes out of sync because of "i=0"                                                  #
# ----------------------------------------------------------------------------------------------------------------------------#


# ----------------------------------------------------------------------------------------------------------------------------#
# 220418 13:09
# Trying to recreate: "151102 Deadmau5 udfordring lav en ny melodi"
#  from a "how to Deadmau" in Ableton, that I have translated to danish from english from YouTube.
#  Original english youtube video is not public anymore.

# My Ableton video https://youtu.be/VMKj7SpBwfg from 0:00-0.08 "part C" is what I try to recreate.
# Notes to "part C" from here https://youtu.be/VMKj7SpBwfg?t=86


use_bpm 120
live_loop :met do
  sleep 1
end


# ----------------------------------------------------------------------------------------------------------------------------#
# Mixer  - NB not working currently => breaks rythm[i]  because of "i=0"                                                      #
my_chord = 1                                                                                                                  #
drum     = 2       # 0 no drum                                                                                                #
#                  # 1 only kick                                                                                              #
#                  # 2 kick and snare                                                                                         #
hihat    = 1                                                                                                                  #
# ----------------------------------------------------------------------------------------------------------------------------#


# ----------------------------------------------------------------------------------------------------------------------------#
# just here to not get error. #I dont understand why yet. Tried defonce, so I could avoid resetting "i=0" on rerun, but that didnt work.
repeat = ""
i=0                # Trouble: if you rerun code it goes out of sync because of i=0
# ----------------------------------------------------------------------------------------------------------------------------#



# ----------------------------------------------------------------------------------------------------------------------------#
# Rythm whole song
rythm = [1,0,0,1,  0,0,1,0,  0,1,0,0,  1,0,0,1,  0,0,1,0]

#         array, repeated x times
# Part C  0,1              1,1              2,4              3,4              4,1              5,1             6,1              7,2              8,2               9,5
notes = [:a3, :e4, :c5], [:a3, :e4, :a4], [:a3, :e4, :b4], [:d3, :f4, :c5], [:d3, :f4, :d5], [:f3, :g4, :c5], [:f3, :g4, :a4], [:f3, :g4, :b4], [:f3, :g4, :c5], [:g3, :g4, :b4]

#my improv
#notes = [:a3, :e4, :g5], [:a3, :e4, :d5], [:a3, :e4, :b4], [:d3, :f4, :c5], [:d3, :f4, :d5], [:f3, :g4, :c5], [:f3, :g4, :a4], [:f3, :g4, :b4], [:f3, :g4, :c5], [:g3, :g4, :b4]
# ----------------------------------------------------------------------------------------------------------------------------#



with_fx :reverb do
  with_fx :ixi_techno, phase: 80, cutoff_min: 80, cutoff_max: 110, res: 0.3 do
    
    live_loop :chords, sync: :met do
      stop if my_chord<1
      
      if rythm[i]==1
        
        #puts "i", i, "rythm[i]=", rythm[i], "repeat=",repeat, "notes=",notes[i]
        
        # Number of repeat on chords
        repeat = knit(0,1, 1,1, 2,4, 3,4, 4,1,  5,1, 6,1, 7,2, 8,2, 9,5).tick(:a) # part C
        
        r=rrand(0.15, 0.25)
        c= range(90,130, steps: 2.5).mirror.tick(:a1)
        
        # Chords
        use_synth :saw
        play_chord notes[repeat], attack: 0, release: r, cutoff: c, amp: 2, pan: rrand(-1,1) #if rythm[i] == 1
        # Subbass
        use_synth  :fm
        play_chord notes[repeat].take(1),  attack: 0, release: r, pitch: 0, cutoff: 90, amp: 1 # if rythm[i] == 1
        
      end
      sleep 0.25
      
      
      # resets "i" which counts the rythm[i]     (should "rythm" be a ring instead of an array?)
      if i<20 then i=i+1
      else
        i=0
        #cue :kick # tried to fix sync with cue but didnt work - not sure if I did it right
        #cue :i    # tried to fix sync with cue but didnt work - not sure if I did it right
      end
      
    end
    
  end # end fx
end # end fx



# ----------------------------------------------------------------------------------------------------------------------------#
live_loop :hihat, sync: :met do
  #stop
  stop if hihat<1
  
  use_synth :noise
  play :c5, release: rrand(0.01,0.03), amp: ring(0.6,0.8).choose, cutoff: rrand(100,130),
    pitch: 36, pan: ring(0,0.35,-0.35).choose if bools(0,0,1,1).tick(:bools1)
  sleep 0.25
end
# ----------------------------------------------------------------------------------------------------------------------------#



live_loop :kick, sync: :met do
  
  a=1.5            # amp: 1-2
  a_snare = a-0.6
  
  case drum
  when 0
    sleep 4
    
  when 1
    4.times do
      sample :bd_haus, cutoff: 80, amp: a, pan: 1
      sample :bd_haus, cutoff: 90, amp: a, pan: -1
      sleep 1
    end
    
  when 2
    sample :bd_haus, cutoff: 80, amp: a, pan: 1
    sample :bd_haus, cutoff: 90, amp: a, pan: -1
    sleep 1
    sample :bd_haus, cutoff: 80, amp: a
    use_synth :noise
    play :c5, release: rrand(0.2,0.25), amp: a_snare
    sleep 1
    sample :bd_haus, cutoff: 80, amp: a, pan: 1
    sample :bd_haus, cutoff: 90, amp: a, pan: -1
    sleep 1
    sample :bd_haus, cutoff: 80, amp: a
    use_synth :noise
    play :c5, release: rrand(0.2,0.25), amp: a_snare
    sleep 1
  end
  
end
# ----------------------------------------------------------------------------------------------------------------------------#


My translated Ableton lesson in danish on Deadmau

Hey hey @Relaxnow :slightly_smiling_face:
I can’t say that it will fix your exact problem, but there’s no need to use a manual counter to step through the rythm array - tick and look will work just fine :slight_smile:

If you wish to keep with the manual counter, then what might help avoid i being reset on rerun? if you’re prepared to do so, I’d encourage the idea of using get and set instead of relying on plain old scoped local variables, if you need to do something like initialise a value in an outer scope and then refer to it inside a live_loop nested further down. One advantage of doing this with the Time-State memory store instead of plain local variables is that you can do the trick of checking whether the variable you store in Time-State has been initialised yet, or whether nil is returned instead. That way you can do something like this:

set(:my_chord, 1)
set(:drum, 1)
set(:hihat, 1)
set(:i, 0) if i.nil? # or: 'unless i' -> only set i if it has not already been initialised

# and further down...

if rythm[get(:i)]==1 # (eg. use get(:i) instead of i (and set(:i, X) instead of i = X)

Does any of that help at all? :crossed_fingers:

(PS. I find using (bools 1, 0, ...) and then doing something if bools.look is more my preference than an array or ring of 0s and 1s - since the ring values are treated as booleans - but that’s a matter of personal taste! :slightly_smiling_face: ) [Edit - oh, I see you’ve used (bools ...) further down already as well!]

1 Like

Ty @ethancrawford
I would prefer to use tick and look, but didnt see how to do both rythm and chords progression without resetting rythm part, since chords changes during rythm progression?

I’ll check out set and get

Sure. Do you just want the chords to keep cycling endlessly, but cut in and out according to the rhythm?
This seems to work, unless I’m misunderstanding your goals still :sweat_smile: - tell me if so!

Changes: using tick and look instead of a manual counter (left in but unused)…

# ----------------------------------------------------------------------------------------------------------------------------#
#   Trouble:       1) If you rerun code it goes out of sync because of "i=0"                                                  #
# ----------------------------------------------------------------------------------------------------------------------------#


# ----------------------------------------------------------------------------------------------------------------------------#
# 220418 13:09
# Trying to recreate: "151102 Deadmau5 udfordring lav en ny melodi"
#  from a "how to Deadmau" in Ableton, that I have translated to danish from english from YouTube.
#  Original english youtube video is not public anymore.

# My Ableton video https://youtu.be/VMKj7SpBwfg from 0:00-0.08 "part C" is what I try to recreate.
# Notes to "part C" from here https://youtu.be/VMKj7SpBwfg?t=86


use_bpm 120
live_loop :met do
  sleep 1
end


# ----------------------------------------------------------------------------------------------------------------------------#
# Mixer  - NB not working currently => breaks rythm[i]  because of "i=0"                                                      #
my_chord = 1                                                                                                                  #
drum     = 2       # 0 no drum                                                                                                #
#                  # 1 only kick                                                                                              #
#                  # 2 kick and snare                                                                                         #
hihat    = 1                                                                                                                  #
# ----------------------------------------------------------------------------------------------------------------------------#


# ----------------------------------------------------------------------------------------------------------------------------#
# just here to not get error. #I dont understand why yet. Tried defonce, so I could avoid resetting "i=0" on rerun, but that didnt work.
repeat = ""
i=0                # Trouble: if you rerun code it goes out of sync because of i=0
# ----------------------------------------------------------------------------------------------------------------------------#



# ----------------------------------------------------------------------------------------------------------------------------#
# Rythm whole song
rythm = [1,0,0,1,  0,0,1,0,  0,1,0,0,  1,0,0,1,  0,0,1,0,0] # note the extra 0 at the end...

#         array, repeated x times
# Part C  0,1              1,1              2,4              3,4              4,1              5,1             6,1              7,2              8,2               9,5
notes = [:a3, :e4, :c5], [:a3, :e4, :a4], [:a3, :e4, :b4], [:d3, :f4, :c5], [:d3, :f4, :d5], [:f3, :g4, :c5], [:f3, :g4, :a4], [:f3, :g4, :b4], [:f3, :g4, :c5], [:g3, :g4, :b4]

#my improv
#notes = [:a3, :e4, :g5], [:a3, :e4, :d5], [:a3, :e4, :b4], [:d3, :f4, :c5], [:d3, :f4, :d5], [:f3, :g4, :c5], [:f3, :g4, :a4], [:f3, :g4, :b4], [:f3, :g4, :c5], [:g3, :g4, :b4]
# ----------------------------------------------------------------------------------------------------------------------------#



with_fx :reverb do
  with_fx :ixi_techno, phase: 80, cutoff_min: 80, cutoff_max: 110, res: 0.3 do
    live_loop :chords, sync: :met do
      tick(:r)
      
      stop if my_chord<1
      
      if rythm.look(:r)==1
        
        #puts "i", i, "rythm[i]=", rythm[i], "repeat=",repeat, "notes=",notes[i]
        
        # Number of repeat on chords
        repeat = knit(0,1, 1,1, 2,4, 3,4, 4,1,  5,1, 6,1, 7,2, 8,2, 9,5).tick(:a) # part C
        
        r=rrand(0.15, 0.25)
        c= range(90,130, steps: 2.5).mirror.tick(:a1)
        
        # Chords
        use_synth :saw
        play_chord notes[repeat], attack: 0, release: r, cutoff: c, amp: 2, pan: rrand(-1,1) #if rythm[i] == 1
        # Subbass
        use_synth  :fm
        play_chord notes[repeat].take(1),  attack: 0, release: r, pitch: 0, cutoff: 90, amp: 1 # if rythm[i] == 1
        
      end
      sleep 0.25
      
      
      # resets "i" which counts the rythm[i]     (should "rythm" be a ring instead of an array?)
      if i<20 then i=i+1
      else
        i=0
        #cue :kick # tried to fix sync with cue but didnt work - not sure if I did it right
        #cue :i    # tried to fix sync with cue but didnt work - not sure if I did it right
      end
      
    end
    
  end # end fx
end # end fx



# ----------------------------------------------------------------------------------------------------------------------------#
live_loop :hihat, sync: :met do
  #stop
  stop if hihat<1
  
  use_synth :noise
  play :c5, release: rrand(0.01,0.03), amp: ring(0.6,0.8).choose, cutoff: rrand(100,130),
    pitch: 36, pan: ring(0,0.35,-0.35).choose if bools(0,0,1,1).tick(:bools1)
  sleep 0.25
end
# ----------------------------------------------------------------------------------------------------------------------------#



live_loop :kick, sync: :met do
  
  a=1.5            # amp: 1-2
  a_snare = a-0.6
  
  case drum
  when 0
    sleep 4
    
  when 1
    4.times do
      sample :bd_haus, cutoff: 80, amp: a, pan: 1
      sample :bd_haus, cutoff: 90, amp: a, pan: -1
      sleep 1
    end
    
  when 2
    sample :bd_haus, cutoff: 80, amp: a, pan: 1
    sample :bd_haus, cutoff: 90, amp: a, pan: -1
    sleep 1
    sample :bd_haus, cutoff: 80, amp: a
    use_synth :noise
    play :c5, release: rrand(0.2,0.25), amp: a_snare
    sleep 1
    sample :bd_haus, cutoff: 80, amp: a, pan: 1
    sample :bd_haus, cutoff: 90, amp: a, pan: -1
    sleep 1
    sample :bd_haus, cutoff: 80, amp: a
    use_synth :noise
    play :c5, release: rrand(0.2,0.25), amp: a_snare
    sleep 1
  end
  
end
# ----------------------------------------------------------------------------------------------------------------------------#
1 Like

Tyty
Version 2 now with mixer + sync + rythm is working

Right now track sleep 4 before starting. How can I get it to start firsttime without sleep?

# 220418 16:00 version 2




# Trying to recreate: "151102 Deadmau5 udfordring lav en ny melodi"
#  from a "how to Deadmau" in Ableton, that I have translated to danish from english from YouTube.
#  Original english youtube video is not public anymore.

# My Ableton video https://youtu.be/VMKj7SpBwfg from 0:00-0.08 "part C" is what I try to recreate.
# Notes to "part C" from here https://youtu.be/VMKj7SpBwfg?t=86


use_bpm 120
live_loop :met do
  sleep 4          # to get kick and snare at proper place
end

# ------------- Mixer ------------------# (0 stops, 1 plays) is now working with sync
my_chord = 1                            #
drum     = 2       # 0 no drum          #
#                  # 1 only kick        #
#                  # 2 kick and snare   #
hihat    = 1                            #
# --------------------------------------#






# ----------------------------------------------------------------------------------------------------------------------------#
# Rythm whole song
rythm = [1,0,0,1,  0,0,1,0,  0,1,0,0,  1,0,0,1,  0,0,1,0,0] # note the extra 0 at the end...
#rythm = [1,0,0,1,  0,0,1,0,  0,1,0,0,  1,0,0,1,  0,0,1,0] # original
#rythm = [1,0,0,1,  0,0,1,0,  0,1,0,0,  1,0,0,1,  0,0,1,0,  1,0,0,1,  0,0,1,0,  0,1,0,0,  1,0,0,1,  0,0,1,0] # version 2

#         array, repeated x times
# Part C  0,1              1,1              2,4              3,4              4,1              5,1             6,1              7,2              8,2               9,5
notes = [:a3, :e4, :c5], [:a3, :e4, :a4], [:a3, :e4, :b4], [:d3, :f4, :c5], [:d3, :f4, :d5], [:f3, :g4, :c5], [:f3, :g4, :a4], [:f3, :g4, :b4], [:f3, :g4, :c5], [:g3, :g4, :b4]

#my improv
#notes = [:a3, :e4, :g5], [:a3, :e4, :d5], [:a3, :e4, :b4], [:d3, :f4, :c5], [:d3, :f4, :d5], [:f3, :g4, :c5], [:f3, :g4, :a4], [:f3, :g4, :b4], [:f3, :g4, :c5], [:g3, :g4, :b4]
# ----------------------------------------------------------------------------------------------------------------------------#



with_fx :reverb do
  with_fx :ixi_techno, phase: 80, cutoff_min: 80, cutoff_max: 110, res: 0.3 do
    live_loop :chords, sync: :met do
      tick(:r)
      
      stop if my_chord<1
      
      if rythm.look(:r)==1
        
        #puts "i", i, "rythm[i]=", rythm[i], "repeat=",repeat, "notes=",notes[i]
        
        # Number of repeat on chords
        repeat = knit(0,1, 1,1, 2,4, 3,4, 4,1,  5,1, 6,1, 7,2, 8,2, 9,5).tick(:a) # part C
        
        r=rrand(0.15, 0.25)
        c= range(90,130, steps: 2.5).mirror.tick(:a1)
        
        # Chords
        use_synth :saw
        play_chord notes[repeat], attack: 0, release: r, cutoff: c, amp: 2, pan: rrand(-1,1) #if rythm[i] == 1
        # Subbass
        use_synth  :fm
        play_chord notes[repeat].take(1),  attack: 0, release: r, pitch: 0, cutoff: 90, amp: 1 # if rythm[i] == 1
        
      end
      sleep 0.25
    end
    
  end # end fx
end # end fx



# ----------------------------------------------------------------------------------------------------------------------------#
live_loop :hihat, sync: :met do
  #stop
  stop if hihat<1
  
  use_synth :noise
  play :c5, release: rrand(0.01,0.03), amp: ring(0.6,0.8).choose, cutoff: rrand(100,130),
    pitch: 36, pan: ring(0,0.35,-0.35).choose if bools(0,0,1,1).tick(:bools1)
  sleep 0.25
end
# ----------------------------------------------------------------------------------------------------------------------------#



live_loop :kick, sync: :met do
  
  a=1.5            # amp: 1-2
  a_snare = a-0.6
  
  case drum
  when 0
    sleep 4
    
  when 1
    4.times do
      sample :bd_haus, cutoff: 80, amp: a, pan: 1
      sample :bd_haus, cutoff: 90, amp: a, pan: -1
      sleep 1
    end
    
  when 2
    sample :bd_haus, cutoff: 80, amp: a, pan: 1
    sample :bd_haus, cutoff: 90, amp: a, pan: -1
    sleep 1
    sample :bd_haus, cutoff: 80, amp: a
    use_synth :noise
    play :c5, release: rrand(0.2,0.25), amp: a_snare
    sleep 1
    sample :bd_haus, cutoff: 80, amp: a, pan: 1
    sample :bd_haus, cutoff: 90, amp: a, pan: -1
    sleep 1
    sample :bd_haus, cutoff: 80, amp: a
    use_synth :noise
    play :c5, release: rrand(0.2,0.25), amp: a_snare
    sleep 1
  end
  
end
# ----------------------------------------------------------------------------------------------------------------------------#

That’s to do with the sync mechanism when it was reworked in v3.0 - where syncing threads will only catch the cue from the triggering thread after they have happened - so in this case, all threads syncing on the :met live_loop cue only catch the cue after one cycle of :met has already completed. So, to work around the long starting delay, while you can’t remove it entirely, you can at least shorten the sleep (to one beat instead of four for example).

1 Like

Version 3 with right rythm

# 220419 01:32 version 3 with right rythm
# backup 220418

# Trying to recreate: "151102 Deadmau5 udfordring lav en ny melodi"
#  from a "how to Deadmau" in Ableton, that I have translated to danish from english from YouTube.
#  Original english youtube video is not public anymore.

# My Ableton video https://youtu.be/VMKj7SpBwfg from 0:00-0.08 "part C" is what I try to recreate.
# Notes to "part C" from here https://youtu.be/VMKj7SpBwfg?t=86


use_bpm 120  #120
live_loop :met do
  4.times do
    # sample :elec_beep, amp: 2
    sleep 1          # to get kick and snare at proper place
  end
end

# ------------- Mixer ------------------# (0 stops, 1 plays) is now working with sync
my_chord = 1                            #
drum     = 2       # 0 no drum          #
#                  # 1 only kick        #
#                  # 2 kick and snare   #
hihat    = 1                            #
# --------------------------------------#



# ----------------------------------------------------------------------------------------------------------------------------#
# Rythm whole song
rythm = [1,0,0,1,  0,0,1,0,  0,1,0,0,  1,0,0,1,  0,0,1,0,0, 1,0,0,1,  0,0,1,0, 0,1,0 ] # version 3

#         array, repeated x times
# Part C  0,1              1,1              2,4              3,4              4,1              5,1             6,1              7,2              8,2               9,5
notes = [:a3, :e4, :c5], [:a3, :e4, :a4], [:a3, :e4, :b4], [:d3, :f4, :c5], [:d3, :f4, :d5], [:f3, :g4, :c5], [:f3, :g4, :a4], [:f3, :g4, :b4], [:f3, :g4, :c5], [:g3, :g4, :b4]

#my improv
#notes = [:a3, :e4, :g5], [:a3, :e4, :d5], [:a3, :e4, :b4], [:d3, :f4, :c5], [:d3, :f4, :d5], [:f3, :g4, :c5], [:f3, :g4, :a4], [:f3, :g4, :b4], [:f3, :g4, :c5], [:g3, :g4, :b4]
# ----------------------------------------------------------------------------------------------------------------------------#



with_fx :reverb do
  with_fx :ixi_techno, phase: 80, cutoff_min: 80, cutoff_max: 110, res: 0.3 do
    live_loop :chords, sync: :met do
      tick(:r)
      
      stop if my_chord<1
      
      if rythm.look(:r)==1
        
        #puts "i", i, "rythm[i]=", rythm[i], "repeat=",repeat, "notes=",notes[i]
        
        # Number of repeat on chords
        repeat = knit(0,1, 1,1, 2,4, 3,4, 4,1,  5,1, 6,1, 7,2, 8,2, 9,5).tick(:a) # part C
        
        r=rrand(0.15, 0.25)
        c= range(90,130, steps: 2.5).mirror.tick(:a1)
        
        # Chords
        use_synth :saw
        play_chord notes[repeat], attack: 0, release: r, cutoff: c, amp: 2, pan: rrand(-1,1) #if rythm[i] == 1
        # Subbass
        use_synth  :fm
        play_chord notes[repeat].take(1),  attack: 0, release: r, pitch: 0, cutoff: 90, amp: 1 # if rythm[i] == 1
        
      end
      sleep 0.25
    end
    
  end # end fx
end # end fx



# ----------------------------------------------------------------------------------------------------------------------------#
live_loop :hihat, sync: :met do
  #stop
  stop if hihat<1
  
  use_synth :noise
  play :c5, release: rrand(0.01,0.03), amp: ring(0.6,0.8).choose, cutoff: rrand(100,130),
    pitch: 36, pan: ring(0,0.35,-0.35).choose if bools(0,0,1,1).tick(:bools1)
  sleep 0.25
end
# ----------------------------------------------------------------------------------------------------------------------------#



live_loop :kick, sync: :met do
  
  a=1.5            # amp: 1-2
  a_snare = a-0.6
  
  case drum
  when 0
    sleep 4
    
  when 1
    4.times do
      sample :bd_haus, cutoff: 80, amp: a, pan: 1
      sample :bd_haus, cutoff: 90, amp: a, pan: -1
      sleep 1
    end
    
  when 2
    sample :bd_haus, cutoff: 80, amp: a, pan: 1
    sample :bd_haus, cutoff: 90, amp: a, pan: -1
    sleep 1
    sample :bd_haus, cutoff: 80, amp: a
    use_synth :noise
    play :c5, release: rrand(0.2,0.25), amp: a_snare
    sleep 1
    sample :bd_haus, cutoff: 80, amp: a, pan: 1
    sample :bd_haus, cutoff: 90, amp: a, pan: -1
    sleep 1
    sample :bd_haus, cutoff: 80, amp: a
    use_synth :noise
    play :c5, release: rrand(0.2,0.25), amp: a_snare
    sleep 1
  end
  
end
# ----------------------------------------------------------------------------------------------------------------------------#
2 Likes

What a great-sounding bit of code! One of the slickest-sounding things I’ve ever heard in Sonic Pi with no external samples! Thanks so much for sharing this.

A couple more ideas for the code:

First, in addition to what @ethancrawford said above, you can shorten the initial delay with a trick from @robin.newman, explained here: start the metronome loop with a very short delay: parameter, like delay: 0.01. It’s imperceptible to humans, but it gives the other loops a chance to get their syncs ready to catch the first metronome cue. (The follow-up discussion with @Martin clarifies the intuition.)

Second, the rythm variable encodes the rhythm as a list of 1s and 0s. That works well, but as a lapsed music theorist I can’t help noticing that it has a pattern: it steps by 3s until the end, when it has a couple 2s, for a total of 32 beats. This makes it a kind of “Euclidean” rhythm, which Sonic Pi’s supremely handy spread function can encapsulate as spread(11, 32): given 32 time points, trigger 11 “events” as evenly as possible. I like this slightly more synthetic formulation, as it captures the thinking behind the rhythm.

If you’re curious, there’s even an academic article that discusses Deadmau5’s use of this rhythm: A Platonic Model of Funky Rhythms by Richard Cohn. :laughing:

3 Likes

Yes, and the spread function also has the rotate opt, which presents even more variations.

ASome of the other examples that use the XOX style of programming, also use other numbers to simulate velocity. So instead of 1s and 0s, other numbers can stand in place and used for dynamics. It’s an idea but might mess with your code.

For your pan parameter have a look at rdist in the help docs.

Otherwise really like it.
Thank you @pashultz for the Cohn article.

4 Likes