wxMidi constants and macros
Macros and miscellaneous constants
wxMidi filter codes
wxMidiError codes
Macros and miscellaneous constants
wxMIDI_VERSION
Constant. wxString with wxMidi version such as "1.0".
wxEVT_MIDI_INPUT
ID for a command event that is triggered when a new MIDI message is available to be read. This event is only triggered if the user application has called method
wxMidiInDevice::StartListening.
wxMIDI_CHANNEL
Macro to be used in method
wxMidiInDevice::SetChannelMask.
This method requires a mask value that is a 16-bit bitfield with bits set to signal the appropriate channels.
Macro wxMIDI_CHANNEL can assist in preparing this mask. For example, to set for receiving input only from
channel 1, prepare the mask with wxMIDI_CHANNEL(1).
Multiple channels should be OR'd together, like
wxMIDI_CHANNEL(10) | wxMIDI_CHANNEL(11).
wxMidi filter codes
wxMIDI_NO_FILTER
No filter. All MIDI messages will be delivered to user application.
wxMIDI_FILT_ACTIVE
Filter active sensing messages (0xFE).
wxMIDI_FILT_SYSEX
Filter system exclusive messages (0xF0).
wxMIDI_FILT_CLOCK
Filter real-time clock messages (0xF8 only, does not filter clock start, etc.).
wxMIDI_FILT_PLAY
Filter play messages (start 0xFA, stop 0xFC, continue 0xFB).
wxMIDI_FILT_F9 and wxMIDI_FILT_TICK
Both are the same code. Filter undefined 0xF9 messages (some equipment uses this as a 10ms 'tick').
wxMIDI_FILT_FD
Filter undefined 0xFD messages
wxMIDI_FILT_UNDEFINED
Filter undefined real-time messages = (wxMIDI_FILT_F9 | wxMIDI_FILT_FD).
wxMIDI_FILT_RESET
Filter reset messages (0xFF).
wxMIDI_FILT_REALTIME
Filter all real-time messages =(wxMIDI_FILT_ACTIVE | wxMIDI_FILT_SYSEX | wxMIDI_FILT_CLOCK | wxMIDI_FILT_PLAY | wxMIDI_FILT_UNDEFINED | wxMIDI_FILT_RESET).
wxMIDI_FILT_NOTE
Filter note-on and note-off messages (0x90-0x9F and 0x80-0x8F).
wxMIDI_FILT_CHANNEL_AFTERTOUCH
Filter channel aftertouch (most MIDI controllers use this) (0xD0-0xDF).
wxMIDI_FILT_POLY_AFTERTOUCH
Filter per-note aftertouch messages (Ensoniq holds a patent on generating this on keyboards until June 2006) (0xA0-0xAF).
wxMIDI_FILT_AFTERTOUCH
Filter both channel and poly aftertouch =
(wxMIDI_FILT_CHANNEL_AFTERTOUCH | wxMIDI_FILT_POLY_AFTERTOUCH)
wxMIDI_FILT_PROGRAM
Filter Program change messages (0xC0-0xCF).
wxMIDI_FILT_CONTROL
Filter Control Change messages (0xB0-0xBF).
wxMIDI_FILT_PITCHBEND
Filetr Pitch Bender messages (0xE0-0xEF).
wxMIDI_FILT_MTC
Filter MIDI Time Code messages (0xF1).
wxMIDI_FILT_SONG_POSITION
Filetr Song Position messages (0xF2).
wxMIDI_FILT_SONG_SELECT
Filter Song Select messages (0xF3).
wxMIDI_FILT_TUNE
Filter Tuning request messages (0xF6).
wxMIDI_FILT_SYSTEMCOMMON
Filter all System Common messages (MTC, song position, song select, tune request)
=(wxMIDI_FILT_MTC | wxMIDI_FILT_SONG_POSITION | wxMIDI_FILT_SONG_SELECT | wxMIDI_FILT_TUNE).
wxMidiError codes
wxMIDI_NO_ERROR
No error. The requested operation succedeed.
wxMIDI_ERROR_HostError
wxMIDI_ERROR_InvalidDeviceId
Invalid device ID. The ID is out of range (less than zero or greater or equal than the value returned by wxMidiSystem::CountDevices. Or it is an input device and it is being used to construct a wxMidiOutDevice, or viceversa.
wxMIDI_ERROR_InsufficientMemory
wxMIDI_ERROR_BufferTooSmall
PortMidi reports a 'Buffer too small' error. This should not happen as wxMidi takes care
of all buffer allocation.
wxMIDI_ERROR_BadPtr
PortMidi reports a `Bad pointer error'. This should not happen as wxMidi deals with PmDevices
inside objects wxMidiDevice, and so, user has no need to deal with pointers to PmDevices.
wxMIDI_ERROR_InternalError
Portmidi reported an 'Internal Error'. Sorry, no more information.
wxMIDI_ERROR_BufferOverflow
PortMidi reported a 'Buffer overflow'. I'm not sure about the meaning of this error. Does it refer to internal
portmidi buffers? Is it for buffers allocated by user? In this last case I think that this error should not happen as
wxMidi takes care
of all buffer allocation.
wxMIDI_ERROR_BadData
PortMidi reported an 'Invalid MIDI message Data' such as illegal MIDI data or a missing EOX.
wxMIDI_ERROR_BufferMaxSize
Portmidi informs that 'buffer is already as large as it can be'. I do not know in which context is this
error reported and what is its meaning.
wxMIDI_ERROR_AlreadyListening
wxMIDI_ERROR_CreateThread
wxMIDI_ERROR_StartThread
An error ocurred during a call to
wxMidiInDevice::StartListening.
The error ocurred after successful creation of the wxThread object, while starting the thread execution.
wxMIDI_ERROR_BadSysExMsg_Start
The wxByte string received as parameter to create a wxMidiSysExMessage object does not start with 0xF0
(start-of-sysex status byte).
wxMIDI_ERROR_BadSysExMsg_Length
The wxByte string received as parameter to create a wxMidiSysExMessage object is greater than 10000 or
the end-of-sysex staus byte (0xF7) is not found.
wxMIDI_ERROR_NoDataAvailable
You called method
wxMidiInDevice::Read but there is no message waiting
to be delivered. You have to call Read method only after an wxEVT_MIDI_INPUT event takes place or after the
method
wxMidiInDevice::Poll reports that there is a message waiting.