2 * GM/GS/XG midi module.
4 * Copyright (C) 1999 Steve Ratcliffe
6 * Based on awe_wave.c by Takashi Iwai
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * This module is used to keep track of the current midi state.
25 * It can be used for drivers that are required to emulate midi when
26 * the hardware doesn't.
28 * It was written for a AWE64 driver, but there should be no AWE specific
29 * code in here. If there is it should be reported as a bug.
32 #include <sound/driver.h>
33 #include <linux/init.h>
34 #include <linux/slab.h>
35 #include <linux/string.h>
36 #include <sound/core.h>
37 #include <sound/seq_kernel.h>
38 #include <sound/seq_midi_emul.h>
39 #include <sound/initval.h>
40 #include <sound/asoundef.h>
42 MODULE_AUTHOR("Takashi Iwai / Steve Ratcliffe");
43 MODULE_DESCRIPTION("Advanced Linux Sound Architecture sequencer MIDI emulation.");
44 MODULE_LICENSE("GPL");
45 MODULE_CLASSES("{sound}");
46 MODULE_SUPPORTED_DEVICE("sound");
48 /* Prototypes for static functions */
49 static void note_off(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan, int note, int vel);
50 static void do_control(snd_midi_op_t *ops, void *private,
51 snd_midi_channel_set_t *chset, snd_midi_channel_t *chan,
52 int control, int value);
53 static void rpn(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan, snd_midi_channel_set_t *chset);
54 static void nrpn(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan, snd_midi_channel_set_t *chset);
55 static void sysex(snd_midi_op_t *ops, void *private, unsigned char *sysex, int len, snd_midi_channel_set_t *chset);
56 static void all_sounds_off(snd_midi_op_t *ops, void *private, snd_midi_channel_t *chan);
57 static void all_notes_off(snd_midi_op_t *ops, void *private, snd_midi_channel_t *chan);
58 void snd_midi_reset_controllers(snd_midi_channel_t *chan);
59 static void reset_all_channels(snd_midi_channel_set_t *chset);
63 * Process an event in a driver independent way. This means dealing
64 * with RPN, NRPN, SysEx etc that are defined for common midi applications
65 * such as GM, GS and XG.
66 * There modes that this module will run in are:
67 * Generic MIDI - no interpretation at all, it will just save current values
69 * GM - You can use all gm_ prefixed elements of chan. Controls, RPN, NRPN,
70 * SysEx will be interpreded as defined in General Midi.
71 * GS - You can use all gs_ prefixed elements of chan. Codes for GS will be
73 * XG - You can use all xg_ prefixed elements of chan. Codes for XG will
77 snd_midi_process_event(snd_midi_op_t *ops,
78 snd_seq_event_t *ev, snd_midi_channel_set_t *chanset)
80 snd_midi_channel_t *chan;
84 if (ev == NULL || chanset == NULL) {
85 snd_printd("ev or chanbase NULL (snd_midi_process_event)\n");
88 if (chanset->channels == NULL)
91 if (snd_seq_ev_is_channel_type(ev)) {
92 dest_channel = ev->data.note.channel;
93 if (dest_channel >= chanset->max_channels) {
94 snd_printd("dest channel is %d, max is %d\n", dest_channel, chanset->max_channels);
99 chan = chanset->channels + dest_channel;
100 drv = chanset->private_data;
102 /* EVENT_NOTE should be processed before queued */
103 if (ev->type == SNDRV_SEQ_EVENT_NOTE)
106 /* Make sure that we don't have a note on that should really be
108 if (ev->type == SNDRV_SEQ_EVENT_NOTEON && ev->data.note.velocity == 0)
109 ev->type = SNDRV_SEQ_EVENT_NOTEOFF;
111 /* Make sure the note is within array range */
112 if (ev->type == SNDRV_SEQ_EVENT_NOTEON ||
113 ev->type == SNDRV_SEQ_EVENT_NOTEOFF ||
114 ev->type == SNDRV_SEQ_EVENT_KEYPRESS) {
115 if (ev->data.note.note >= 128)
120 case SNDRV_SEQ_EVENT_NOTEON:
121 if (chan->note[ev->data.note.note] & SNDRV_MIDI_NOTE_ON) {
123 ops->note_off(drv, ev->data.note.note, 0, chan);
125 chan->note[ev->data.note.note] = SNDRV_MIDI_NOTE_ON;
127 ops->note_on(drv, ev->data.note.note, ev->data.note.velocity, chan);
129 case SNDRV_SEQ_EVENT_NOTEOFF:
130 if (! (chan->note[ev->data.note.note] & SNDRV_MIDI_NOTE_ON))
133 note_off(ops, drv, chan, ev->data.note.note, ev->data.note.velocity);
135 case SNDRV_SEQ_EVENT_KEYPRESS:
137 ops->key_press(drv, ev->data.note.note, ev->data.note.velocity, chan);
139 case SNDRV_SEQ_EVENT_CONTROLLER:
140 do_control(ops, drv, chanset, chan,
141 ev->data.control.param, ev->data.control.value);
143 case SNDRV_SEQ_EVENT_PGMCHANGE:
144 chan->midi_program = ev->data.control.value;
146 case SNDRV_SEQ_EVENT_PITCHBEND:
147 chan->midi_pitchbend = ev->data.control.value;
149 ops->control(drv, MIDI_CTL_PITCHBEND, chan);
151 case SNDRV_SEQ_EVENT_CHANPRESS:
152 chan->midi_pressure = ev->data.control.value;
154 ops->control(drv, MIDI_CTL_CHAN_PRESSURE, chan);
156 case SNDRV_SEQ_EVENT_CONTROL14:
157 /* Best guess is that this is any of the 14 bit controller values */
158 if (ev->data.control.param < 32) {
159 /* set low part first */
160 chan->control[ev->data.control.param + 32] =
161 ev->data.control.value & 0x7f;
162 do_control(ops, drv, chanset, chan,
163 ev->data.control.param,
164 ((ev->data.control.value>>7) & 0x7f));
166 do_control(ops, drv, chanset, chan,
167 ev->data.control.param,
168 ev->data.control.value);
170 case SNDRV_SEQ_EVENT_NONREGPARAM:
171 /* Break it back into its controler values */
172 chan->param_type = SNDRV_MIDI_PARAM_TYPE_NONREGISTERED;
173 chan->control[MIDI_CTL_MSB_DATA_ENTRY]
174 = (ev->data.control.value >> 7) & 0x7f;
175 chan->control[MIDI_CTL_LSB_DATA_ENTRY]
176 = ev->data.control.value & 0x7f;
177 chan->control[MIDI_CTL_NONREG_PARM_NUM_MSB]
178 = (ev->data.control.param >> 7) & 0x7f;
179 chan->control[MIDI_CTL_NONREG_PARM_NUM_LSB]
180 = ev->data.control.param & 0x7f;
181 nrpn(ops, drv, chan, chanset);
183 case SNDRV_SEQ_EVENT_REGPARAM:
184 /* Break it back into its controler values */
185 chan->param_type = SNDRV_MIDI_PARAM_TYPE_REGISTERED;
186 chan->control[MIDI_CTL_MSB_DATA_ENTRY]
187 = (ev->data.control.value >> 7) & 0x7f;
188 chan->control[MIDI_CTL_LSB_DATA_ENTRY]
189 = ev->data.control.value & 0x7f;
190 chan->control[MIDI_CTL_REGIST_PARM_NUM_MSB]
191 = (ev->data.control.param >> 7) & 0x7f;
192 chan->control[MIDI_CTL_REGIST_PARM_NUM_LSB]
193 = ev->data.control.param & 0x7f;
194 rpn(ops, drv, chan, chanset);
196 case SNDRV_SEQ_EVENT_SYSEX:
197 if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) == SNDRV_SEQ_EVENT_LENGTH_VARIABLE) {
198 unsigned char sysexbuf[64];
200 len = snd_seq_expand_var_event(ev, sizeof(sysexbuf), sysexbuf, 1, 0);
202 sysex(ops, drv, sysexbuf, len, chanset);
205 case SNDRV_SEQ_EVENT_SONGPOS:
206 case SNDRV_SEQ_EVENT_SONGSEL:
207 case SNDRV_SEQ_EVENT_CLOCK:
208 case SNDRV_SEQ_EVENT_START:
209 case SNDRV_SEQ_EVENT_CONTINUE:
210 case SNDRV_SEQ_EVENT_STOP:
211 case SNDRV_SEQ_EVENT_QFRAME:
212 case SNDRV_SEQ_EVENT_TEMPO:
213 case SNDRV_SEQ_EVENT_TIMESIGN:
214 case SNDRV_SEQ_EVENT_KEYSIGN:
216 case SNDRV_SEQ_EVENT_SENSING:
218 case SNDRV_SEQ_EVENT_CLIENT_START:
219 case SNDRV_SEQ_EVENT_CLIENT_EXIT:
220 case SNDRV_SEQ_EVENT_CLIENT_CHANGE:
221 case SNDRV_SEQ_EVENT_PORT_START:
222 case SNDRV_SEQ_EVENT_PORT_EXIT:
223 case SNDRV_SEQ_EVENT_PORT_CHANGE:
224 case SNDRV_SEQ_EVENT_SAMPLE:
225 case SNDRV_SEQ_EVENT_SAMPLE_START:
226 case SNDRV_SEQ_EVENT_SAMPLE_STOP:
227 case SNDRV_SEQ_EVENT_SAMPLE_FREQ:
228 case SNDRV_SEQ_EVENT_SAMPLE_VOLUME:
229 case SNDRV_SEQ_EVENT_SAMPLE_LOOP:
230 case SNDRV_SEQ_EVENT_SAMPLE_POSITION:
231 case SNDRV_SEQ_EVENT_ECHO:
234 /*snd_printd("Unimplemented event %d\n", ev->type);*/
244 note_off(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan, int note, int vel)
247 /* Hold this note until pedal is turned off */
248 chan->note[note] |= SNDRV_MIDI_NOTE_RELEASED;
249 } else if (chan->note[note] & SNDRV_MIDI_NOTE_SUSTENUTO) {
250 /* Mark this note as release; it will be turned off when sustenuto
252 chan->note[note] |= SNDRV_MIDI_NOTE_RELEASED;
254 chan->note[note] = 0;
256 ops->note_off(drv, note, vel, chan);
261 * Do all driver independent operations for this controler and pass
262 * events that need to take place immediately to the driver.
265 do_control(snd_midi_op_t *ops, void *drv, snd_midi_channel_set_t *chset,
266 snd_midi_channel_t *chan, int control, int value)
271 if ((control >=64 && control <=69) || (control >= 80 && control <= 83)) {
272 /* These are all switches; either off or on so set to 0 or 127 */
273 value = (value >= 64)? 127: 0;
275 chan->control[control] = value;
278 case MIDI_CTL_SUSTAIN:
280 /* Sustain has been released, turn off held notes */
281 for (i = 0; i < 128; i++) {
282 if (chan->note[i] & SNDRV_MIDI_NOTE_RELEASED) {
283 chan->note[i] = SNDRV_MIDI_NOTE_OFF;
285 ops->note_off(drv, i, 0, chan);
290 case MIDI_CTL_PORTAMENTO:
292 case MIDI_CTL_SUSTENUTO:
294 /* Mark each note that is currently held down */
295 for (i = 0; i < 128; i++) {
296 if (chan->note[i] & SNDRV_MIDI_NOTE_ON)
297 chan->note[i] |= SNDRV_MIDI_NOTE_SUSTENUTO;
300 /* release all notes that were held */
301 for (i = 0; i < 128; i++) {
302 if (chan->note[i] & SNDRV_MIDI_NOTE_SUSTENUTO) {
303 chan->note[i] &= ~SNDRV_MIDI_NOTE_SUSTENUTO;
304 if (chan->note[i] & SNDRV_MIDI_NOTE_RELEASED) {
305 chan->note[i] = SNDRV_MIDI_NOTE_OFF;
307 ops->note_off(drv, i, 0, chan);
313 case MIDI_CTL_MSB_DATA_ENTRY:
314 chan->control[MIDI_CTL_LSB_DATA_ENTRY] = 0;
315 /* go through here */
316 case MIDI_CTL_LSB_DATA_ENTRY:
317 if (chan->param_type == SNDRV_MIDI_PARAM_TYPE_REGISTERED)
318 rpn(ops, drv, chan, chset);
320 nrpn(ops, drv, chan, chset);
322 case MIDI_CTL_REGIST_PARM_NUM_LSB:
323 case MIDI_CTL_REGIST_PARM_NUM_MSB:
324 chan->param_type = SNDRV_MIDI_PARAM_TYPE_REGISTERED;
326 case MIDI_CTL_NONREG_PARM_NUM_LSB:
327 case MIDI_CTL_NONREG_PARM_NUM_MSB:
328 chan->param_type = SNDRV_MIDI_PARAM_TYPE_NONREGISTERED;
331 case MIDI_CTL_ALL_SOUNDS_OFF:
332 all_sounds_off(ops, drv, chan);
335 case MIDI_CTL_ALL_NOTES_OFF:
336 all_notes_off(ops, drv, chan);
339 case MIDI_CTL_MSB_BANK:
340 if (chset->midi_mode == SNDRV_MIDI_MODE_XG) {
342 chan->drum_channel = 1;
344 chan->drum_channel = 0;
347 case MIDI_CTL_LSB_BANK:
350 case MIDI_CTL_RESET_CONTROLLERS:
351 snd_midi_reset_controllers(chan);
354 case MIDI_CTL_SOFT_PEDAL:
355 case MIDI_CTL_LEGATO_FOOTSWITCH:
357 case MIDI_CTL_SC1_SOUND_VARIATION:
358 case MIDI_CTL_SC2_TIMBRE:
359 case MIDI_CTL_SC3_RELEASE_TIME:
360 case MIDI_CTL_SC4_ATTACK_TIME:
361 case MIDI_CTL_SC5_BRIGHTNESS:
362 case MIDI_CTL_E1_REVERB_DEPTH:
363 case MIDI_CTL_E2_TREMOLO_DEPTH:
364 case MIDI_CTL_E3_CHORUS_DEPTH:
365 case MIDI_CTL_E4_DETUNE_DEPTH:
366 case MIDI_CTL_E5_PHASER_DEPTH:
371 ops->control(drv, control, chan);
378 * initialize the MIDI status
381 snd_midi_channel_set_clear(snd_midi_channel_set_t *chset)
385 chset->midi_mode = SNDRV_MIDI_MODE_GM;
386 chset->gs_master_volume = 127;
388 for (i = 0; i < chset->max_channels; i++) {
389 snd_midi_channel_t *chan = chset->channels + i;
390 memset(chan->note, 0, sizeof(chan->note));
392 chan->midi_aftertouch = 0;
393 chan->midi_pressure = 0;
394 chan->midi_program = 0;
395 chan->midi_pitchbend = 0;
396 snd_midi_reset_controllers(chan);
397 chan->gm_rpn_pitch_bend_range = 256; /* 2 semitones */
398 chan->gm_rpn_fine_tuning = 0;
399 chan->gm_rpn_coarse_tuning = 0;
402 chan->drum_channel = 1;
404 chan->drum_channel = 0;
409 * Process a rpn message.
412 rpn(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan,
413 snd_midi_channel_set_t *chset)
418 if (chset->midi_mode != SNDRV_MIDI_MODE_NONE) {
419 type = (chan->control[MIDI_CTL_REGIST_PARM_NUM_MSB] << 8) |
420 chan->control[MIDI_CTL_REGIST_PARM_NUM_LSB];
421 val = (chan->control[MIDI_CTL_MSB_DATA_ENTRY] << 7) |
422 chan->control[MIDI_CTL_LSB_DATA_ENTRY];
425 case 0x0000: /* Pitch bend sensitivity */
426 /* MSB only / 1 semitone per 128 */
427 chan->gm_rpn_pitch_bend_range = val;
430 case 0x0001: /* fine tuning: */
431 /* MSB/LSB, 8192=center, 100/8192 cent step */
432 chan->gm_rpn_fine_tuning = val - 8192;
435 case 0x0002: /* coarse tuning */
436 /* MSB only / 8192=center, 1 semitone per 128 */
437 chan->gm_rpn_coarse_tuning = val - 8192;
440 case 0x7F7F: /* "lock-in" RPN */
445 /* should call nrpn or rpn callback here.. */
449 * Process an nrpn message.
452 nrpn(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan,
453 snd_midi_channel_set_t *chset)
455 /* parse XG NRPNs here if possible */
457 ops->nrpn(drv, chan, chset);
462 * convert channel parameter in GS sysex
465 get_channel(unsigned char cmd)
477 * Process a sysex message.
480 sysex(snd_midi_op_t *ops, void *private, unsigned char *buf, int len, snd_midi_channel_set_t *chset)
483 static unsigned char gm_on_macro[] = {
487 static unsigned char xg_on_macro[] = {
488 0x43,0x10,0x4c,0x00,0x00,0x7e,0x00,
491 * drum channel: XX=0x1?(channel), YY=0x15, ZZ=on/off
492 * reverb mode: XX=0x01, YY=0x30, ZZ=0-7
493 * chorus mode: XX=0x01, YY=0x38, ZZ=0-7
494 * master vol: XX=0x00, YY=0x04, ZZ=0-127
496 static unsigned char gs_pfx_macro[] = {
497 0x41,0x10,0x42,0x12,0x40,/*XX,YY,ZZ*/
500 int parsed = SNDRV_MIDI_SYSEX_NOT_PARSED;
502 if (len <= 0 || buf[0] != 0xf0)
504 /* skip first byte */
509 if (len >= (int)sizeof(gm_on_macro) &&
510 memcmp(buf, gm_on_macro, sizeof(gm_on_macro)) == 0) {
511 if (chset->midi_mode != SNDRV_MIDI_MODE_GS &&
512 chset->midi_mode != SNDRV_MIDI_MODE_XG) {
513 chset->midi_mode = SNDRV_MIDI_MODE_GM;
514 reset_all_channels(chset);
515 parsed = SNDRV_MIDI_SYSEX_GM_ON;
521 memcmp(buf, gs_pfx_macro, sizeof(gs_pfx_macro)) == 0) {
522 if (chset->midi_mode != SNDRV_MIDI_MODE_GS &&
523 chset->midi_mode != SNDRV_MIDI_MODE_XG)
524 chset->midi_mode = SNDRV_MIDI_MODE_GS;
526 if (buf[5] == 0x00 && buf[6] == 0x7f && buf[7] == 0x00) {
528 parsed = SNDRV_MIDI_SYSEX_GS_RESET;
529 reset_all_channels(chset);
532 else if ((buf[5] & 0xf0) == 0x10 && buf[6] == 0x15) {
534 int p = get_channel(buf[5]);
535 if (p < chset->max_channels) {
536 parsed = SNDRV_MIDI_SYSEX_GS_DRUM_CHANNEL;
538 chset->channels[p].drum_channel = 1;
540 chset->channels[p].drum_channel = 0;
543 } else if ((buf[5] & 0xf0) == 0x10 && buf[6] == 0x21) {
545 int p = get_channel(buf[5]);
546 if (p < chset->max_channels &&
547 ! chset->channels[p].drum_channel) {
548 parsed = SNDRV_MIDI_SYSEX_GS_DRUM_CHANNEL;
549 chset->channels[p].midi_program = buf[7];
552 } else if (buf[5] == 0x01 && buf[6] == 0x30) {
554 parsed = SNDRV_MIDI_SYSEX_GS_CHORUS_MODE;
555 chset->gs_reverb_mode = buf[7];
557 } else if (buf[5] == 0x01 && buf[6] == 0x38) {
559 parsed = SNDRV_MIDI_SYSEX_GS_REVERB_MODE;
560 chset->gs_chorus_mode = buf[7];
562 } else if (buf[5] == 0x00 && buf[6] == 0x04) {
564 parsed = SNDRV_MIDI_SYSEX_GS_MASTER_VOLUME;
565 chset->gs_master_volume = buf[7];
571 else if (len >= (int)sizeof(xg_on_macro) &&
572 memcmp(buf, xg_on_macro, sizeof(xg_on_macro)) == 0) {
574 chset->midi_mode = SNDRV_MIDI_MODE_XG;
575 parsed = SNDRV_MIDI_SYSEX_XG_ON;
576 /* reset CC#0 for drums */
577 for (i = 0; i < chset->max_channels; i++) {
578 if (chset->channels[i].drum_channel)
579 chset->channels[i].control[MIDI_CTL_MSB_BANK] = 127;
581 chset->channels[i].control[MIDI_CTL_MSB_BANK] = 0;
586 ops->sysex(private, buf - 1, len + 1, parsed, chset);
593 all_sounds_off(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan)
597 if (! ops->note_terminate)
599 for (n = 0; n < 128; n++) {
601 ops->note_terminate(drv, n, chan);
611 all_notes_off(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan)
617 for (n = 0; n < 128; n++) {
618 if (chan->note[n] == SNDRV_MIDI_NOTE_ON)
619 note_off(ops, drv, chan, n, 0);
624 * Initialise a single midi channel control block.
626 void snd_midi_channel_init(snd_midi_channel_t *p, int n)
631 memset(p, 0, sizeof(snd_midi_channel_t));
635 snd_midi_reset_controllers(p);
636 p->gm_rpn_pitch_bend_range = 256; /* 2 semitones */
637 p->gm_rpn_fine_tuning = 0;
638 p->gm_rpn_coarse_tuning = 0;
641 p->drum_channel = 1; /* Default ch 10 as drums */
645 * Allocate and initialise a set of midi channel control blocks.
647 snd_midi_channel_t *snd_midi_channel_init_set(int n)
649 snd_midi_channel_t *chan;
652 chan = kmalloc(n * sizeof(snd_midi_channel_t), GFP_KERNEL);
654 for (i = 0; i < n; i++)
655 snd_midi_channel_init(chan+i, i);
662 * reset all midi channels
665 reset_all_channels(snd_midi_channel_set_t *chset)
668 for (ch = 0; ch < chset->max_channels; ch++) {
669 snd_midi_channel_t *chan = chset->channels + ch;
670 snd_midi_reset_controllers(chan);
671 chan->gm_rpn_pitch_bend_range = 256; /* 2 semitones */
672 chan->gm_rpn_fine_tuning = 0;
673 chan->gm_rpn_coarse_tuning = 0;
676 chan->drum_channel = 1;
678 chan->drum_channel = 0;
684 * Allocate and initialise a midi channel set.
686 snd_midi_channel_set_t *snd_midi_channel_alloc_set(int n)
688 snd_midi_channel_set_t *chset;
690 chset = kmalloc(sizeof(*chset), GFP_KERNEL);
692 chset->channels = snd_midi_channel_init_set(n);
693 chset->private_data = NULL;
694 chset->max_channels = n;
700 * Reset the midi controllers on a particular channel to default values.
702 void snd_midi_reset_controllers(snd_midi_channel_t *chan)
704 memset(chan->control, 0, sizeof(chan->control));
705 chan->gm_volume = 127;
706 chan->gm_expression = 127;
712 * Free a midi channel set.
714 void snd_midi_channel_free_set(snd_midi_channel_set_t *chset)
718 if (chset->channels != NULL)
719 kfree(chset->channels);
723 static int __init alsa_seq_midi_emul_init(void)
728 static void __exit alsa_seq_midi_emul_exit(void)
732 module_init(alsa_seq_midi_emul_init)
733 module_exit(alsa_seq_midi_emul_exit)
735 EXPORT_SYMBOL(snd_midi_process_event);
736 EXPORT_SYMBOL(snd_midi_channel_set_clear);
737 EXPORT_SYMBOL(snd_midi_channel_init);
738 EXPORT_SYMBOL(snd_midi_channel_init_set);
739 EXPORT_SYMBOL(snd_midi_channel_alloc_set);
740 EXPORT_SYMBOL(snd_midi_channel_free_set);