source: ext/midi/midi.h @ ac4f38e

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since ac4f38e was b60dd4ae, checked in by Paul Brossier <piem@altern.org>, 20 years ago

moved midi functions to ext/

  • Property mode set to 100644
File size: 4.4 KB
RevLine 
[96fb8ad]1/*
2 *
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public License
6 * as published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 * Library General Public License for more details.
13 * 
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the Free
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 * 02111-1307, USA
18 */
19
20/* this file originally taken from fluidsynth, peter hanappe and others,
21 * adapted for aubio by paul brossier,
22 */
23
24
25/** \file
26 * midi header
27 *
28 * contains all (?) possible known midi messages.
29 *
30 * this file originally taken from fluidsynth, Peter Hanappe and others,
31 * adapted for aubio by Paul Brossier,
32 */
33
34#ifndef _AUBIO_MIDI_H
35#define _AUBIO_MIDI_H
36
37//typedef struct _aubio_midi_driver_t aubio_midi_driver_t;
38
39//int aubio_midi_send_event(aubio_synth_t* synth, aubio_player_t* player, aubio_midi_event_t* evt);
40
41//int aubio_midi_router_send_event(aubio_midi_router_t* router, aubio_midi_event_t* event);
42
43
44/***************************************************************
45 *
46 *                   CONSTANTS & ENUM
47 */
48
49#ifdef __cplusplus
50extern "C" {
51#endif
52
53enum aubio_midi_event_type {
54  /* channel messages */
55  NOTE_OFF = 0x80,
56  NOTE_ON = 0x90,
57  KEY_PRESSURE = 0xa0,
58  CONTROL_CHANGE = 0xb0,
59  PROGRAM_CHANGE = 0xc0,
60  CHANNEL_PRESSURE = 0xd0,
61  PITCH_BEND = 0xe0,
62  /* system exclusive */
63  MIDI_SYSEX = 0xf0,
64  /* system common - never in midi files */
65  MIDI_TIME_CODE = 0xf1,
66  MIDI_SONG_POSITION = 0xf2,
67  MIDI_SONG_SELECT = 0xf3,
68  MIDI_TUNE_REQUEST = 0xf6,
69  MIDI_EOX = 0xf7,
70  /* system real-time - never in midi files */
71  MIDI_SYNC = 0xf8,
72  MIDI_TICK = 0xf9,
73  MIDI_START = 0xfa,
74  MIDI_CONTINUE = 0xfb,
75  MIDI_STOP = 0xfc,
76  MIDI_ACTIVE_SENSING = 0xfe,
77  MIDI_SYSTEM_RESET = 0xff,
78  /* meta event - for midi files only */
79  MIDI_META_EVENT = 0xff
80};
81
82enum aubio_midi_control_change {
83  BANK_SELECT_MSB = 0x00,
84  MODULATION_MSB = 0x01,
85  BREATH_MSB = 0x02,
86  FOOT_MSB = 0x04,
87  PORTAMENTO_TIME_MSB = 0x05,
88  DATA_ENTRY_MSB = 0x06,
89  VOLUME_MSB = 0x07,
90  BALANCE_MSB = 0x08,
91  PAN_MSB = 0x0A,
92  EXPRESSION_MSB = 0x0B,
93  EFFECTS1_MSB = 0x0C,
94  EFFECTS2_MSB = 0x0D,
95  GPC1_MSB = 0x10, /* general purpose controller */
96  GPC2_MSB = 0x11,
97  GPC3_MSB = 0x12,
98  GPC4_MSB = 0x13,
99  BANK_SELECT_LSB = 0x20,
100  MODULATION_WHEEL_LSB = 0x21,
101  BREATH_LSB = 0x22,
102  FOOT_LSB = 0x24,
103  PORTAMENTO_TIME_LSB = 0x25,
104  DATA_ENTRY_LSB = 0x26,
105  VOLUME_LSB = 0x27,
106  BALANCE_LSB = 0x28,
107  PAN_LSB = 0x2A,
108  EXPRESSION_LSB = 0x2B,
109  EFFECTS1_LSB = 0x2C,
110  EFFECTS2_LSB = 0x2D,
111  GPC1_LSB = 0x30,
112  GPC2_LSB = 0x31,
113  GPC3_LSB = 0x32,
114  GPC4_LSB = 0x33,
115  SUSTAIN_SWITCH = 0x40,
116  PORTAMENTO_SWITCH = 0x41,
117  SOSTENUTO_SWITCH = 0x42,
118  SOFT_PEDAL_SWITCH = 0x43,
119  LEGATO_SWITCH = 0x45,
120  HOLD2_SWITCH = 0x45,
121  SOUND_CTRL1 = 0x46,
122  SOUND_CTRL2 = 0x47,
123  SOUND_CTRL3 = 0x48,
124  SOUND_CTRL4 = 0x49,
125  SOUND_CTRL5 = 0x4A,
126  SOUND_CTRL6 = 0x4B,
127  SOUND_CTRL7 = 0x4C,
128  SOUND_CTRL8 = 0x4D,
129  SOUND_CTRL9 = 0x4E,
130  SOUND_CTRL10 = 0x4F,
131  GPC5 = 0x50,
132  GPC6 = 0x51,
133  GPC7 = 0x52,
134  GPC8 = 0x53,
135  PORTAMENTO_CTRL = 0x54,
136  EFFECTS_DEPTH1 = 0x5B,
137  EFFECTS_DEPTH2 = 0x5C,
138  EFFECTS_DEPTH3 = 0x5D,
139  EFFECTS_DEPTH4 = 0x5E,
140  EFFECTS_DEPTH5 = 0x5F,
141  DATA_ENTRY_INCR = 0x60,
142  DATA_ENTRY_DECR = 0x61,
143  NRPN_LSB = 0x62,
144  NRPN_MSB = 0x63,
145  RPN_LSB = 0x64,
146  RPN_MSB = 0x65,
147  ALL_SOUND_OFF = 0x78,
148  ALL_CTRL_OFF = 0x79,
149  LOCAL_CONTROL = 0x7A,
150  ALL_NOTES_OFF = 0x7B,
151  OMNI_OFF = 0x7C,
152  OMNI_ON = 0x7D,
153  POLY_OFF = 0x7E,
154  POLY_ON = 0x7F
155};
156
157enum midi_meta_event {
158  MIDI_COPYRIGHT = 0x02,
159  MIDI_TRACK_NAME = 0x03,
160  MIDI_INST_NAME = 0x04,
161  MIDI_LYRIC = 0x05,
162  MIDI_MARKER = 0x06,
163  MIDI_CUE_POINT = 0x07,
164  MIDI_EOT = 0x2f,
165  MIDI_SET_TEMPO = 0x51,
166  MIDI_SMPTE_OFFSET = 0x54,
167  MIDI_TIME_SIGNATURE = 0x58,
168  MIDI_KEY_SIGNATURE = 0x59,
169  MIDI_SEQUENCER_EVENT = 0x7f
170};
171
172enum aubio_player_status
173{
174  AUBIO_MIDI_PLAYER_READY,
175  AUBIO_MIDI_PLAYER_PLAYING,
176  AUBIO_MIDI_PLAYER_DONE
177};
178
179enum aubio_driver_status
180{
181  AUBIO_MIDI_READY,
182  AUBIO_MIDI_LISTENING,
183  AUBIO_MIDI_DONE
184};
185
186#ifdef __cplusplus
187}
188#endif
189
190#endif /* _AUBIO_MIDI_H */
Note: See TracBrowser for help on using the repository browser.