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) -> AccidentalParameters
lhsLeft hand side of the equation.
rhsRight 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) -> AccidentalParameters
lhsLeft hand side of the equation.
rhsRight 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) -> AccidentalParameters
lhsLeft hand side of the equation.
rhsRight 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) -> AccidentalParameters
lhsLeft hand side of the equation.
rhsRight 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) -> AccidentalParameters
lhsAccidental you want to multiply.
rhsMultiplier.
Return Value
Returns a multiplied acceident.
-
Divides an accidental with a multiplier
Declaration
Swift
public func / (lhs: Accidental, rhs: Int) -> AccidentalParameters
lhsAccidental you want to divide.
rhsMultiplier.
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) -> BoolParameters
lhsLeft hand side of the equation.
rhsRight 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) -> BoolParameters
lhsLeft hand side of the equation.
rhsRight 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
lhsLeft hand side of the equation.
rhsRight hand side of the equation.
Return Value
Intrevalbetween 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
NoteValueTypeis equivalent to a givenNoteValue.Declaration
Swift
public func / (noteValue: NoteValue, noteValueType: NoteValueType) -> DoubleParameters
noteValueThe note value to be measured.
noteValueTypeThe note value type to measure the length of the note value.
Return Value
Returns how many notes of a single
NoteValueTypeis equivalent to a givenNoteValue.
View on GitHub
Functions Reference