Copyright | (c) Stephen Tetley 2010-2013 |
---|---|
License | BSD3 |
Maintainer | Stephen Tetley <stephen.tetley@gmail.com> |
Stability | unstable |
Portability | As per dependencies. |
Safe Haskell | None |
Language | Haskell98 |
A top down (Parsec style) MIDI file parser.
For valid input, the parser should parse without error (i.e all cases of event types are fully enumerated). Malformed input (syntactically bad events, or truncated data) will cause fatal parse errors.
Note - the parser returns a literal result if the input
uses Running Status, i.e, - the answer matches the input -
where running status uses a NoteOn event with velocity 0 to
stand for a NoteOff, the parser likewise returns a Note-On.
Use the ZMidi.Core.Canonical
to translate the input to
canonical form where note-offs are encoded directly with
NoteOff.
Read a MIDI file
Auxiallary types
ParseErr is the position of the error and a message.
Position of the parser in the input stream.
This is exposed by the ReadFile API and may be useful for disassembling a MIDI file that causes a parse failure.