From 47d8323deb8c7351c66a89599f15b60e06a5b814 Mon Sep 17 00:00:00 2001 From: Stepan Moskovchenko Date: Sun, 21 Oct 2007 19:47:33 +0000 Subject: MIDI: Fix ringing/beeks in music caused by improper parsing of some pitch bend events. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15252 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/midi/sequencer.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'apps/plugins/midi/sequencer.c') diff --git a/apps/plugins/midi/sequencer.c b/apps/plugins/midi/sequencer.c index 536d411902..c4ddfcf95a 100644 --- a/apps/plugins/midi/sequencer.c +++ b/apps/plugins/midi/sequencer.c @@ -299,10 +299,39 @@ static void sendEvent(struct Event * ev) chPan[status_low]=d2; return; } - case CTRL_PWDEPTH: + case CTRL_DATAENT_MSB: { /* TODO: Update all deltas. Is this really needed? */ - chPBDepth[status_low] = d2; + if(chLastCtrlMSB[status_low] == REG_PITCHBEND_MSB && + chLastCtrlLSB[status_low] == REG_PITCHBEND_LSB) + { +// printf("Pitch bend depth set to %d\n", d2); + chPBDepth[status_low] = d2; + } + return; + } + + case CTRL_NONREG_LSB: + { + chLastCtrlLSB[status_low] = 0xFF; /* Ignore nonregistered writes */ + return; + } + + case CTRL_NONREG_MSB: + { + chLastCtrlMSB[status_low] = 0xFF; /* Ignore nonregistered writes */ + return; + } + + case CTRL_REG_LSB: + { + chLastCtrlLSB[status_low] = d2; + return; + } + + case CTRL_REG_MSB: + { + chLastCtrlMSB[status_low] = d2; return; } -- cgit v1.2.3