1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
|
/*
TiMidity++ -- MIDI to WAVE converter and player
Copyright (C) 1999-2002 Masanao Izumo <mo@goice.co.jp>
Copyright (C) 1995 Tuukka Toivonen <tt@cgs.fi>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
remote_def.c - written by Masanao Izumo <mo@goice.co.jp>
Define some macros
*/
#ifndef ___REMOTE_DEFS_H_
#define ___REMOTE_DEFS_H_
/*
* /dev/sequencer input events.
*
* The data written to the /dev/sequencer is a stream of events. Events
* are records of 4 or 8 bytes. The first byte defines the size.
* Any number of events can be written with a write call. There
* is a set of macros for sending these events. Use these macros if you
* want to maximize portability of your program.
*
* Events SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO. Are also input events.
* (All input events are currently 4 bytes long. Be prepared to support
* 8 byte events also. If you receive any event having first byte >= 128,
* it's a 8 byte event.
*
* The events are documented at the end of this file.
*
* Normal events (4 bytes)
* There is also a 8 byte version of most of the 4 byte events. The
* 8 byte one is recommended.
*/
#define SEQ_NOTEOFF 0
#define SEQ_NOTEON 1
#define SEQ_WAIT TMR_WAIT_ABS
#define SEQ_PGMCHANGE 3
#define SEQ_SYNCTIMER TMR_START
#define SEQ_MIDIPUTC 5
#define SEQ_DRUMON 6 /*** OBSOLETE ***/
#define SEQ_DRUMOFF 7 /*** OBSOLETE ***/
#define SEQ_ECHO TMR_ECHO /* For synching programs with output */
#define SEQ_AFTERTOUCH 9
#define SEQ_CONTROLLER 10
#define SEQ_FULLSIZE 0xfd
#define SEQ_PRIVATE 0xfe
#define SEQ_EXTENDED 0xff
/*******************************************
* Midi controller numbers
*******************************************
* Controllers 0 to 31 (0x00 to 0x1f) and
* 32 to 63 (0x20 to 0x3f) are continuous
* controllers.
* In the MIDI 1.0 these controllers are sent using
* two messages. Controller numbers 0 to 31 are used
* to send the MSB and the controller numbers 32 to 63
* are for the LSB. Note that just 7 bits are used in MIDI bytes.
*/
#define CTL_BANK_SELECT 0x00
#define CTL_MODWHEEL 0x01
#define CTL_BREATH 0x02
/* undefined 0x03 */
#define CTL_FOOT 0x04
#define CTL_PORTAMENTO_TIME 0x05
#define CTL_DATA_ENTRY 0x06
#define CTL_MAIN_VOLUME 0x07
#define CTL_BALANCE 0x08
/* undefined 0x09 */
#define CTL_PAN 0x0a
#define CTL_EXPRESSION 0x0b
/* undefined 0x0c */
/* undefined 0x0d */
/* undefined 0x0e */
/* undefined 0x0f */
#define CTL_GENERAL_PURPOSE1 0x10
#define CTL_GENERAL_PURPOSE2 0x11
#define CTL_GENERAL_PURPOSE3 0x12
#define CTL_GENERAL_PURPOSE4 0x13
/* undefined 0x14 - 0x1f */
/* undefined 0x20 */
/* The controller numbers 0x21 to 0x3f are reserved for the */
/* least significant bytes of the controllers 0x00 to 0x1f. */
/* These controllers are not recognised by the driver. */
/* Controllers 64 to 69 (0x40 to 0x45) are on/off switches. */
/* 0=OFF and 127=ON (intermediate values are possible) */
#define CTL_DAMPER_PEDAL 0x40
#define CTL_SUSTAIN 0x40 /* Alias */
#define CTL_HOLD 0x40 /* Alias */
#define CTL_PORTAMENTO 0x41
#define CTL_SOSTENUTO 0x42
#define CTL_SOFT_PEDAL 0x43
/* undefined 0x44 */
#define CTL_HOLD2 0x45
/* undefined 0x46 - 0x4f */
#define CTL_GENERAL_PURPOSE5 0x50
#define CTL_GENERAL_PURPOSE6 0x51
#define CTL_GENERAL_PURPOSE7 0x52
#define CTL_GENERAL_PURPOSE8 0x53
/* undefined 0x54 - 0x5a */
#define CTL_EXT_EFF_DEPTH 0x5b
#define CTL_TREMOLO_DEPTH 0x5c
#define CTL_CHORUS_DEPTH 0x5d
#define CTL_DETUNE_DEPTH 0x5e
#define CTL_CELESTE_DEPTH 0x5e /* Alias for the above one */
#define CTL_PHASER_DEPTH 0x5f
#define CTL_DATA_INCREMENT 0x60
#define CTL_DATA_DECREMENT 0x61
#define CTL_NONREG_PARM_NUM_LSB 0x62
#define CTL_NONREG_PARM_NUM_MSB 0x63
#define CTL_REGIST_PARM_NUM_LSB 0x64
#define CTL_REGIST_PARM_NUM_MSB 0x65
/* undefined 0x66 - 0x78 */
/* reserved 0x79 - 0x7f */
/* Pseudo controllers (not midi compatible) */
#define CTRL_PITCH_BENDER 255
#define CTRL_PITCH_BENDER_RANGE 254
#define CTRL_EXPRESSION 253 /* Obsolete */
#define CTRL_MAIN_VOLUME 252 /* Obsolete */
#define SEQ_BALANCE 11
#define SEQ_VOLMODE 12
/*
* Level 2 event types for /dev/sequencer
*/
/*
* The 4 most significant bits of byte 0 specify the class of
* the event:
*
* 0x8X = system level events,
* 0x9X = device/port specific events, event[1] = device/port,
* The last 4 bits give the subtype:
* 0x02 = Channel event (event[3] = chn).
* 0x01 = note event (event[4] = note).
* (0x01 is not used alone but always with bit 0x02).
* event[2] = MIDI message code (0x80=note off etc.)
*
*/
#define EV_SEQ_LOCAL 0x80
#define EV_TIMING 0x81
#define EV_CHN_COMMON 0x92
#define EV_CHN_VOICE 0x93
#define EV_SYSEX 0x94
/*
* Event types 200 to 220 are reserved for application use.
* These numbers will not be used by the driver.
*/
/*
* Events for event type EV_CHN_VOICE
*/
#define MIDI_NOTEOFF 0x80
#define MIDI_NOTEON 0x90
#define MIDI_KEY_PRESSURE 0xA0
/*
* Events for event type EV_CHN_COMMON
*/
#define MIDI_CTL_CHANGE 0xB0
#define MIDI_PGM_CHANGE 0xC0
#define MIDI_CHN_PRESSURE 0xD0
#define MIDI_PITCH_BEND 0xE0
#define MIDI_SYSTEM_PREFIX 0xF0
/*
* Timer event types
*/
#define TMR_WAIT_REL 1 /* Time relative to the prev time */
#define TMR_WAIT_ABS 2 /* Absolute time since TMR_START */
#define TMR_STOP 3
#define TMR_START 4
#define TMR_CONTINUE 5
#define TMR_TEMPO 6
#define TMR_ECHO 8
#define TMR_CLOCK 9 /* MIDI clock */
#define TMR_SPP 10 /* Song position pointer */
#define TMR_TIMESIG 11 /* Time signature */
#endif /* ___REMOTE_DEFS_H_ */
|