Class: Musa::MusicXML::Builder::Internal::Wedge Private

Inherits:
DirectionType
  • Object
show all
Includes:
Helper
Defined in:
lib/musa-dsl/musicxml/builder/direction.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Wedge hairpin direction type for crescendo/diminuendo.

Represents dynamic hairpins (crescendo <, diminuendo >). Supports niente (to/from nothing) hairpins.

Examples:

Crescendo

measure.direction { wedge 'crescendo' }

Diminuendo to nothing

measure.direction { wedge 'diminuendo', niente: true }

Stop wedge

measure.direction { wedge 'stop' }

Instance Method Summary collapse

Constructor Details

#initialize(type, niente: nil, &block) ⇒ Wedge

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

crescendo / diminuendo / stop / continue



284
285
286
287
288
289
290
291
# File 'lib/musa-dsl/musicxml/builder/direction.rb', line 284

def initialize(type, #  crescendo / diminuendo / stop / continue
               niente: nil, # true
               &block)
  @type = type
  @niente = niente

  super
end

Instance Method Details

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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



296
297
298
# File 'lib/musa-dsl/musicxml/builder/direction.rb', line 296

def _direction_type_to_xml(io, indent:, tabs:)
  io.puts "#{tabs}<wedge type=\"#{@type}\"#{ decode_bool_or_string_attribute(@niente, 'niente', 'yes') }/>"
end