Method: Fet::Note#degree
- Defined in:
- lib/fet/note.rb
#degree(root_name) ⇒ Object
89 90 91 92 93 94 95 96 97 98 |
# File 'lib/fet/note.rb', line 89 def degree(root_name) notes_array = Fet::MusicTheory.notes_of_mode(root_name, "major") index = notes_array.index { |note| Note.new(note).natural_note == natural_note } degree = index + 1 degree_note = Note.new(notes_array[index]) accidental_difference = accidental_to_semitone_offset - degree_note.accidental_to_semitone_offset return "#{self.class.accidental_from_semitone_offset(accidental_difference)}#{degree}" end |