AKTuningTable

@objc open class AKTuningTable: NSObject

Tuning table stores frequencies at which to play MIDI notes

  • For clarity, typealias Frequency as a Double

    Declaration

    Swift

    public typealias Frequency = Double
  • Total number of MIDI Notes available to play

    Declaration

    Swift

    public static let midiNoteCount = 128
  • Note number for standard reference note

    Declaration

    Swift

    public var middleCNoteNumber: MIDINoteNumber = 60
  • Undocumented

    Declaration

    Swift

    @objc open class AKTuningTable: NSObject
  • Octave number for standard reference note. Can be negative …, -2, -1, 0, 1, 2, …

    Declaration

    Swift

    public var middleCOctave: Int = 0
  • Initialization for standard default 12 tone equal temperament

    Declaration

    Swift

    public override init()
  • Pull out frequency information for a given note number

    Declaration

    Swift

    public func frequency(forNoteNumber noteNumber: MIDINoteNumber) -> Frequency
  • Set frequency of a given note number

    Declaration

    Swift

    public func setFrequency(_ frequency: Frequency, at noteNumber: MIDINoteNumber)
  • Create the tuning using the input frequencies

    Declaration

    Swift

    public func tuningTable(fromFrequencies inputFrequencies: [Frequency])

    Parameters

    fromFrequencies

    An array of frequencies

  • Creates a Nested 2-interval pattern, or Moment of Symmetry

    Declaration

    Swift

    public func momentOfSymmetry(generator gInput: Double = 7.0 / 12.0,
                                     level lInput: Int = 5,
                                     murchana mInput: Int = 0) -> Int

    Parameters

    generator

    A Double on [0, 1]

    level

    An Int on [0, 7]

    murchana

    The mode of the scale…degrees are normalized by the frequency at this index

    Return Value

    Number of notes per octave From Erv Wilson. See http://anaphoria.com/wilsonintroMOS.html

  • Use a Scala file to write the tuning table

    Declaration

    Swift

    public func scalaFile(_ filePath: String)
  • Get frequencies from a Scala string

    Declaration

    Swift

    open func frequencies(fromScalaString rawStr: String?) -> [Frequency]?