midi-simple-0.1.0.0: A simple and fast library for working with MIDI messages

Safe HaskellSafe
LanguageHaskell2010

Sound.MIDI

Contents

Synopsis

Encoding

encodeMidi :: Foldable t => t MidiMessage -> ByteString Source #

Encode some collection of MidiMessages to a lazy ByteString

encodeMidi1 :: MidiMessage -> ByteString Source #

Encode a single message to a lazy ByteString

Decoding

decodeMidi :: ByteString -> Either String [MidiMessage] Source #

Decode raw MIDI data from a strict ByteString. Any incomplete data at the beginning will be skipped! This function assumes a normalized MIDI stream, i.e. one in which events are not interrupted by real-time events!

decodeMidi1 :: ByteString -> Either String MidiMessage Source #

Decode one event from raw MIDI data in a strict ByteString. Any incomplete data at the beginning will be skipped!

partitionRealtime :: ByteString -> (ByteString, ByteString) Source #

Partition an event stream into real-time events and other messages. The first parameter returned will be the real-time events, the second element will be the rest of the stream. Note that this effectively normalizes the second element.

Parser and Serializer

Top level parsing and serializing tools are exposed here. For fine-grained access, see Sound.MIDI.Parser and Sound.MIDI.Serialize.

Re-exports