Sha256: 78cb89dacdc51c8931b9450d47c14995b0f17117bee87d3875cafa6cd5f22309

Contents?: true

Size: 568 Bytes

Versions: 13

Compression:

Stored size: 568 Bytes

Contents

module Music
module Transcription

# Defines a dynamic level
#
# @author James Tunnell
#
class Dynamic
  def ==(other)
    self.class == other.class
  end
  
  def clone
    self.class.new
  end
  
  { :Piano => "p",
    :Pianissimo => "pp",
    :Pianississimo => "ppp",
    :MezzoPiano => "mp",
    :MezzoForte => "mf",
    :Forte => "f",
    :Fortissimo => "ff",
    :Fortississimo => "fff"
  }.each do |name,print_str|
    klass = Class.new(Dynamic) do
      def to_s
        print_str
      end
    end
    Dynamic.const_set(name.to_sym, klass)
  end
end

end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
music-transcription-0.6.3 lib/music-transcription/dynamic.rb
music-transcription-0.6.2 lib/music-transcription/dynamic.rb
music-transcription-0.6.1 lib/music-transcription/dynamic.rb
music-transcription-0.6.0 lib/music-transcription/dynamic.rb
music-transcription-0.5.11 lib/music-transcription/dynamic.rb
music-transcription-0.5.10 lib/music-transcription/dynamic.rb
music-transcription-0.5.9 lib/music-transcription/dynamic.rb
music-transcription-0.5.8 lib/music-transcription/dynamic.rb
music-transcription-0.5.7 lib/music-transcription/dynamic.rb
music-transcription-0.5.6 lib/music-transcription/dynamic.rb
music-transcription-0.5.5 lib/music-transcription/dynamic.rb
music-transcription-0.5.3 lib/music-transcription/dynamic.rb
music-transcription-0.5.2 lib/music-transcription/dynamic.rb