class Medley::Note

Defined in:

medley/note.cr

Constant Summary

ALIASES = {"A##": "B", "B##": "C#", "C##": "D", "D##": "E", "E##": "F#", "F##": "G", "G##": "A", Abb: "G", Bbb: "A", Cbb: "Bb", Dbb: "C", Ebb: "D", Fbb: "Eb", Gbb: "F", "A#": "Bb", "B#": "C", "C#": "Db", "D#": "Eb", "E#": "F", "F#": "G", "G#": "Ab"}
NOTE_NAMES = ["A", "B", "C", "D", "E", "F", "G"] of ::String

Constructors

Instance Method Summary

Constructor Detail

def self.new(current_note : String) #

[View source]

Instance Method Detail

def double_flat? #

true if it's a valid note letter with bb


[View source]
def double_sharp? #

true if it's a valid note letter with ##


[View source]
def flat? #

true if it's a valid note letter with b


[View source]
def halfstep_down #

[View source]
def halfstep_up #

Returns the same note, but up a halfstep in most cases Without context of the Key, there's no telling if the note E should be E# or F. Since there's no triple sharps, this is the only case we just go to the next note.


[View source]
def name : String #

Returns the current note name


[View source]
def natural? #

true if it's a valid note letter with no modifiers


[View source]
def next_root #

[View source]
def root #

Returns the root of the note


[View source]
def root_matches?(other_note : Note) #

true if the root name is equal to the other note root


[View source]
def sharp? #

true if it's a valid note letter with #


[View source]
def wholestep_up #

[View source]