Date: Sun, 27 Jul 2003 22:20:53 +0200
authorSam Lantinga <slouken@libsdl.org>
Mon, 28 Jul 2003 01:44:32 +0000
changeset 230f5dd25f46308
parent 229 7c48adfa648e
child 231 f046944f2edf
Date: Sun, 27 Jul 2003 22:20:53 +0200
From: Max Horn
Subject: small SDL_mixer fix

the attached patch for SDL_mixer fixes the handling of pan events in
the native Mac OS midi driver.
native_midi/native_midi_mac.c
     1.1 --- a/native_midi/native_midi_mac.c	Wed Jul 23 05:16:35 2003 +0000
     1.2 +++ b/native_midi/native_midi_mac.c	Mon Jul 28 01:44:32 2003 +0000
     1.3 @@ -406,7 +406,7 @@
     1.4  					int duration = (int)((noteOffPos->time - eventPos->time)*tick);
     1.5  					
     1.6  					REST_IF_NECESSARY();
     1.7 -					/* Now we need to check if we get along with a normal Note Even, or if we need an extended one... */
     1.8 +					/* Now we need to check if we get along with a normal Note Event, or if we need an extended one... */
     1.9  					if (duration < 2048 && pitch>=32 && pitch<=95 && velocity>=0 && velocity<=127)
    1.10  					{
    1.11  						qtma_StuffNoteEvent(*tunePos, part, pitch, velocity, duration);
    1.12 @@ -421,7 +421,7 @@
    1.13  			}
    1.14  			break;
    1.15  		case MIDI_STATUS_AFTERTOUCH:
    1.16 -			/* NYI */
    1.17 +			/* NYI - use kControllerAfterTouch. But how are the parameters to be mapped? */
    1.18  			break;
    1.19  		case MIDI_STATUS_CONTROLLER:
    1.20  			controller = eventPos->data[0];
    1.21 @@ -444,9 +444,9 @@
    1.22  				}
    1.23  				break;
    1.24  			case kControllerPan:
    1.25 -				if(channel_pan[channel] != ((value-64)<<8))
    1.26 +				if(channel_pan[channel] != (value << 1) + 256)
    1.27  				{
    1.28 -					channel_pan[channel] = (value-64)<<8;
    1.29 +					channel_pan[channel] = (value << 1) + 256;
    1.30  					if(part>=0 && part<=31)
    1.31  					{
    1.32  						REST_IF_NECESSARY();