lib/head_music/pitch.rb in head_music-0.3.1 vs lib/head_music/pitch.rb in head_music-0.4.0

- old
+ new

@@ -27,11 +27,11 @@ end def self.from_number_and_letter(number, letter) letter = HeadMusic::Letter.get(letter) natural_letter_pitch = get(HeadMusic::Letter.get(letter).pitch_class) - natural_letter_pitch += 12 while (number - natural_letter_pitch.to_i) >= 12 + natural_letter_pitch += 12 while (number - natural_letter_pitch.to_i) >= 11 natural_letter_pitch = get(natural_letter_pitch) accidental_interval = natural_letter_pitch.smallest_interval_to(HeadMusic::PitchClass.get(number)) accidental = HeadMusic::Accidental.for_interval(accidental_interval) spelling = HeadMusic::Spelling.fetch_or_create(letter, accidental) fetch_or_create(spelling, natural_letter_pitch.octave) @@ -57,9 +57,10 @@ def midi_note_number (octave + 1) * 12 + pitch_class.to_i end alias_method :midi, :midi_note_number + alias_method :number, :midi_note_number def to_s name end