Sha256: 43e1901379738d56fa2b77cd9ac7bd33216db6ad45b6f513f6dcd5e07bb6b637

Contents?: true

Size: 653 Bytes

Versions: 2

Compression:

Stored size: 653 Bytes

Contents

module Music
module Transcription
module Parsing

grammar Note
  include Pitch
  include Articulation
  include Link
  include Duration

  rule note
    polyphonic_note / monophonic_note / rest_note
  end

  rule rest_note
    duration:duration <RestNoteNode>
  end
  
  rule monophonic_note
    duration
    art:articulation?
    pl:pitch_link
    acc:accent?
    <MonophonicNoteNode>
  end
  
  rule polyphonic_note
    duration
    art:articulation?
    pl:pitch_link
    more_pitches:("," pl:pitch_link)+
    acc:accent?
    <PolyphonicNoteNode>
  end

  rule pitch_link
    pitch the_link:link?
  end
  
  rule accent
    "!"
  end
end

end
end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
music-transcription-0.11.0 lib/music-transcription/parsing/note_parsing.treetop
music-transcription-0.10.0 lib/music-transcription/parsing/note_parsing.treetop