# Tick scope, name and examples

**URL:** <https://in-thread.sonic-pi.net/t/tick-scope-name-and-examples/5014>\
**Category:** Support, Help & Resources\
**Created:** [January 20, 2021, 4:41pm UTC](https://in-thread.sonic-pi.net/t/tick-scope-name-and-examples/5014 "2021-01-20T16:41:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nlb](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/nlb/32/997_2.png) [@nlb](https://in-thread.sonic-pi.net/u/nlb)\
**Post date:** [January 20, 2021, 4:41pm UTC](https://in-thread.sonic-pi.net/t/tick-scope-name-and-examples/5014/1 "2021-01-20T16:41:07Z")

</div>

Hi,

just stucked with tick

```ruby
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 ?

---

<div class="post-metadata">

**Author:** ![emlyn](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/emlyn/32/1460_2.png) [@emlyn](https://in-thread.sonic-pi.net/u/emlyn)\
**Post date:** [January 20, 2021, 6:17pm UTC](https://in-thread.sonic-pi.net/t/tick-scope-name-and-examples/5014/2 "2021-01-20T18:17:56Z")

</div>

What about:

```ruby
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.

---

<div class="post-metadata">

**Author:** ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/martin/32/157_2.png) [@Martin](https://in-thread.sonic-pi.net/u/Martin)\
**Post date:** [January 20, 2021, 7:57pm UTC](https://in-thread.sonic-pi.net/t/tick-scope-name-and-examples/5014/3 "2021-01-20T19:57:53Z")

</div>

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](https://github.com/mbutz/sonic-pi-resources/blob/b878fca3efd4a542dd24fc6604bdf83e15c1cb51/change-params-per-pattern.rb) if you like. As always in these cases this comes without warranty as it is not part of SP core.

---

<div class="post-metadata">

**Author:** ![nlb](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/nlb/32/997_2.png) [@nlb](https://in-thread.sonic-pi.net/u/nlb)\
**Post date:** [January 20, 2021, 8:23pm UTC](https://in-thread.sonic-pi.net/t/tick-scope-name-and-examples/5014/4 "2021-01-20T20:23:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Eli](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/eli/32/116_2.png) [@Eli](https://in-thread.sonic-pi.net/u/Eli)\
**Post date:** [January 20, 2021, 11:15pm UTC](https://in-thread.sonic-pi.net/t/tick-scope-name-and-examples/5014/5 "2021-01-20T23:15:52Z")

</div>

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

```ruby
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…

---

<div class="post-metadata">

**Author:** ![nlb](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/nlb/32/997_2.png) [@nlb](https://in-thread.sonic-pi.net/u/nlb)\
**Post date:** [January 21, 2021, 8:03am UTC](https://in-thread.sonic-pi.net/t/tick-scope-name-and-examples/5014/6 "2021-01-21T08:03:53Z")

</div>

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.

```ruby
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.

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

```

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

```

Is it normal ?

---

<div class="post-metadata">

**Author:** ![ethancrawford](https://avatars.discourse-cdn.com/v4/letter/e/a88e4f/32.png) [@ethancrawford](https://in-thread.sonic-pi.net/u/ethancrawford)\
**Post date:** [January 21, 2021, 8:13am UTC](https://in-thread.sonic-pi.net/t/tick-scope-name-and-examples/5014/7 "2021-01-21T08:13:56Z")

</div>

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:

> <https://github.com/sonic-pi-net/sonic-pi/blob/main/app/server/ruby/core.rb#L291>
