.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * NRPN / SYSEX callbacks for Emu8k/Emu10k1 |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (c) 1999-2000 Takashi Iwai <tiwai@suse.de> |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or modify |
---|
7 | | - * it under the terms of the GNU General Public License as published by |
---|
8 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
9 | | - * (at your option) any later version. |
---|
10 | | - * |
---|
11 | | - * This program is distributed in the hope that it will be useful, |
---|
12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | | - * GNU General Public License for more details. |
---|
15 | | - * |
---|
16 | | - * You should have received a copy of the GNU General Public License |
---|
17 | | - * along with this program; if not, write to the Free Software |
---|
18 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
19 | | - * |
---|
20 | 6 | */ |
---|
21 | 7 | |
---|
22 | 8 | #include "emux_voice.h" |
---|
.. | .. |
---|
77 | 63 | /* effect sensitivities for GS NRPN: |
---|
78 | 64 | * adjusted for chaos 8MB soundfonts |
---|
79 | 65 | */ |
---|
80 | | -static int gs_sense[] = |
---|
| 66 | +static const int gs_sense[] = |
---|
81 | 67 | { |
---|
82 | 68 | DEF_FX_CUTOFF, DEF_FX_RESONANCE, DEF_FX_ATTACK, DEF_FX_RELEASE, |
---|
83 | 69 | DEF_FX_VIBRATE, DEF_FX_VIBDEPTH, DEF_FX_VIBDELAY |
---|
.. | .. |
---|
86 | 72 | /* effect sensitivies for XG controls: |
---|
87 | 73 | * adjusted for chaos 8MB soundfonts |
---|
88 | 74 | */ |
---|
89 | | -static int xg_sense[] = |
---|
| 75 | +static const int xg_sense[] = |
---|
90 | 76 | { |
---|
91 | 77 | DEF_FX_CUTOFF, DEF_FX_RESONANCE, DEF_FX_ATTACK, DEF_FX_RELEASE, |
---|
92 | 78 | DEF_FX_VIBRATE, DEF_FX_VIBDEPTH, DEF_FX_VIBDELAY |
---|
.. | .. |
---|
363 | 349 | snd_emux_xg_control(struct snd_emux_port *port, struct snd_midi_channel *chan, |
---|
364 | 350 | int param) |
---|
365 | 351 | { |
---|
| 352 | + if (param >= ARRAY_SIZE(chan->control)) |
---|
| 353 | + return -EINVAL; |
---|
| 354 | + |
---|
366 | 355 | return send_converted_effect(xg_effects, ARRAY_SIZE(xg_effects), |
---|
367 | 356 | port, chan, param, |
---|
368 | 357 | chan->control[param], |
---|