Class: Musa::MusicXML::Builder::Internal::Harmonic

Inherits:
Object
  • Object
show all
Includes:
Musa::MusicXML::Builder::Internal::Helper::ToXML
Defined in:
lib/musa-dsl/musicxml/builder/note-complexities.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Musa::MusicXML::Builder::Internal::Helper::ToXML

#to_xml

Constructor Details

#initialize(kind: nil, pitch: nil) ⇒ Harmonic

natural / artificial



112
113
114
115
116
117
# File 'lib/musa-dsl/musicxml/builder/note-complexities.rb', line 112

def initialize(kind: nil, # natural / artificial
               pitch: nil) # base-pitch / sounding-pitch / touching-pitch

  @kind = kind
  @pitch = pitch
end

Instance Attribute Details

#kindObject

Returns the value of attribute kind.



119
120
121
# File 'lib/musa-dsl/musicxml/builder/note-complexities.rb', line 119

def kind
  @kind
end

#pitchObject

Returns the value of attribute pitch.



119
120
121
# File 'lib/musa-dsl/musicxml/builder/note-complexities.rb', line 119

def pitch
  @pitch
end

Instance Method Details

#_to_xml(io, indent:, tabs:) ⇒ Object



121
122
123
124
125
126
# File 'lib/musa-dsl/musicxml/builder/note-complexities.rb', line 121

def _to_xml(io, indent:, tabs:)
  io.puts "#{tabs}<harmonic>"
  io.puts "#{tabs}\t<#{@kind} />" if @kind
  io.puts "#{tabs}\t<#{@pitch} />" if @pitch
  io.puts "#{tabs}</harmonic>"
end