Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- encodeMidi :: Foldable t => t MidiMessage -> ByteString
- encodeMidi' :: Foldable t => t MidiMessage -> ByteString
- encodeMidi1 :: MidiMessage -> ByteString
- encodeMidi1' :: MidiMessage -> ByteString
- decodeMidi :: ByteString -> Either String [MidiMessage]
- decodeMidi1 :: ByteString -> Either String MidiMessage
- partitionRealtime :: ByteString -> (ByteString, ByteString)
- midiParser :: Parser MidiMessage
- midiSerializer :: MidiMessage -> Builder
- module Sound.MIDI.Types
Encoding
encodeMidi :: Foldable t => t MidiMessage -> ByteString Source #
Encode some collection of MidiMessage
s to a lazy ByteString
encodeMidi' :: Foldable t => t MidiMessage -> ByteString Source #
Strict version of encodeMidi
encodeMidi1 :: MidiMessage -> ByteString Source #
Encode a single message to a lazy ByteString
encodeMidi1' :: MidiMessage -> ByteString Source #
Strict version of encodeMidi1
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.
midiSerializer :: MidiMessage -> Builder Source #
Re-exports
module Sound.MIDI.Types