Skip to contentSkip to conversation

emux midi synthesizer doesn't honor SOFT_PEDAL-release event

PATCH In review maximilian attems 2 participants 2 messages May 8, 2008 – May 9, 2008 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 emux midi synthesizer doesn't honor SOFT_PEDAL-release event

When the hardware wavetable synthesizer of an Creative SB Audigy or SB Live! card (with emu10k chip) receives the MIDI SOFT_PEADAL-press event (?? 67 127) the appropriate voice is attenuted. Unfortunately when the pedal is released (event ?? 67 0) the voice does not get it's original volume again.

The attached patch fixes this problem by analysing the value (0 or 127) of the midi control event and resetting the effect register in case of a release event. I'm not 100% sure if the code to reset the register is correct but at least it works.

Original patch from "Uwe KrÃ#ger" <[email protected]> Submitted to http://bugs.debian.org/474312

---
 sound/synth/emux/emux_synth.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
sound/synth/emux/emux_synth.c +5 -1
index 478369b..f81e081 100644
@@ -341,8 +341,12 @@ snd_emux_control(void *p, int type, struct snd_midi_channel *chan)
 	case MIDI_CTL_SOFT_PEDAL:
 #ifdef SNDRV_EMUX_USE_RAW_EFFECT
 		/* FIXME: this is an emulation */
-		snd_emux_send_effect(port, chan, EMUX_FX_CUTOFF, -160,
+		if (chan->control[type])
+			snd_emux_send_effect(port, chan, EMUX_FX_CUTOFF, -160,
 				     EMUX_FX_FLAG_ADD);
+		else
+			snd_emux_send_effect(port, chan, EMUX_FX_CUTOFF, 0,
+				     EMUX_FX_FLAG_OFF);
 #endif
 		break;
 
Signature · 6 lines
1.5.5.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#1 lore raw

sound/synth/emux/emux_synth.c snd_emux_control(void *p, int type, struct snd_midi_channel *chan) · line 344

Quoted 5 lines · maximilian attems

The attached patch fixes this problem by analysing the value (0 or 127) of the midi control event and resetting the effect register in case of a release event.
...

sound/synth/emux/emux_synth.c +1 -0
+		if (chan->control[type])

Boolean MIDI controls should interpret 0..63 as false and 64..127 as true, i.e.:

+ if (chan->control[type] >= 64)

Regards,
Clemens