termtab-0.1.0.0: TUI guitar tablature and score editor
Safe HaskellNone
LanguageGHC2021

Termtab.Parser.MIDI

Description

Load a Song from a Standard MIDI File via the HCodecs library.

This is a lossy, rhythm-free conversion: it exists to get MIDI note data onto the fretless (non-tab) side of the model quickly, not to preserve a MIDI file's original structure. Every NoteOn event becomes its own Quarter-duration Beat (so original note timing/duration is discarded), and every converted Track is placed entirely under MeasureIndex 0 (so songMeasures is left empty — there is no bar structure to derive one from).

Synopsis

Documentation

parseMidi :: FilePath -> IO (Either ParseError Song) Source #

Read and parse a Standard MIDI File, converting a decode failure into ParseErrorMalformed and a successful decode into a Song via convertMidi.