Sha256: 79fd38492d69dcd5a4e821194cbbc0ebb527a5fcdd9658b9281d4202955c3c4f

Contents?: true

Size: 564 Bytes

Versions: 7

Compression:

Stored size: 564 Bytes

Contents

class HeadMusic::Instrument::Staff
  DEFAULT_CLEF = "treble_clef"

  attr_reader :staff_scheme, :attributes

  def initialize(staff_scheme, attributes)
    @staff_scheme = staff_scheme
    @attributes = attributes || {}
  end

  def clef
    HeadMusic::Clef.get(smart_clef_key)
  end

  def smart_clef_key
    "#{attributes["clef"]}_clef".gsub(/_clef_clef$/, "_clef")
  end

  def sounding_transposition
    attributes["sounding_transposition"] || 0
  end

  def name_key
    attributes["name_key"] || ""
  end

  def name
    name_key.to_s.tr("_", " ")
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
head_music-7.0.5 lib/head_music/instrument/staff.rb
head_music-7.0.4 lib/head_music/instrument/staff.rb
head_music-7.0.3 lib/head_music/instrument/staff.rb
head_music-7.0.2 lib/head_music/instrument/staff.rb
head_music-7.0.1 lib/head_music/instrument/staff.rb
head_music-7.0.0 lib/head_music/instrument/staff.rb
head_music-6.0.1 lib/head_music/instrument/staff.rb