Zephyr Project API 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
midi.h File Reference
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  midi_ump
 Universal MIDI Packet container. More...
 

Macros

#define UMP_MT_UTILITY   0x00
 Utility Messages.
 
#define UMP_MT_SYS_RT_COMMON   0x01
 System Real Time and System Common Messages (except System Exclusive)
 
#define UMP_MT_MIDI1_CHANNEL_VOICE   0x02
 MIDI 1.0 Channel Voice Messages.
 
#define UMP_MT_DATA_64   0x03
 64 bits Data Messages (including System Exclusive)
 
#define UMP_MT_MIDI2_CHANNEL_VOICE   0x04
 MIDI 2.0 Channel Voice Messages.
 
#define UMP_MT_DATA_128   0x05
 128 bits Data Messages
 
#define UMP_MT_FLEX_DATA   0x0d
 Flex Data Messages.
 
#define UMP_MT_UMP_STREAM   0x0f
 UMP Stream Message.
 
#define UMP_MT(ump)    ((ump).data[0] >> 28)
 Message Type field of a Universal MIDI Packet.
 
#define UMP_NUM_WORDS_LOOKUP_TABLE
 There are 16 UMP message types, each of which can be 1 to 4 uint32 long.
 
#define UMP_NUM_WORDS(ump)    (1 + ((UMP_NUM_WORDS_LOOKUP_TABLE >> (2 * UMP_MT(ump))) & 3))
 Size of a Universal MIDI Packet, in 32bit words.
 
#define UMP_GROUP(ump)    (((ump).data[0] >> 24) & 0x0f)
 MIDI group field of a Universal MIDI Packet.
 
#define UMP_MIDI_STATUS(ump)    (((ump).data[0] >> 16) & 0xff)
 Status byte of a MIDI channel voice or system message.
 
#define UMP_MIDI_COMMAND(ump)    (UMP_MIDI_STATUS(ump) >> 4)
 Command of a MIDI channel voice message.
 
#define UMP_MIDI_CHANNEL(ump)    (UMP_MIDI_STATUS(ump) & 0x0f)
 Channel of a MIDI channel voice message.
 
#define UMP_MIDI1_P1(ump)    (((ump).data[0] >> 8) & 0x7f)
 First parameter of a MIDI1 channel voice or system message.
 
#define UMP_MIDI1_P2(ump)    ((ump).data[0] & 0x7f)
 Second parameter of a MIDI1 channel voice or system message.
 
#define UMP_MIDI1_CHANNEL_VOICE(group, command, channel, p1, p2)
 Initialize a UMP with a MIDI1 channel voice message.
 
#define UMP_MIDI_NOTE_OFF   0x8
 Note Off (p1=note number, p2=velocity)
 
#define UMP_MIDI_NOTE_ON   0x9
 Note On (p1=note number, p2=velocity)
 
#define UMP_MIDI_AFTERTOUCH   0xa
 Polyphonic aftertouch (p1=note number, p2=data)
 
#define UMP_MIDI_CONTROL_CHANGE   0xb
 Control Change (p1=index, p2=data)
 
#define UMP_MIDI_PROGRAM_CHANGE   0xc
 Control Change (p1=program)
 
#define UMP_MIDI_CHAN_AFTERTOUCH   0xd
 Channel aftertouch (p1=data)
 
#define UMP_MIDI_PITCH_BEND   0xe
 Pitch bend (p1=lsb, p2=msb)
 
#define UMP_SYS_RT_COMMON(group, status, p1, p2)
 Initialize a UMP with a System Real Time and System Common Message.
 
#define UMP_SYS_MIDI_TIME_CODE   0xf1
 MIDI Time Code (no param)
 
#define UMP_SYS_SONG_POSITION   0xf2
 Song Position Pointer (p1=lsb, p2=msb)
 
#define UMP_SYS_SONG_SELECT   0xf3
 Song Select (p1=song number)
 
#define UMP_SYS_TUNE_REQUEST   0xf6
 Tune Request (no param)
 
#define UMP_SYS_TIMING_CLOCK   0xf8
 Timing Clock (no param)
 
#define UMP_SYS_START   0xfa
 Start (no param)
 
#define UMP_SYS_CONTINUE   0xfb
 Continue (no param)
 
#define UMP_SYS_STOP   0xfc
 Stop (no param)
 
#define UMP_SYS_ACTIVE_SENSING   0xfe
 Active sensing (no param)
 
#define UMP_SYS_RESET   0xff
 Reset (no param)