Scales - guyjbrown/bleepmanual GitHub Wiki

In the last tutorial we generated some random notes between two values. But that doesn't sound very musical. It would be much better if we could constrain the notes to a particular musical scale.

Bleep actually has support for a lot of different scales. And we mean a lot. They are listed here.

To specify some notes from a scale, we need to give the name of the scale, the root note (i.e. the note we are starting from) and the number of octaves. For example, the harmonic minor scale starting from D3 over one octave:

notes = scale("harmonic_minor",D3,1)

We can play the notes in the scale using a loop:

use_bpm(100)
use_synth("pluck")
notes = scale("harmonic_minor",D3,2)
for i=1,8 do
    play(notes[i],{level=0.8})
    sleep(0.25)
end

Here the notation notes[i] means "the ith note". Since i counts up from 1 to 8 in the loop, we play the 1st note, then the 2nd note and so on.

Next: Rings