struct

Mystic::Coords

Inherits Struct < Value < Object

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.

Constructors

new(octaves : Int32, fifths : Int32)
Source

Instance methods

*(i : Int32) : Coords
Source
+(other : self) : Coords
Source
-(other : self) : Coords
Source
==(other : self) : Bool
Source
fifths
Source
octaves
Source
to_s(io : IO) : Nil

Same as #inspect(io).

Source
value

Returns the pitch offset from Middle C and can be used to calculate the pitch name

Source