Safe Haskell | Safe |
---|---|
Language | Haskell98 |
The hardware-independent part of the MIDI binding.
- type TimeStamp = Word32
- data MidiMessage'
- = NoteOff !Int !Int
- | NoteOn !Int !Int
- | PolyAftertouch !Int !Int
- | CC !Int !Int
- | ProgramChange !Int
- | Aftertouch !Int
- | PitchWheel !Int
- data MidiMessage
- = MidiMessage !Int !MidiMessage'
- | SysEx [Word8]
- | SongPosition !Int
- | SongSelect !Int
- | TuneRequest
- | SRTClock
- | SRTStart
- | SRTContinue
- | SRTStop
- | ActiveSensing
- | Reset
- | Undefined
- data MidiEvent = MidiEvent !TimeStamp !MidiMessage
- type ClientCallback = MidiEvent -> IO ()
- data ShortMessage = ShortMessage {}
- translateShortMessage :: ShortMessage -> MidiMessage
- untranslateShortMessage :: MidiMessage -> ShortMessage
- shortMessage :: Int -> Int -> Int -> Int -> ShortMessage
Documentation
data MidiMessage' Source
A "regular" MIDI message.
Remark: According to the
MIDI standard, NoteOff also has a velocity. However, most keyboards do not use this feature (send the default
value 64), and there are keyboards which do not send NoteOff messages at all, but send NoteOn messages with
zero velocity instead (for example the EMU Xboard series).
At the moment, the code auto-translates NoteOn messages with zero velocity to NoteOff messages with velocity 64.
This behaviour can be inverted with the Cabal flag noNoteOff
, which translates all NoteOff messages to
NoteOn messages with velocity 0.
NoteOff !Int !Int | Note Off (key, velocity) |
NoteOn !Int !Int | Note On (key, velocity) |
PolyAftertouch !Int !Int | Polyphonic key pressure (key, pressure) |
CC !Int !Int | Control Change (controller, value) |
ProgramChange !Int | Program Change (program) |
Aftertouch !Int | Global aftertouch (pressure) |
PitchWheel !Int | Pitch wheel (value, from -8192..+8191) |
data MidiMessage Source
The type representing a MIDI message.
MidiMessage !Int !MidiMessage' | first argument is the MIDI channel (1..16) |
SysEx [Word8] | not including the bytes 0xf0, 0xf7 |
SongPosition !Int | measured in "MIDI beats" (1/16th notes). |
SongSelect !Int | |
TuneRequest | |
SRTClock | clock is sent 24 times per quarter note |
SRTStart | |
SRTContinue | |
SRTStop | |
ActiveSensing | |
Reset | |
Undefined |
The type representing a timestamped MIDI message.
Time is measured in milisecs elapsed since the last call to start
.
type ClientCallback = MidiEvent -> IO () Source
Type of the user callback function.
shortMessage :: Int -> Int -> Int -> Int -> ShortMessage Source