# Create scale

``

    scale  tonic (symbol), name (symbol)

Creates a ring of MIDI note numbers when given a tonic note and a scale name. Also takes an optional `num_octaves:` parameter (octave `1` is the default). If only passed the scale name, the tonic defaults to 0. See examples.

Introduced in v2.0

## Options

num_octaves: | The number of octaves you’d like the scale to consist of. More octaves means a larger scale. Default is 1.

## Examples

# Example 1
``
    puts (scale :C, :major)
| ``
    # returns the following ring of MIDI note numbers: (ring 60, 62, 64, 65, 67, 69, 71, 72)
# Example 2
``
    play_pattern (scale :C, :major)
| ``
    # anywhere you can use a list or ring of notes, you can also use scale
# Example 3
``
    play_pattern (scale :C, :major, num_octaves: 2)
| ``
    # you can use the :num_octaves parameter to get more notes
# Example 4
``
    puts (scale 50, :minor)
    puts (scale 50.1, :minor)
    puts (scale :minor)
| ``
    # Scales can start with any note:
    #=> (ring 50, 52, 53, 55, 57, 58, 60, 62)
    #=> (ring 50.1, 52.1, 53.1, 55.1, 57.1, 58.1, 60.1, 62.1)
    #=> (ring 0, 2, 3, 5, 7, 8, 10, 12)
# Example 5
``
    live_loop :scale_player do
      play (scale :Eb3, :super_locrian).tick, release: 0.1
      sleep 0.125
    end
| ``
    # scales are also rings
# Example 6
``
    live_loop :scaled_sample do
      sample :bass_trance_c, rpitch: (scale 0, :minor).tick
      sleep 1
    end
| ``
    # scales starting with 0 are useful in combination with sample's rpitch:
# Example 7
``
    (scale :C, :diatonic)
    (scale :C, :ionian)
    (scale :C, :major)
    (scale :C, :dorian)
    (scale :C, :phrygian)
    (scale :C, :lydian)
    (scale :C, :mixolydian)
    (scale :C, :aeolian)
    (scale :C, :minor)
    (scale :C, :locrian)
    (scale :C, :hex_major6)
    (scale :C, :hex_dorian)
    (scale :C, :hex_phrygian)
    (scale :C, :hex_major7)
    (scale :C, :hex_sus)
    (scale :C, :hex_aeolian)
    (scale :C, :minor_pentatonic)
    (scale :C, :yu)
    (scale :C, :major_pentatonic)
    (scale :C, :gong)
    (scale :C, :egyptian)
    (scale :C, :shang)
    (scale :C, :jiao)
    (scale :C, :zhi)
    (scale :C, :ritusen)
    (scale :C, :whole_tone)
    (scale :C, :whole)
    (scale :C, :chromatic)
    (scale :C, :harmonic_minor)
    (scale :C, :melodic_minor_asc)
    (scale :C, :hungarian_minor)
    (scale :C, :octatonic)
    (scale :C, :messiaen1)
    (scale :C, :messiaen2)
    (scale :C, :messiaen3)
    (scale :C, :messiaen4)
    (scale :C, :messiaen5)
    (scale :C, :messiaen6)
    (scale :C, :messiaen7)
    (scale :C, :super_locrian)
    (scale :C, :hirajoshi)
    (scale :C, :kumoi)
    (scale :C, :neapolitan_major)
    (scale :C, :bartok)
    (scale :C, :bhairav)
    (scale :C, :locrian_major)
    (scale :C, :ahirbhairav)
    (scale :C, :enigmatic)
    (scale :C, :neapolitan_minor)
    (scale :C, :pelog)
    (scale :C, :augmented2)
    (scale :C, :scriabin)
    (scale :C, :harmonic_major)
    (scale :C, :melodic_minor_desc)
    (scale :C, :romanian_minor)
    (scale :C, :hindu)
    (scale :C, :iwato)
    (scale :C, :melodic_minor)
    (scale :C, :diminished2)
    (scale :C, :marva)
    (scale :C, :melodic_major)
    (scale :C, :indian)
    (scale :C, :spanish)
    (scale :C, :prometheus)
    (scale :C, :diminished)
    (scale :C, :todi)
    (scale :C, :leading_whole)
    (scale :C, :augmented)
    (scale :C, :purvi)
    (scale :C, :chinese)
    (scale :C, :lydian_minor)
| ``
    # Sonic Pi supports a large range of scales: