How do i randomly select notes from a scale?

So I want to try be able to randomly select notes from a scale.
I can’t seem to figure out the best way of doing this.
Is it possible to send the notes of a scale to a list and then call them randomly from the list?

Hello @happicat :slight_smile:

I can’t seem to figure out the best way of doing this.

What have you learnt or tried so far?

Honestly I’m still trying to find a list of all the syntax for the language so I can actually see what it does as the info in the tutorial seems limited as it doesn’t discuss all the options.

Sure! Aside from the information in tutorial chapter 4 on Randomisation, (also at Sonic Pi - Tutorial), the list of Sonic Pi functions is in the Help panel of the app, under the Lang tab.
The most useful function you’re probably after is something like choose. (Which you can use as a normal function that you pass a list into, or use by chaining .choose onto the end of a list/ring.)

1 Like

You may also find pick (as in (ring ...).pick) useful…

Hi @happicat

notes = scale :c, :acem_asiran

live_loop :pick_a_note do
  play notes.pick
  sleep 1
end

Cheers