Scale

public struct Scale: Equatable, Codable

Scale object with ScaleType and scale’s key of NoteType. Could calculate note sequences in [Note] format.

  • Type of the scale that has interval info.

    Declaration

    Swift

    public var type: ScaleType
  • key

    Root key of the scale that will built onto.

    Declaration

    Swift

    public var key: Key
  • Initilizes the scale with its type and key.

    Declaration

    Swift

    public init(type: ScaleType, key: Key)

    Parameters

    type

    Type of scale being initilized.

    key

    Key of scale being initilized.

  • Keys generated by the intervals of the scale.

    Declaration

    Swift

    public var keys: [Key]
  • Generates Pitch array of scale in given octave.

    Declaration

    Swift

    public func pitches(octave: Int) -> [Pitch]

    Parameters

    octave

    Octave value of notes in scale.

    Return Value

    Returns Pitch array of the scale in given octave.

  • Generates Pitch array of scale in given octaves.

    Declaration

    Swift

    public func pitches(octaves: Int...) -> [Pitch]

    Parameters

    octaves

    Variadic value of octaves to generate pitches in scale.

    Return Value

    Returns Pitch array of the scale in given octaves.

  • Generates Pitch array of scale in given octaves.

    Declaration

    Swift

    public func pitches(octaves: [Int]) -> [Pitch]

    Parameters

    octaves

    Array value of octaves to generate pitches in scale.

    Return Value

    Returns Pitch array of the scale in given octaves.

  • Stack of notes to generate chords for each note in the scale.

    See more

    Declaration

    Swift

    public enum HarmonicField: Int, Codable
  • Generates chords for harmonic field of scale.

    Declaration

    Swift

    public func harmonicField(for field: HarmonicField, inversion: Int = 0) -> [Chord?]

    Parameters

    field

    Type of chords you want to generate.

    inversion

    Inversion degree of the chords. Defaults 0.

    Return Value

    Returns triads or tetrads of chord for each note in scale.

  • Converts Scale to string with its key and type.

    Declaration

    Swift

    public var description: String