changeset 497:37f10f61433a prerelease

merge
author Giulio Moro <giuliomoro@yahoo.it>
date Tue, 21 Jun 2016 20:01:26 +0100
parents eb237b131ec7 (diff) 5779ed0562ac (current diff)
children c932df224fd3
files examples/10-Instruments/oscillator_bank/audio_routines.S examples/10-Instruments/oscillator_bank/main.cpp examples/10-Instruments/oscillator_bank/render.cpp examples/10-Instruments/tank_wars/game.cpp examples/10-Instruments/tank_wars/game.h examples/10-Instruments/tank_wars/main.cpp examples/10-Instruments/tank_wars/render.cpp examples/10-Instruments/tank_wars/vector_graphics.cpp examples/10-Instruments/tank_wars/vector_graphics.h
diffstat 2 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/core/default_libpd_render.cpp	Tue Jun 21 19:33:17 2016 +0100
+++ b/core/default_libpd_render.cpp	Tue Jun 21 20:01:26 2016 +0100
@@ -298,7 +298,7 @@
 			case kmmPitchBend:
 			{
 				int channel = message.getChannel();
-				int value =  (message.getDataByte(1) << 7)| message.getDataByte(0);
+				int value =  ((message.getDataByte(1) << 7)| message.getDataByte(0)) - 8192;
 				libpd_pitchbend(channel, value);
 				break;
 			}
--- a/scripts/hvresources/heavy_render.cpp	Tue Jun 21 19:33:17 2016 +0100
+++ b/scripts/hvresources/heavy_render.cpp	Tue Jun 21 20:01:26 2016 +0100
@@ -170,7 +170,7 @@
 	//[print pgmin_number]
 	hvMidiHashes[kmmProgramChange] = hv_stringToHash("__hv_pgmin");
 	hvMidiHashes[kmmPolyphonicKeyPressure] = hv_stringToHash("__hv_polytouchin");
-	hvMidiHashes[kmmChannelPressure] = hv_stringToHash("__hv_touch");
+	hvMidiHashes[kmmChannelPressure] = hv_stringToHash("__hv_touchin");
 	hvMidiHashes[kmmPitchBend] = hv_stringToHash("__hv_bendin");
 
 	gHeavyContext = hv_bela_new(context->audioSampleRate);
@@ -243,7 +243,7 @@
 				int channel = message.getChannel();
 				// rt_printf("message: noteNumber: %f, velocity: %f, channel: %f\n", noteNumber, velocity, channel);
 				hv_vscheduleMessageForReceiver(gHeavyContext, hvMidiHashes[kmmNoteOn], 0, "fff",
-						(float)noteNumber, (float)velocity, (float)channel);
+						(float)noteNumber, (float)velocity, (float)channel+1);
 				break;
 			}
 			case kmmNoteOff: {
@@ -256,7 +256,7 @@
 				int channel = message.getChannel();
 				// note we are sending the below to hvHashes[kmmNoteOn] !!
 				hv_vscheduleMessageForReceiver(gHeavyContext, hvMidiHashes[kmmNoteOn], 0, "fff",
-						(float)noteNumber, (float)0, (float)channel);
+						(float)noteNumber, (float)0, (float)channel+1);
 				break;
 			}
 			case kmmControlChange: {
@@ -264,33 +264,34 @@
 				int controller = message.getDataByte(0);
 				int value = message.getDataByte(1);
 				hv_vscheduleMessageForReceiver(gHeavyContext, hvMidiHashes[kmmControlChange], 0, "fff",
-						(float)value, (float)controller, (float)channel);
+						(float)value, (float)controller, (float)channel+1);
 				break;
 			}
 			case kmmProgramChange: {
+				message.prettyPrint();
 				int channel = message.getChannel();
 				int program = message.getDataByte(0);
 				hv_vscheduleMessageForReceiver(gHeavyContext, hvMidiHashes[kmmProgramChange], 0, "ff",
-						(float)program, (float)channel);
+						(float)program, (float)channel+1);
 				break;
 			}
 			case kmmPolyphonicKeyPressure: {
+				message.prettyPrint();
+
 				//TODO: untested, I do not have anything with polyTouch... who does, anyhow?
 				int channel = message.getChannel();
 				int pitch = message.getDataByte(0);
 				int value = message.getDataByte(1);
 				hv_vscheduleMessageForReceiver(gHeavyContext, hvMidiHashes[kmmPolyphonicKeyPressure], 0, "fff",
-						(float)channel, (float)pitch, (float)value);
+						(float)channel+1, (float)pitch, (float)value);
 				break;
 			}
 			case kmmChannelPressure:
 			{
-				//TODO: untested, I do not have anything with aftertouch...
 				int channel = message.getChannel();
 				int value = message.getDataByte(0);
-				//TODO: maybe the order of the arguments is wrong here?
 				hv_vscheduleMessageForReceiver(gHeavyContext, hvMidiHashes[kmmChannelPressure], 0, "ff",
-						(float)channel, (float)value);
+						(float)value, (float)channel+1);
 				break;
 			}
 			case kmmPitchBend:
@@ -298,7 +299,7 @@
 				int channel = message.getChannel();
 				int value = ((message.getDataByte(1) << 7) | message.getDataByte(0)) - 8192;
 				hv_vscheduleMessageForReceiver(gHeavyContext, hvMidiHashes[kmmPitchBend], 0, "ff",
-						(float)channel, (float)value);
+						(float)channel+1, (float)value);
 				break;
 			}
 			case kmmNone: