23 #include <linux/export.h>
37 static void sysex(
struct snd_emux *
emu,
char *
buf,
int len,
int parsed,
39 #ifdef CONFIG_SND_SEQUENCER_OSS
43 const void __user *
buf,
long len);
58 #define LIMITVALUE(x, a, b) do { if ((x) < (a)) (x) = (a); else if ((x) > (b)) (x) = (b); } while (0)
59 #define LIMITMAX(x, a) do {if ((x) > (a)) (x) = (a); } while (0)
68 .prepare = start_voice,
69 .trigger = trigger_voice,
70 .release = release_voice,
71 .update = update_voice,
72 .terminate = terminate_voice,
79 #ifdef CONFIG_SND_SEQUENCER_OSS
80 .oss_ioctl = oss_ioctl,
87 hw->
emu->ops = emu8000_ops;
102 dcysusv = 0x8000 | (
unsigned char)vp->
reg.parm.modrelease;
104 dcysusv = 0x8000 | (
unsigned char)vp->
reg.parm.volrelease;
139 set_tremfreq(hw, vp);
177 for (i = 0; i <
END; i++) {
178 best[
i].time = (
unsigned int)(-1);
209 if (val >= vp->
reg.loopstart)
213 if (vp->
time < bp->time) {
219 for (i = 0; i <
END; i++) {
220 if (best[i].
voice >= 0) {
221 vp = &emu->
voices[best[
i].voice];
222 vp->
ch = best[
i].voice;
278 set_tremfreq(hw, vp);
285 addr = vp->
reg.loopend - 1;
286 temp = vp->
reg.parm.chorus;
289 temp = (temp <<24) | (
unsigned int)
addr;
293 addr = vp->
reg.start - 1;
294 temp = vp->
reg.parm.filterQ;
295 temp = (temp<<28) | (
unsigned int)
addr;
323 temp = vp->
reg.parm.reverb;
326 temp = (temp << 8) | (vp->
ptarget << 16) | vp->
aaux;
336 reset_voice(
struct snd_emux *emu,
int ch)
342 snd_emu8000_tweak_voice(hw, ch);
363 ifatn = (ifatn << 8);
376 temp = ((
unsigned int)vp->
apan<<24) | ((
unsigned int)vp->
reg.loopstart - 1);
385 unsigned short fmmod;
390 pitch = (
char)(vp->
reg.parm.fmmod>>8);
391 cutoff = (vp->
reg.parm.fmmod & 0xff);
392 modulation = vp->
chan->gm_modulation + vp->
chan->midi_pressure;
393 pitch += (
MOD_SENSE * modulation) / 1200;
410 unsigned short fm2frq2;
415 pitch = (
char)(vp->
reg.parm.fm2frq2>>8);
416 freq = vp->
reg.parm.fm2frq2 & 0xff;
417 modulation = vp->
chan->gm_modulation + vp->
chan->midi_pressure;
418 pitch += (
MOD_SENSE * modulation) / 1200;
420 fm2frq2 = ((
unsigned char)pitch<<8) |
freq;
430 addr |= (vp->
reg.parm.filterQ << 28);
438 snd_emu8000_tweak_voice(
struct snd_emu8000 *emu,
int i)
480 #ifdef CONFIG_SND_SEQUENCER_OSS
521 #define SNDRV_EMU8000_LOAD_CHORUS_FX 0x10
522 #define SNDRV_EMU8000_LOAD_REVERB_FX 0x11
530 load_fx(
struct snd_emux *emu,
int type,
int mode,
const void __user *buf,
long len)