# Mehackit tutorial - question about rings and ticks

**URL:** <https://in-thread.sonic-pi.net/t/mehackit-tutorial-question-about-rings-and-ticks/10081>\
**Category:** Support, Help & Resources\
**Created:** [October 31, 2026, 11:10am UTC](https://in-thread.sonic-pi.net/t/mehackit-tutorial-question-about-rings-and-ticks/10081 "2026-10-31T11:10:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisB](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/chrisb/32/3145_2.png) [@ChrisB](https://in-thread.sonic-pi.net/u/ChrisB)\
**Post date:** [October 31, 2026, 11:10am UTC](https://in-thread.sonic-pi.net/t/mehackit-tutorial-question-about-rings-and-ticks/10081/1 "2026-10-31T11:10:14Z")

</div>

I’m working my way through this tutorial (as a complete novice ) and have got a bit confused with this example from the section on [rings and ticks](https://sonic-pi.mehackit.org/exercises/en/04-generate-sounds/02-tick.html) What exactly is the ring function bringing to the party here, as it seems to make no difference if I remove it?

live\_loop :keys do  
use\_synth :blade  
play [(chord :Ab, :major7), (chord :Db, :major7), (chord :Bb, :minor7), (chord :Eb, ‘7’)].ring.tick, attack: 0.1, release: 1  
sleep 1  
end

---

<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:** [October 31, 2026, 6:38pm UTC](https://in-thread.sonic-pi.net/t/mehackit-tutorial-question-about-rings-and-ticks/10081/2 "2026-10-31T18:38:45Z")

</div>

If you’re using .tick, it doesn’t make a difference because .tick treats arrays as if they were rings. But if you try to access the elements by index, then you will see a difference. For example:

```ruby
data = [(chord :Ab, :major7), (chord :Db, :major7), (chord :Bb, :minor7), (chord :Eb, '7')]

puts "Without ring"
range(0, 8).each do |i|
  puts i, data[i]
end

puts "With ring"
range(0, 8).each do |i|
  puts i, data.ring[i]
end

```

The first loop prints:

```ruby
"Without ring"
0.0 (ring 68, 72, 75, 79)
1.0 (ring 61, 65, 68, 72)
2.0 (ring 70, 73, 77, 80)
3.0 (ring 63, 67, 70, 73)
4.0 nil
5.0 nil
6.0 nil
7.0 nil

```

But the second loop prints:

```ruby
"With ring"
0.0 (ring 68, 72, 75, 79)
1.0 (ring 61, 65, 68, 72)
2.0 (ring 70, 73, 77, 80)
3.0 (ring 63, 67, 70, 73)
4.0 (ring 68, 72, 75, 79)
5.0 (ring 61, 65, 68, 72)
6.0 (ring 70, 73, 77, 80)
7.0 (ring 63, 67, 70, 73)

```

You can see in the first loop when it gets to the end of the array it just gets `nil`, but in the second loop in loops back around to the start, even when you get elements by index.
