AMX AXB-MIDI instruction manual Midi Programming, Programming examples

Page 13

Programming

MIDI Programming

Most MIDI command strings consist of a status byte followed by one or two data bytes. The most notable exception to this is the System Exclusive which starts with a status byte of $F0, has 4 or more data bytes, then ends with a status byte of $F7. Status bytes are always $80 or greater. Status bytes are always denoted in hexadecimal. Data bytes are always less than $80 (128 in decimal). Data bytes may be denoted in either decimal or hexadecimal.

Program change, Control change, and Note On/Off are the most often used of the MIDI "Channel Voice" commands. Since they are standard MIDI commands they are almost never explained in manufacturers programming manuals. Program change (Preset), Control change, Note On/Off, and System Exclusive.

Programming examples

The following section provides some programming examples:

SEND_STRING MIDI,"$C0 + (MIDI_CHANNEL - 1), PROGRAM - 1"

Specific example, to recall preset 128 on MIDI ch 1: MIDI_CHANNEL = 1

1 - 1 = 0

$C0 + 0 = $C0,

PROGRAM = 128

128 - 1 = 127, thus the send string,

SEND_STRING MIDI,"$C0,127"

The Program change is denoted by status byte $C0 (for MIDI channel 1) through status byte $CF (for MIDI channel 16), followed by one data byte.

PRGM EX. 1

SEND_STRING MIDI,"$90 + (MIDI_CHANNEL - 1), Note, Velocity" (* Note On *) SEND_STRING MIDI,"$80 + (MIDI_CHANNEL - 1), Note, Velocity" (* Note Off *)

Note that On is denoted by status byte $90 (for MIDI channel 1) through status byte $9F (for MIDI channel 16), Note that Off is denoted by status byte $80 (for MIDI channel 1) through status byte $8F (for MIDI channel 16).

PRGM EX. 2

SEND_STRING MIDI,"$80 + (MIDI_CHANNEL - 1), Note, 0"

(* Note Off *)

Most modern controllers send a $90 note on with velocity 0 for note off (We'll save the reason why for MIDI programming 102).

PRGM EX. 3

AXB-MIDI MIDI Interface

9

 

 

 

 

Image 13
Contents AXB-MIDI AMX Limited Warranty and Disclaimer Table of Contents Table of Contents Product Information AXB-MIDI SpecificationsAXB-MIDI Specifications Setting the Device DIP Switch InstallationWiring the AXB-MIDI Preparing Captive Wires for AXlinkAXlink Wiring Guidelines AXlink Wiring GuidelinesWiring AXlink with Optional 12 VDC power supply Midi cable connectors Replacing the Lithium BatteryAXB-MIDI circuit card, showing location of battery AXB-MIDI SendCommands Send CommandsProgramming A and in B Signal Routing A and in B Midi Signal RoutingProgramming examples Midi ProgrammingBank Select MSB Volume PAN Expression Channel Voice Messages Summary of Midi MessagesSystem Common Messages System Real-Time Messages Channel Mode MessagesChannel Mode Messages Programming AXB-MIDI Midi Interface AMX reserves