Sha256: 197421044fdef3d90050d5af7ca9b5d06a4b9069c988b9445dc4249f3a7593b5
Contents?: true
Size: 872 Bytes
Versions: 14
Compression:
Stored size: 872 Bytes
Contents
module Music module Transcription # Defines a relationship (tie, slur, legato, etc.) to a note with a certain pitch. # # @author James Tunnell # # @!attribute [rw] target_pitch # @return [Pitch] The pitch of the note which is being connected to. # class Link attr_accessor :target_pitch def initialize target_pitch @target_pitch = target_pitch end def ==(other) self.class == other.class && self.target_pitch == other.target_pitch end def clone self.class.new @target_pitch.clone end { :Slur => "=", :Legato => "-", :Glissando => "~", :Portamento => "/", }.each do |name,print_str| klass = Class.new(Link) do def initialize target_pitch super(target_pitch) end def to_s print_str + @target_pitch end end Link.const_set(name.to_sym, klass) end end end end
Version data entries
14 entries across 14 versions & 1 rubygems