Class: HeadMusic::Notation::ABC::Parser::VoiceState

Inherits:
Object
  • Object
show all
Defined in:
lib/head_music/notation/abc/parser.rb

Overview

Per-voice interpretation state. Accidentals, the deferred note, and volta tracking are all independent between voices.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(voice, pitch_builder) ⇒ VoiceState

Returns a new instance of VoiceState.



56
57
58
59
# File 'lib/head_music/notation/abc/parser.rb', line 56

def initialize(voice, pitch_builder)
  @voice = voice
  @pitch_builder = pitch_builder
end

Instance Attribute Details

#active_passesObject

Returns the value of attribute active_passes.



52
53
54
# File 'lib/head_music/notation/abc/parser.rb', line 52

def active_passes
  @active_passes
end

#awaiting_scaleObject

Returns the value of attribute awaiting_scale.



52
53
54
# File 'lib/head_music/notation/abc/parser.rb', line 52

def awaiting_scale
  @awaiting_scale
end

#beam_break_pendingObject

Returns the value of attribute beam_break_pending.



52
53
54
# File 'lib/head_music/notation/abc/parser.rb', line 52

def beam_break_pending
  @beam_break_pending
end

#beam_last_was_noteObject

Returns the value of attribute beam_last_was_note.



52
53
54
# File 'lib/head_music/notation/abc/parser.rb', line 52

def beam_last_was_note
  @beam_last_was_note
end

#broken_lineObject

Returns the value of attribute broken_line.



52
53
54
# File 'lib/head_music/notation/abc/parser.rb', line 52

def broken_line
  @broken_line
end

#pending_noteObject

Returns the value of attribute pending_note.



52
53
54
# File 'lib/head_music/notation/abc/parser.rb', line 52

def pending_note
  @pending_note
end

#pitch_builderObject (readonly)

Returns the value of attribute pitch_builder.



51
52
53
# File 'lib/head_music/notation/abc/parser.rb', line 51

def pitch_builder
  @pitch_builder
end

#tie_lineObject

Returns the value of attribute tie_line.



52
53
54
# File 'lib/head_music/notation/abc/parser.rb', line 52

def tie_line
  @tie_line
end

#tie_openObject

Returns the value of attribute tie_open.



52
53
54
# File 'lib/head_music/notation/abc/parser.rb', line 52

def tie_open
  @tie_open
end

#voiceObject (readonly)

Returns the value of attribute voice.



51
52
53
# File 'lib/head_music/notation/abc/parser.rb', line 51

def voice
  @voice
end

#volta_start_barObject

Returns the value of attribute volta_start_bar.



52
53
54
# File 'lib/head_music/notation/abc/parser.rb', line 52

def volta_start_bar
  @volta_start_bar
end

Instance Method Details

#completed_bar_numberObject



61
62
63
# File 'lib/head_music/notation/abc/parser.rb', line 61

def completed_bar_number
  voice.last_placement&.position&.bar_number
end

#entered_bar_numberObject



65
66
67
# File 'lib/head_music/notation/abc/parser.rb', line 65

def entered_bar_number
  voice.next_position.bar_number
end