# Create new ring

**URL:** <https://in-thread.sonic-pi.net/t/create-new-ring/3452>\
**Category:** \[P\] Patreon Support\
**Created:** [March 16, 2020, 1:15pm UTC](https://in-thread.sonic-pi.net/t/create-new-ring/3452 "2020-03-16T13:15:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![keys](https://avatars.discourse-cdn.com/v4/letter/k/96bed5/32.png) [@keys](https://in-thread.sonic-pi.net/u/keys)\
**Post date:** [March 16, 2020, 1:15pm UTC](https://in-thread.sonic-pi.net/t/create-new-ring/3452/1 "2020-03-16T13:15:21Z")

</div>

Hi, quick question. What is the most effective syntax for creating a new subset-ring from another.  
E.g I want to create a subset consisting of the 0,2,4 element of the scale below.

```
scale(:e3,:minor)
```

---

<div class="post-metadata">

**Author:** ![samaaron](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/samaaron/32/7_2.png) [@samaaron](https://in-thread.sonic-pi.net/u/samaaron)\
**Post date:** [March 16, 2020, 1:59pm UTC](https://in-thread.sonic-pi.net/t/create-new-ring/3452/2 "2020-03-16T13:59:02Z")

</div>

Try this:

```ruby
puts (scale :e3, :minor).values_at(0, 2, 4)

```

---

<div class="post-metadata">

**Author:** ![keys](https://avatars.discourse-cdn.com/v4/letter/k/96bed5/32.png) [@keys](https://in-thread.sonic-pi.net/u/keys)\
**Post date:** [March 16, 2020, 2:03pm UTC](https://in-thread.sonic-pi.net/t/create-new-ring/3452/3 "2020-03-16T14:03:47Z")

</div>

> [@samaaron](#):
>
> puts (scale :e3, :minor).values\_at(0, 2, 4)

Brilliant! Many thanks for the advise 🙂

---

<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:** [March 16, 2020, 3:28pm UTC](https://in-thread.sonic-pi.net/t/create-new-ring/3452/4 "2020-03-16T15:28:44Z")

</div>

Oops:

```ruby
puts (scale :e3, :minor).values_at(0, 2, 4)

# Runtime Error: [buffer 2, line 8] - NoMethodError
# Thread death!
# undefined method `values_at' for (ring <SonicPi::Scale :E :minor [52, 54, 55, 57, 59, 60, 62, 
# 64]):SonicPi::Core::RingVector

```

---

<div class="post-metadata">

**Author:** ![keys](https://avatars.discourse-cdn.com/v4/letter/k/96bed5/32.png) [@keys](https://in-thread.sonic-pi.net/u/keys)\
**Post date:** [March 16, 2020, 4:27pm UTC](https://in-thread.sonic-pi.net/t/create-new-ring/3452/5 "2020-03-16T16:27:12Z")

</div>

It worked fine with me.  
(Sonic Pi v3.2.0 Windows 10)

```
live_loop :test do
   notes = (scale :e3, :minor).values_at(0, 2, 4)
   play notes.tick
   sleep 0.5
 end
```

---

<div class="post-metadata">

**Author:** ![samaaron](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/samaaron/32/7_2.png) [@samaaron](https://in-thread.sonic-pi.net/u/samaaron)\
**Post date:** [March 16, 2020, 9:12pm UTC](https://in-thread.sonic-pi.net/t/create-new-ring/3452/6 "2020-03-16T21:12:42Z")

</div>

@Martin - you perhaps should be a bit clearer that you’re running the absolute latest commits which is very much unsupported and likely to be confusing for others that are running a tagged release.

Thanks for mentioning it though - it was already on my TODO list when I wrote the original reply to this thread 😉

---

<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:** [March 16, 2020, 9:49pm UTC](https://in-thread.sonic-pi.net/t/create-new-ring/3452/7 "2020-03-16T21:49:08Z")

</div>

Oh, yes, sorry. I had the other thread in mind where this was mentioned twice. But obviously I did not mention this in _this_ thread.

---

<div class="post-metadata">

**Author:** ![samaaron](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/samaaron/32/7_2.png) [@samaaron](https://in-thread.sonic-pi.net/u/samaaron)\
**Post date:** [March 17, 2020, 8:18am UTC](https://in-thread.sonic-pi.net/t/create-new-ring/3452/8 "2020-03-17T08:18:39Z")

</div>

I should add now that `values_at` should now be working again on the latest from GitHub and will be part of the upcoming beta-1

---

<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:** [March 17, 2020, 8:54am UTC](https://in-thread.sonic-pi.net/t/create-new-ring/3452/9 "2020-03-17T08:54:12Z")

</div>

Great.

Now here is my personal overview, how you can use rings to handle collection of notes, cutoff and other values: [Manipulate a collection of notes](https://github.com/mbutz/sonic-pi-resources/blob/master/manipulate-a-collection-of-notes.rb). Might be useful for one or the other.

Stay healthy!
