Functions
The following functions are available globally.
-
Returns a new accidental by adding up two accidentals in the equation.
Declaration
Swift
public func + (lhs: Accidental, rhs: Accidental) -> Accidental
Parameters
lhs
Left hand side of the equation.
rhs
Right hand side of the equation.
Return Value
Returns the sum of two accidentals.
-
Returns a new accidental by substracting two accidentals in the equation.
Declaration
Swift
public func - (lhs: Accidental, rhs: Accidental) -> Accidental
Parameters
lhs
Left hand side of the equation.
rhs
Right hand side of the equation.
Return Value
Returns the difference of two accidentals.
-
Returns a new accidental by adding up an int to the accidental in the equation.
Declaration
Swift
public func + (lhs: Accidental, rhs: Int) -> Accidental
Parameters
lhs
Left hand side of the equation.
rhs
Right hand side of the equation.
Return Value
Returns the sum of two accidentals.
-
Returns a new accidental by substracting an int from the accidental in the equation.
Declaration
Swift
public func - (lhs: Accidental, rhs: Int) -> Accidental
Parameters
lhs
Left hand side of the equation.
rhs
Right hand side of the equation.
Return Value
Returns the difference of two accidentals.
-
Multiples an accidental with a multiplier.
Declaration
Swift
public func * (lhs: Accidental, rhs: Int) -> Accidental
Parameters
lhs
Accidental you want to multiply.
rhs
Multiplier.
Return Value
Returns a multiplied acceident.
-
Divides an accidental with a multiplier
Declaration
Swift
public func / (lhs: Accidental, rhs: Int) -> Accidental
Parameters
lhs
Accidental you want to divide.
rhs
Multiplier.
Return Value
Returns a divided accidental.
-
Checks if the two accidental is identical in terms of their halfstep values.
Declaration
Swift
public func == (lhs: Accidental, rhs: Accidental) -> Bool
Parameters
lhs
Left hand side of the equation.
rhs
Right hand side of the equation.
Return Value
Returns true if two accidentalals is identical.
-
Checks if the two accidental is exactly identical.
Declaration
Swift
public func === (lhs: Accidental, rhs: Accidental) -> Bool
Parameters
lhs
Left hand side of the equation.
rhs
Right hand side of the equation.
Return Value
Returns true if two accidentalals is identical.
-
Calculates the interval between two pitches. Doesn’t matter left hand side and right hand side note places.
Parameters
lhs
Left hand side of the equation.
rhs
Right hand side of the equation.
Return Value
Intreval
between two pitches. You can get the halfsteps from interval as well. -
Compares the equality of two pitches by their MIDI note value. Alternative notes passes this equality. Use
===
function if you want to check exact equality in terms of exact keys.Return Value
Returns the bool value of comparisation of two pitches.
-
Compares the exact equality of two pitches by their keys and octaves. Alternative notes not passes this equality. Use
==
function if you want to check equality in terms of MIDI note value.Return Value
Returns the bool value of comparisation of two pitches.
-
Calculates how many notes of a single
NoteValueType
is equivalent to a givenNoteValue
.Declaration
Swift
public func / (noteValue: NoteValue, noteValueType: NoteValueType) -> Double
Parameters
noteValue
The note value to be measured.
noteValueType
The note value type to measure the length of the note value.
Return Value
Returns how many notes of a single
NoteValueType
is equivalent to a givenNoteValue
.