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

- old
+ new

@@ -2,11 +2,11 @@ include Comparable attr_reader :spelling attr_reader :octave - delegate :letter, to: :spelling + delegate :letter, :letter_cycle, to: :spelling delegate :accidental, :sharp?, :flat?, to: :spelling delegate :pitch_class, to: :spelling delegate :smallest_interval_to, to: :pitch_class @@ -84,9 +84,13 @@ to_s == value.to_s end def <=>(other) self.midi_note_number <=> other.midi_note_number + end + + def scale(scale_type_name = nil) + HeadMusic::Scale.get(self, scale_type_name) end private_class_method :new end