--- linuxsampler/trunk/src/engines/gig/Voice.cpp 2014/05/18 17:38:25 2559 +++ linuxsampler/trunk/src/engines/gig/Voice.cpp 2016/12/15 12:47:45 3054 @@ -4,7 +4,8 @@ * * * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * * Copyright (C) 2005 - 2008 Christian Schoenebeck * - * Copyright (C) 2009 - 2013 Christian Schoenebeck and Grigor Iliev * + * Copyright (C) 2009 Christian Schoenebeck and Grigor Iliev * + * Copyright (C) 2010 - 2016 Christian Schoenebeck and Andreas Persson * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -58,7 +59,7 @@ si.ChannelCount = pSample->Channels; si.FrameSize = pSample->FrameSize; si.BitDepth = pSample->BitDepth; - si.TotalFrameCount = pSample->SamplesTotal; + si.TotalFrameCount = (uint)pSample->SamplesTotal; si.HasLoops = pRegion->SampleLoops; si.LoopStart = (si.HasLoops) ? pRegion->pSampleLoops[0].LoopStart : 0; @@ -341,7 +342,7 @@ break; case ::gig::lfo3_ctrl_aftertouch: lfo3_internal_depth = 0; - pLFO3->ExtController = 128; + pLFO3->ExtController = CTRL_TABLE_IDX_AFTERTOUCH; bLFO3Enabled = true; break; case ::gig::lfo3_ctrl_internal_modwheel: @@ -351,7 +352,7 @@ break; case ::gig::lfo3_ctrl_internal_aftertouch: lfo3_internal_depth = pRegion->LFO3InternalDepth; - pLFO3->ExtController = 128; + pLFO3->ExtController = CTRL_TABLE_IDX_AFTERTOUCH; bLFO3Enabled = (lfo3_internal_depth > 0 || pRegion->LFO3ControlDepth > 0); break; default: @@ -373,7 +374,7 @@ float Voice::CalculateCutoffBase(uint8_t MIDIKeyVelocity) { float cutoff = pRegion->GetVelocityCutoff(MIDIKeyVelocity); if (pRegion->VCFKeyboardTracking) { - cutoff *= RTMath::CentsToFreqRatioUnlimited((MIDIKey - pRegion->VCFKeyboardTrackingBreakpoint) * 100); + cutoff *= RTMath::CentsToFreqRatioUnlimited((MIDIKey() - pRegion->VCFKeyboardTrackingBreakpoint) * 100); } return cutoff; } @@ -426,7 +427,7 @@ ctrl = 83; break; case ::gig::vcf_cutoff_ctrl_aftertouch: - ctrl = 128; + ctrl = CTRL_TABLE_IDX_AFTERTOUCH; break; case ::gig::vcf_cutoff_ctrl_none: default: @@ -487,7 +488,7 @@ } void Voice::ProcessGroupEvent(RTList::Iterator& itEvent) { - dmsg(4,("Voice %x processGroupEvents event type=%d", this, itEvent->Type)); + dmsg(4,("Voice %p processGroupEvents event type=%d", (void*)this, itEvent->Type)); // TODO: The SustainPedal condition could be wrong, maybe the // check should be if this Voice is in release stage or is a @@ -498,9 +499,9 @@ // note should be stopped at all, because it doesn't sound naturally // with a drumkit. // -- Christian, 2013-01-08 - if (itEvent->Param.Note.Key != MIDIKey /*|| + if (itEvent->Param.Note.Key != HostKey() /*|| !GetGigEngineChannel()->SustainPedal*/) { - dmsg(4,("Voice %x - kill", this)); + dmsg(4,("Voice %p - kill", (void*)this)); // kill the voice fast pEG1->enterFadeOutStage();