Sha256: 6f419d38f552bca987ef753a57f075f6e64bc49d0594cb86a64471ccaebd4fed
Contents?: true
Size: 751 Bytes
Versions: 5
Compression:
Stored size: 751 Bytes
Contents
# Note is like a placement, except: # - always has a pitch # - doesn't require voice and position class HeadMusic::Note attr_accessor :pitch, :rhythmic_value, :voice, :position def initialize(pitch, rhythmic_value, voice = nil, position = nil) @pitch = HeadMusic::Pitch.get(pitch) @rhythmic_value = HeadMusic::RhythmicValue.get(rhythmic_value) @voice = voice || HeadMusic::Voice.new @position = position || HeadMusic::Position.new(@voice.composition, '1:1') end def placement @placement ||= HeadMusic::Placement.new(voice, position, rhythmic_value, pitch) end def to_s "#{pitch} at #{position}" end def method_missing(method_name, *args, &block) placement.send(method_name, *args, &block) end end
Version data entries
5 entries across 5 versions & 1 rubygems