Sha256: 9d39302dbd270ef6b4c375d4b0fab9b0d550aaaba6407951ec3d040bed3a7596

Contents?: true

Size: 753 Bytes

Versions: 1

Compression:

Stored size: 753 Bytes

Contents

module Music
module Transcription

# Contains a Score object, and also instrument configurations to be assigned to
# score parts.
class Arrangement
  include Hashmake::HashMakeable
  
  # specifies which hashed args can be used for initialize.
  ARG_SPECS = {
    :score => arg_spec(:reqd => true, :type => Score),
    :instrument_configs => arg_spec_hash(:reqd => false, :type => InstrumentConfig),
  }

  attr_reader :score, :instrument_configs
  
  def initialize args
    hash_make args, Arrangement::ARG_SPECS
  end
  
  # Assign a new score.
  # @param [Score] score The new score.
  # @raise [ArgumentError] if score is not a Score.
  def score= score
    Arrangement::ARG_SPECS[:score].validate_value score
    @score = score
  end
end

end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
music-transcription-0.3.0 lib/music-transcription/arrangement.rb