Class: Musa::MusicXML::Builder::Internal::OctaveShift 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.

Octave shift direction type for 8va/8vb markings.

Represents octave transposition markings (8va, 8vb, 15ma, 15mb). Type indicates up/down/stop/continue, size indicates octaves (8 or 15).

Examples:

Start 8va

measure.direction { octave_shift 'up', size: 8 }

Start 8vb

measure.direction { octave_shift 'down', size: 8 }

Stop octave shift

measure.direction { octave_shift 'stop' }

Instance Method Summary collapse

Constructor Details

#initialize(type, size: nil, &block) ⇒ OctaveShift

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.

up / down / stop / continue



468
469
470
471
472
473
474
475
476
# File 'lib/musa-dsl/musicxml/builder/direction.rb', line 468

def initialize(type, # up / down / stop / continue
               size: nil, # number
               &block)

  @type = type
  @size = size

  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.



481
482
483
# File 'lib/musa-dsl/musicxml/builder/direction.rb', line 481

def _direction_type_to_xml(io, indent:, tabs:)
  io.puts "#{tabs}<octave-shift type=\"#{@type}\"#{ decode_bool_or_string_attribute(@size&.to_i, 'size') }/>"
end