Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
The hardware-independent part of the MIDI binding.
Synopsis
- 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
- data MidiException = MidiException String
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) |
Instances
Eq MidiMessage' Source # | |
Defined in System.MIDI.Base (==) :: MidiMessage' -> MidiMessage' -> Bool # (/=) :: MidiMessage' -> MidiMessage' -> Bool # | |
Show MidiMessage' Source # | |
Defined in System.MIDI.Base showsPrec :: Int -> MidiMessage' -> ShowS # show :: MidiMessage' -> String # showList :: [MidiMessage'] -> ShowS # |
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 |
Instances
Eq MidiMessage Source # | |
Defined in System.MIDI.Base (==) :: MidiMessage -> MidiMessage -> Bool # (/=) :: MidiMessage -> MidiMessage -> Bool # | |
Show MidiMessage Source # | |
Defined in System.MIDI.Base showsPrec :: Int -> MidiMessage -> ShowS # show :: MidiMessage -> String # showList :: [MidiMessage] -> ShowS # |
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.
data ShortMessage Source #
Low level stuff.
Instances
Show ShortMessage Source # | |
Defined in System.MIDI.Base showsPrec :: Int -> ShortMessage -> ShowS # show :: ShortMessage -> String # showList :: [ShortMessage] -> ShowS # |
shortMessage :: Int -> Int -> Int -> Int -> ShortMessage Source #
data MidiException Source #
Instances
Show MidiException Source # | |
Defined in System.MIDI.Base showsPrec :: Int -> MidiException -> ShowS # show :: MidiException -> String # showList :: [MidiException] -> ShowS # | |
Exception MidiException Source # | |
Defined in System.MIDI.Base |