# HG changeset patch # User Giulio Moro # Date 1466523890 -3600 # Node ID 45dee9066d43df775ace8301a59124bf1068db52 # Parent 441c8429f27cfa1edad5995895fb2aedc44161ff Better heavy: fixed MIDI ctlin range, commented out unused variables diff -r 441c8429f27c -r 45dee9066d43 scripts/hvresources/heavy_render.cpp --- a/scripts/hvresources/heavy_render.cpp Tue Jun 21 16:32:12 2016 +0100 +++ b/scripts/hvresources/heavy_render.cpp Tue Jun 21 16:44:50 2016 +0100 @@ -134,11 +134,13 @@ * SETUP, RENDER LOOP & CLEANUP */ +// leaving this here, trying to come up with a coherent interface with libpd. +// commenting them out so the compiler does not warn // 2 audio + (up to)8 analog + (up to) 16 digital + 4 scope outputs -static const unsigned int gChannelsInUse = 30; -static unsigned int gAnalogChannelsInUse = 8; // hard-coded for the moment, TODO: get it at run-time from hv_context +//static const unsigned int gChannelsInUse = 30; +//static unsigned int gAnalogChannelsInUse = 8; // hard-coded for the moment, TODO: get it at run-time from hv_context //static const unsigned int gFirstAudioChannel = 0; -static const unsigned int gFirstAnalogChannel = 2; +//static const unsigned int gFirstAnalogChannel = 2; static const unsigned int gFirstDigitalChannel = 10; static const unsigned int gFirstScopeChannel = 26; static unsigned int gDigitalSigInChannelsInUse; @@ -258,7 +260,6 @@ break; } case kmmControlChange: { - message.prettyPrint(); int channel = message.getChannel(); int controller = message.getDataByte(0); int value = message.getDataByte(1); @@ -294,10 +295,8 @@ } case kmmPitchBend: { - //TODO: untested, I do not have anything with bend at the moment... - //TODO: check for both argument order and if the value range is correct? int channel = message.getChannel(); - int value = ((message.getDataByte(1) << 7) | message.getDataByte(0)) + 8192; + int value = ((message.getDataByte(1) << 7) | message.getDataByte(0)) - 8192; hv_vscheduleMessageForReceiver(gHeavyContext, hvMidiHashes[kmmPitchBend], 0, "ff", (float)channel, (float)value); break; @@ -394,7 +393,6 @@ unsigned int j, k; float *p0, *p1; const unsigned int gLibpdBlockSize = context->audioFrames; - const unsigned int audioFrameBase = 0; float* gOutBuf = gHvOutputBuffers; // block below copy/pasted from libpd