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)
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)
Try this:
puts (scale :e3, :minor).values_at(0, 2, 4)
Brilliant! Many thanks for the advise
Oops:
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
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
@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
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.
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
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. Might be useful for one or the other.
Stay healthy!