Module: Stretto::Tokens::WithNoteStringToken

Included in:
ChordToken, NoteToken
Defined in:
lib/stretto/grammar/tokens/note_string_token.rb

Overview

Include this module to include note string functionality, that is, to provide key, accidental, octave and/or pitch

Instance Method Summary collapse

Instance Method Details

#accidentalString?

Returns:

  • (String, nil)

    The accidental of the note, if present (one of ‘bb’, ‘b’, ‘n’, ‘#’, ‘##’)

  • nil



88
89
90
# File 'lib/stretto/grammar/tokens/note_string_token.rb', line 88

def accidental
  note_string.accidental
end

#keyString

Returns:

  • (String)

    The key of the note (‘A’ through ‘G’)

  • nil



94
95
96
# File 'lib/stretto/grammar/tokens/note_string_token.rb', line 94

def key
  note_string.key
end

#octaveString?

Returns:

  • (String, nil)

    The octave of the note, if present

  • nil



82
83
84
# File 'lib/stretto/grammar/tokens/note_string_token.rb', line 82

def octave
  note_string.octave
end

#pitchnil, Value

Returns:

  • (nil)
  • (Value)

    The wrapped value for the pitch



100
101
102
# File 'lib/stretto/grammar/tokens/note_string_token.rb', line 100

def pitch
  note_string.pitch
end