Class: Stretto::MusicElements::VoiceChange

Inherits:
MusicElement show all
Defined in:
lib/stretto/music_elements/voice_change.rb

Constant Summary collapse

MAX_VOICES =
15

Instance Attribute Summary collapse

Attributes inherited from MusicElement

#original_string, #pattern

Attributes included from Node

#next, #prev

Instance Method Summary collapse

Methods inherited from MusicElement

#build_music_string, #duration, #end_of_tie?, #start_of_tie?, #to_s

Constructor Details

#initialize(string_or_options, pattern = nil) ⇒ VoiceChange

Returns a new instance of VoiceChange.



12
13
14
15
16
17
18
19
# File 'lib/stretto/music_elements/voice_change.rb', line 12

def initialize(string_or_options, pattern = nil)
  token = case string_or_options
    when String then Stretto::Parser.parse_voice_change!(string_or_options)
    else string_or_options
  end
  super(token[:text_value], pattern)
  @original_value = token[:value]
end

Instance Attribute Details

#indexObject

Returns the value of attribute index.



10
11
12
# File 'lib/stretto/music_elements/voice_change.rb', line 10

def index
  @index
end

Instance Method Details

#substitute_variables!Object



32
33
34
# File 'lib/stretto/music_elements/voice_change.rb', line 32

def substitute_variables!
  self.index = index
end