zmidi-core-0.5.0: Read and write MIDI files.

PortabilityAs per dependencies.
Stabilityunstable
MaintainerStephen Tetley <stephen.tetley@gmail.com>
Safe HaskellNone

ZMidi.Core.ReadFile

Contents

Description

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.

Synopsis

Read a MIDI file

readMidi :: FilePath -> IO (Either ParseErr MidiFile)Source

Read a well formed MIDI file.

Auxiallary types

data ParseErr Source

ParseErr is the position of the error and a message.

Constructors

ParseErr !Pos !ErrMsg 

Instances

type Pos = IntSource

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.

type ErrMsg = StringSource

Error message - alias for String.