| 7 | | * |
| 8 | | * libjdkmidijava Java Class Library for MIDI |
| 9 | | * |
| 10 | | * Copyright (C) 2006 J.D. Koftinoff Software, Ltd. |
| 11 | | * www.jdkoftinoff.com |
| 12 | | * jeffk@jdkoftinoff.com |
| 13 | | * |
| 14 | | * *** RELEASED UNDER THE GNU GENERAL PUBLIC LICENSE (GPL) September 11, 2006 *** |
| 15 | | * |
| 16 | | * |
| 17 | | * This program is free software; you can redistribute it and/or modify |
| 18 | | * it under the terms of the GNU General Public License as published by |
| 19 | | * the Free Software Foundation; either version 2 of the License, or |
| 20 | | * (at your option) any later version. |
| 21 | | * |
| 22 | | * This program is distributed in the hope that it will be useful, |
| 23 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 24 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 25 | | * GNU General Public License for more details. |
| 26 | | * |
| 27 | | * You should have received a copy of the GNU General Public License |
| 28 | | * along with this program; if not, write to the Free Software |
| 29 | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 30 | | * |
| | 7 | * |
| | 8 | * libjdkmidijava Java Class Library for MIDI |
| | 9 | * |
| | 10 | * Copyright (C) 2006 J.D. Koftinoff Software, Ltd. www.jdkoftinoff.com |
| | 11 | * jeffk@jdkoftinoff.com |
| | 12 | * |
| | 13 | * *** RELEASED UNDER THE GNU GENERAL PUBLIC LICENSE (GPL) September 11, 2006 |
| | 14 | * *** |
| | 15 | * |
| | 16 | * |
| | 17 | * This program is free software; you can redistribute it and/or modify it under |
| | 18 | * the terms of the GNU General Public License as published by the Free Software |
| | 19 | * Foundation; either version 2 of the License, or (at your option) any later |
| | 20 | * version. |
| | 21 | * |
| | 22 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| | 23 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| | 24 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| | 25 | * details. |
| | 26 | * |
| | 27 | * You should have received a copy of the GNU General Public License along with |
| | 28 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
| | 29 | * Place, Suite 330, Boston, MA 02111-1307 USA |
| | 30 | * |
| 41 | | |
| 42 | | /** |
| 43 | | * Message Length Lookup table for normal status bytes, shifted right 4 bits. |
| 44 | | * A value of -1 means to use the lut_sysmsglen lookup table instead. |
| 45 | | */ |
| 46 | | public static int [] lut_msglen = { |
| 47 | | 0,0,0,0,0,0,0,0, |
| 48 | | 3, // 0x80=note off, 3 bytes |
| 49 | | 3, // 0x90=note on, 3 bytes |
| 50 | | 3, // 0xa0=poly pressure, 3 bytes |
| 51 | | 3, // 0xb0=control change, 3 bytes |
| 52 | | 2, // 0xc0=program change, 2 bytes |
| 53 | | 2, // 0xd0=channel pressure, 2 bytes |
| 54 | | 3, // 0xe0=pitch bend, 3 bytes |
| 55 | | -1 // 0xf0=other things. may vary. |
| | 43 | |
| | 44 | /** |
| | 45 | * Message Length Lookup table for normal status bytes, shifted right 4 |
| | 46 | * bits. A value of -1 means to use the lut_sysmsglen lookup table instead. |
| | 47 | */ |
| | 48 | public static int[] lut_msglen = |
| | 49 | { |
| | 50 | 0, 0, 0, 0, 0, 0, 0, 0, 3, // 0x80=note off, 3 bytes |
| | 51 | 3, // 0x90=note on, 3 bytes |
| | 52 | 3, // 0xa0=poly pressure, 3 bytes |
| | 53 | 3, // 0xb0=control change, 3 bytes |
| | 54 | 2, // 0xc0=program change, 2 bytes |
| | 55 | 2, // 0xd0=channel pressure, 2 bytes |
| | 56 | 3, // 0xe0=pitch bend, 3 bytes |
| | 57 | -1 // 0xf0=other things. may vary. |
| 57 | | |
| 58 | | /** |
| 59 | | * Message Length lookup table for system status bytes with values from 0xf0 to 0xff. |
| 60 | | * A value of -1 means that the message length can not be determined until an EOX. |
| 61 | | */ |
| 62 | | public static int [] lut_sysmsglen = |
| 63 | | { |
| 64 | | -1, // 0xf0=sysex start. may vary |
| 65 | | 2, // 0xf1=MIDI Time Code. 2 bytes |
| 66 | | 3, // 0xf2=MIDI Song position. 3 bytes |
| 67 | | 2, // 0xf3=MIDI Song Select. 2 bytes. |
| 68 | | 0, // 0xf4=undefined |
| 69 | | 0, // 0xf5=undefined |
| 70 | | 1, // 0xf6=TUNE Request |
| 71 | | 0, // 0xf7=sysex end. |
| 72 | | 1, // 0xf8=timing clock. 1 byte |
| 73 | | 1, // 0xf9=proposed measure end? |
| 74 | | 1, // 0xfa=start. 1 byte |
| 75 | | 1, // 0xfb=continue. 1 byte |
| 76 | | 1, // 0xfc=stop. 1 byte |
| 77 | | 0, // 0xfd=undefined |
| 78 | | 1, // 0xfe=active sensing. 1 byte |
| 79 | | 3 // 0xff= not reset, but a META-EVENT, which is always 3 bytes |
| | 59 | |
| | 60 | /** |
| | 61 | * Message Length lookup table for system status bytes with values from 0xf0 |
| | 62 | * to 0xff. A value of -1 means that the message length can not be |
| | 63 | * determined until an EOX. |
| | 64 | */ |
| | 65 | public static int[] lut_sysmsglen = |
| | 66 | { |
| | 67 | -1, // 0xf0=sysex start. may vary |
| | 68 | 2, // 0xf1=MIDI Time Code. 2 bytes |
| | 69 | 3, // 0xf2=MIDI Song position. 3 bytes |
| | 70 | 2, // 0xf3=MIDI Song Select. 2 bytes. |
| | 71 | 0, // 0xf4=undefined |
| | 72 | 0, // 0xf5=undefined |
| | 73 | 1, // 0xf6=TUNE Request |
| | 74 | 0, // 0xf7=sysex end. |
| | 75 | 1, // 0xf8=timing clock. 1 byte |
| | 76 | 1, // 0xf9=proposed measure end? |
| | 77 | 1, // 0xfa=start. 1 byte |
| | 78 | 1, // 0xfb=continue. 1 byte |
| | 79 | 1, // 0xfc=stop. 1 byte |
| | 80 | 0, // 0xfd=undefined |
| | 81 | 1, // 0xfe=active sensing. 1 byte |
| | 82 | 3 |
| | 83 | // 0xff= not reset, but a META-EVENT, which is always 3 bytes |
| 191 | | public static final int LSB=0x20; // add this to a non-switch controller to access the LSB. |
| 192 | | public static final int GM_BANK=0x00; // general midi bank select |
| 193 | | public static final int MODULATION=0x01; // modulation |
| 194 | | public static final int BREATH=0x02; // breath controller |
| 195 | | public static final int FOOT=0x04; // foot controller |
| 196 | | public static final int PORTA_TIME=0x05; // portamento time |
| 197 | | public static final int DATA_ENTRY=0x06; // data entry value |
| 198 | | public static final int MAIN_VOLUME=0x07; // main volume control |
| 199 | | public static final int BALANCE=0x08; // balance control |
| 200 | | public static final int PAN=0x0a; // panpot stereo control |
| 201 | | public static final int EXPRESSION=0x0b; // expression control |
| 202 | | public static final int GENERAL_1=0x10; // general purpose controller 1 |
| 203 | | public static final int GENERAL_2=0x11; // general purpose controller 2 |
| 204 | | public static final int GENERAL_3=0x12; // general purpose controller 3 |
| 205 | | public static final int GENERAL_4=0x13; // general purpose controller 4 |
| 206 | | |
| 207 | | public static final int DAMPER=0x40; // hold pedal (sustain) |
| 208 | | public static final int PORTA=0x41; // portamento switch |
| 209 | | public static final int SOSTENUTO=0x42; // sostenuto switch |
| 210 | | public static final int SOFT_PEDAL=0x43; // soft pedal |
| 211 | | public static final int HOLD_2=0x45; // hold pedal 2 |
| 212 | | |
| 213 | | public static final int GENERAL_5=0x50; // general purpose controller 5 |
| 214 | | public static final int GENERAL_6=0x51; // general purpose controller 6 |
| 215 | | public static final int GENERAL_7=0x52; // general purpose controller 7 |
| 216 | | public static final int GENERAL_8=0x53; // general purpose controller 8 |
| 217 | | |
| 218 | | public static final int EFFECT_DEPTH=0x5b; // external effects depth |
| 219 | | public static final int TREMELO_DEPTH=0x5c; // tremelo depth |
| 220 | | public static final int CHORUS_DEPTH=0x5d; // chorus depth |
| 221 | | public static final int CELESTE_DEPTH=0x5e; // celeste (detune) depth |
| 222 | | public static final int PHASER_DEPTH=0x5f; // phaser effect depth |
| 223 | | |
| 224 | | public static final int DATA_INC=0x60; // increment data value |
| 225 | | public static final int DATA_DEC=0x61; // decrement data value |
| 226 | | |
| 227 | | public static final int NONRPN_LSB=0x62; // non registered parameter LSB |
| 228 | | public static final int NONRPN_MSB=0x63; // non registered parameter MSB |
| 229 | | |
| 230 | | public static final int RPN_LSB=0x64; // registered parameter LSB |
| 231 | | public static final int RPN_MSB=0x65; // registered parameter MSB |
| 232 | | |
| 233 | | public static final int RESET=0x79; // reset all controllers |
| 234 | | |
| 235 | | public static final int LOCAL=0x79; // local control on/off |
| 236 | | public static final int ALL_NOTES_OFF=0x7a; // all notes off |
| 237 | | public static final int OMNI_OFF=0x7c; // omni off; all notes off |
| 238 | | public static final int OMNI_ON=0x7d; // omni on; all notes off |
| 239 | | public static final int MONO=0x7e; // mono on; all notes off |
| 240 | | public static final int POLY=0x7f; // poly on; all notes off |
| 241 | | } |
| 242 | | |
| | 209 | public static final int LSB = 0x20; // add this to a non-switch |
| | 210 | // controller to access the LSB. |
| | 211 | |
| | 212 | public static final int GM_BANK = 0x00; // general midi bank select |
| | 213 | |
| | 214 | public static final int MODULATION = 0x01; // modulation |
| | 215 | |
| | 216 | public static final int BREATH = 0x02; // breath controller |
| | 217 | |
| | 218 | public static final int FOOT = 0x04; // foot controller |
| | 219 | |
| | 220 | public static final int PORTA_TIME = 0x05; // portamento time |
| | 221 | |
| | 222 | public static final int DATA_ENTRY = 0x06; // data entry value |
| | 223 | |
| | 224 | public static final int MAIN_VOLUME = 0x07; // main volume control |
| | 225 | |
| | 226 | public static final int BALANCE = 0x08; // balance control |
| | 227 | |
| | 228 | public static final int PAN = 0x0a; // panpot stereo control |
| | 229 | |
| | 230 | public static final int EXPRESSION = 0x0b; // expression control |
| | 231 | |
| | 232 | public static final int GENERAL_1 = 0x10; // general purpose |
| | 233 | // controller 1 |
| | 234 | |
| | 235 | public static final int GENERAL_2 = 0x11; // general purpose |
| | 236 | // controller 2 |
| | 237 | |
| | 238 | public static final int GENERAL_3 = 0x12; // general purpose |
| | 239 | // controller 3 |
| | 240 | |
| | 241 | public static final int GENERAL_4 = 0x13; // general purpose |
| | 242 | // controller 4 |
| | 243 | |
| | 244 | public static final int DAMPER = 0x40; // hold pedal (sustain) |
| | 245 | |
| | 246 | public static final int PORTA = 0x41; // portamento switch |
| | 247 | |
| | 248 | public static final int SOSTENUTO = 0x42; // sostenuto switch |
| | 249 | |
| | 250 | public static final int SOFT_PEDAL = 0x43; // soft pedal |
| | 251 | |
| | 252 | public static final int HOLD_2 = 0x45; // hold pedal 2 |
| | 253 | |
| | 254 | public static final int GENERAL_5 = 0x50; // general purpose |
| | 255 | // controller 5 |
| | 256 | |
| | 257 | public static final int GENERAL_6 = 0x51; // general purpose |
| | 258 | // controller 6 |
| | 259 | |
| | 260 | public static final int GENERAL_7 = 0x52; // general purpose |
| | 261 | // controller 7 |
| | 262 | |
| | 263 | public static final int GENERAL_8 = 0x53; // general purpose |
| | 264 | // controller 8 |
| | 265 | |
| | 266 | public static final int EFFECT_DEPTH = 0x5b; // external effects |
| | 267 | // depth |
| | 268 | |
| | 269 | public static final int TREMELO_DEPTH = 0x5c; // tremelo depth |
| | 270 | |
| | 271 | public static final int CHORUS_DEPTH = 0x5d; // chorus depth |
| | 272 | |
| | 273 | public static final int CELESTE_DEPTH = 0x5e; // celeste (detune) |
| | 274 | // depth |
| | 275 | |
| | 276 | public static final int PHASER_DEPTH = 0x5f; // phaser effect depth |
| | 277 | |
| | 278 | public static final int DATA_INC = 0x60; // increment data value |
| | 279 | |
| | 280 | public static final int DATA_DEC = 0x61; // decrement data value |
| | 281 | |
| | 282 | public static final int NONRPN_LSB = 0x62; // non registered parameter |
| | 283 | // LSB |
| | 284 | |
| | 285 | public static final int NONRPN_MSB = 0x63; // non registered parameter |
| | 286 | // MSB |
| | 287 | |
| | 288 | public static final int RPN_LSB = 0x64; // registered parameter LSB |
| | 289 | |
| | 290 | public static final int RPN_MSB = 0x65; // registered parameter MSB |
| | 291 | |
| | 292 | public static final int RESET = 0x79; // reset all controllers |
| | 293 | |
| | 294 | public static final int LOCAL = 0x79; // local control on/off |
| | 295 | |
| | 296 | public static final int ALL_NOTES_OFF = 0x7a; // all notes off |
| | 297 | |
| | 298 | public static final int OMNI_OFF = 0x7c; // omni off; all notes off |
| | 299 | |
| | 300 | public static final int OMNI_ON = 0x7d; // omni on; all notes off |
| | 301 | |
| | 302 | public static final int MONO = 0x7e; // mono on; all notes off |
| | 303 | |
| | 304 | public static final int POLY = 0x7f; // poly on; all notes off |
| | 305 | } |
| | 306 | |
| 265 | | public static final int SEQUENCE_NUMBER =0x00; // value=16 bits. type 2 files |
| 266 | | |
| 267 | | public static final int GENERIC_TEXT =0x01; // value=16 bits, text item # |
| 268 | | public static final int COPYRIGHT =0x02; // value=17 bits, text item # |
| 269 | | public static final int INSTRUMENT_NAME =0x03; |
| 270 | | public static final int TRACK_NAME=0x04; |
| 271 | | public static final int LYRIC_TEXT=0x05; |
| 272 | | public static final int MARKER_TEXT=0x06; |
| 273 | | public static final int CUE_TEXT=0x07; |
| 274 | | |
| 275 | | public static final int OUTPUT_CABLE=0x21; |
| 276 | | public static final int TRACK_LOOP=0x2E; |
| 277 | | public static final int DATA_END=0x2f; |
| 278 | | public static final int END_OF_TRACK=0x2F; |
| 279 | | public static final int TEMPO=0x51; // value=16 bits, tempo(bpm)*256 |
| 280 | | public static final int SMPTE=0x54; // what for? |
| 281 | | public static final int TIMESIG=0x58; // value=num, denom |
| 282 | | public static final int KEYSIG=0x59; // value=# of sharps/flats, major/minor |
| 283 | | public static final int BEAT_MARKER=0x7e; |
| 284 | | public static final int SEQUENCER_SPECIFIC=0x7F; |
| 285 | | public static final int NO_OPERATION=0x7f; |
| 286 | | } |
| 287 | | |
| 288 | | |
| | 330 | public static final int SEQUENCE_NUMBER = 0x00; // value=16 bits. type 2 |
| | 331 | // files |
| | 332 | |
| | 333 | public static final int GENERIC_TEXT = 0x01; // value=16 bits, text |
| | 334 | // item # |
| | 335 | |
| | 336 | public static final int COPYRIGHT = 0x02; // value=17 bits, text item |
| | 337 | // # |
| | 338 | |
| | 339 | public static final int INSTRUMENT_NAME = 0x03; |
| | 340 | |
| | 341 | public static final int TRACK_NAME = 0x04; |
| | 342 | |
| | 343 | public static final int LYRIC_TEXT = 0x05; |
| | 344 | |
| | 345 | public static final int MARKER_TEXT = 0x06; |
| | 346 | |
| | 347 | public static final int CUE_TEXT = 0x07; |
| | 348 | |
| | 349 | public static final int OUTPUT_CABLE = 0x21; |
| | 350 | |
| | 351 | public static final int TRACK_LOOP = 0x2E; |
| | 352 | |
| | 353 | public static final int DATA_END = 0x2f; |
| | 354 | |
| | 355 | public static final int END_OF_TRACK = 0x2F; |
| | 356 | |
| | 357 | public static final int TEMPO = 0x51; // value=16 bits, tempo(bpm)*256 |
| | 358 | |
| | 359 | public static final int SMPTE = 0x54; // what for? |
| | 360 | |
| | 361 | public static final int TIMESIG = 0x58; // value=num, denom |
| | 362 | |
| | 363 | public static final int KEYSIG = 0x59; // value=# of sharps/flats, |
| | 364 | // major/minor |
| | 365 | |
| | 366 | public static final int BEAT_MARKER = 0x7e; |
| | 367 | |
| | 368 | public static final int SEQUENCER_SPECIFIC = 0x7F; |
| | 369 | |
| | 370 | public static final int NO_OPERATION = 0x7f; |
| | 371 | } |
| | 372 | |