struct Mystic::Coords
- Mystic::Coords
- Struct
- Value
- Object
Overview
Coordinate representation of pitches
Pitches are represented by a combination of octaves and fifths away from Middle C
For example, the C#4 is represented as (-4, 7), and Db4 is (3, -5).
The benefit of this approach over a semitone-based system is that it is easier to keep track of enharmonic notes, and it also makes interval math much simpler.
Defined in:
mystic/coords.crConstructors
Instance Method Summary
- #*(i : Int32) : Coords
- #+(other : self) : Coords
- #-(other : self) : Coords
- #==(other : self) : Bool
- #fifths : Int32
- #octaves : Int32
-
#to_s(io : IO) : Nil
Same as
#inspect(io)
. -
#value : Int32
Returns the pitch offset from Middle C and can be used to calculate the pitch name
Constructor Detail
Instance Method Detail
def value : Int32
#
Returns the pitch offset from Middle C and can be used to calculate the pitch name