Tick scope, name and examples

Hi,

just stucked with tick

roots = (ring :c, :f, :g, :g)

live_loop :chords do
  use_synth :piano
  root = roots.tick
  play chord root, 'major'
  sleep 4
end

live_loop :bass do
  use_synth :fm
  play roots.look
  sleep 1
end

I want the root note to change every four beats and the chord playing the root major one every beat but change at 4
Ideas ?

What about:

live_loop :bass do
  use_synth :fm
  tick
  4.times do
    play roots.look
    sleep 1
  end
end

Tick is local to the thread (or live_loop) it’s used in, not connected to the collection you use it on.

Hi,

sorry, do not have the time to figure out an example that fits your case but I am pretty sure Modulo could help here also. See here for some examples if you like. As always in these cases this comes without warranty as it is not part of SP core.

Thanks both of you. I will see it tomorrow but I missed the point that tick was independent of the collection. See you

Sorry to hijack the thread, but whilst messing with your
code I came across this beautiful drone…

roots = (ring :c, :f, :g, :e)

live_loop :drone do
  use_synth [:fm , :hollow].choose
  tick
  4.times do
    play chord(roots.look, :minor ), attack: 4, release: 2
    sleep 1
  end
end

Eli…

1 Like

Hi,

Okay so now i understand the tick way thanks to your help !
this piece of code allows to change the chord nature based on a root note determined.

roots = (ring :c, :f, :g, :e)

use_bpm 180

live_loop :chords do
  use_synth :dark_ambience
  use_synth_defaults attack: 0.15, sustain: 4.05, cutoff: 80, amp:2
  play chord roots.tick, (ring "major","major", "sus4", "7").tick(:accords)
  sleep 4
end

live_loop :bass do
  use_synth :fm
  bass_note = roots.tick
  4.times do
    play bass_note, amp: 0.5
    sleep 1
  end
  
end

Concerning the named tick, this syntax seems to be equal to this one. The doc talks only about the :foo way.

play chord roots.tick, (ring "major","major", "sus4", "7").tick("foo")
play chord roots.tick, (ring "major","major", "sus4", "7").tick(:foo)

Is it normal ?

It is allowed, (and means the same thing) but (I’m guessing) not mentioned in docs for simplicity’s sake.
As the source code shows, a string is just converted to a symbol:

1 Like