Class: Musa::Scales::ChromaticScaleKind

Inherits:
ScaleKind show all
Defined in:
lib/musa-dsl/music/equally-tempered-12-tone-scale-system.rb

Overview

Chromatic scale kind (all 12 semitones).

ChromaticScaleKind defines the chromatic scale containing all 12 semitones of the octave. It's used as a fallback for chromatic (non-diatonic) notes and for atonal or twelve-tone compositions.

Pitch Structure

Contains 12 pitch classes, one for each semitone:

  • Degrees: _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12
  • Pitches: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 (semitones from root)

Special Properties

  • chromatic?: Returns true (only scale kind with this property)
  • Used automatically when accessing non-diatonic notes in diatonic scales

Usage

chromatic = Scales[:et12][440.0][:chromatic][60]
chromatic._1   # C
chromatic._2   # C#/Db
chromatic._3   # D
# ... all 12 semitones

Constant Summary collapse

@@pitches =
[{ functions: [:_1], pitch: 0 },
{ functions: [:_2], pitch: 1 },
{ functions: [:_3], pitch: 2 },
{ functions: [:_4], pitch: 3 },
{ functions: [:_5], pitch: 4 },
{ functions: [:_6], pitch: 5 },
{ functions: [:_7], pitch: 6 },
{ functions: [:_8], pitch: 7 },
{ functions: [:_9], pitch: 8 },
{ functions: [:_10], pitch: 9 },
{ functions: [:_11], pitch: 10 },
{ functions: [:_12], pitch: 11 }].freeze

Class Method Summary collapse

Constructor Details

This class inherits a constructor from Musa::Scales::ScaleKind

Class Method Details

.chromatic?Boolean

Indicates if this is a chromatic scale.

Returns:

  • (Boolean)

    true



193
194
195
# File 'lib/musa-dsl/music/equally-tempered-12-tone-scale-system.rb', line 193

def chromatic?
  true
end

.idSymbol

Scale kind identifier.

Returns:

  • (Symbol)

    :chromatic



187
188
189
# File 'lib/musa-dsl/music/equally-tempered-12-tone-scale-system.rb', line 187

def id
  :chromatic
end

.pitchesArray<Hash>

Pitch structure.

Returns:

  • (Array<Hash>)

    pitch definitions with functions and offsets



181
182
183
# File 'lib/musa-dsl/music/equally-tempered-12-tone-scale-system.rb', line 181

def pitches
  @@pitches
end