/[svn]/linuxsampler/trunk/src/engines/gig/Voice.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/gig/Voice.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1895 by persson, Sun May 3 12:15:40 2009 UTC revision 2012 by iliev, Fri Oct 23 17:53:17 2009 UTC
# Line 24  Line 24 
24  #include "../../common/Features.h"  #include "../../common/Features.h"
25  #include "Synthesizer.h"  #include "Synthesizer.h"
26  #include "Profiler.h"  #include "Profiler.h"
27    #include "Engine.h"
28    #include "EngineChannel.h"
29    
30  #include "Voice.h"  #include "Voice.h"
31    
# Line 56  namespace LinuxSampler { namespace gig { Line 58  namespace LinuxSampler { namespace gig {
58          if (pLFO3) delete pLFO3;          if (pLFO3) delete pLFO3;
59      }      }
60    
61      void Voice::SetEngine(Engine* pEngine) {      void Voice::SetEngine(LinuxSampler::Engine* pEngine) {
62          this->pEngine     = pEngine;          Engine* engine = static_cast<Engine*>(pEngine);
63          this->pDiskThread = pEngine->pDiskThread;          this->pEngine     = engine;
64            this->pDiskThread = engine->pDiskThread;
65          dmsg(6,("Voice::SetEngine()\n"));          dmsg(6,("Voice::SetEngine()\n"));
66      }      }
67    
# Line 200  namespace LinuxSampler { namespace gig { Line 203  namespace LinuxSampler { namespace gig {
203              if (pDimRgn->PitchTrack && (MIDIKey - (int) pDimRgn->UnityNote) < 40) pitchbasecents += (MIDIKey - (int) pDimRgn->UnityNote) * 100;              if (pDimRgn->PitchTrack && (MIDIKey - (int) pDimRgn->UnityNote) < 40) pitchbasecents += (MIDIKey - (int) pDimRgn->UnityNote) * 100;
204    
205              this->PitchBase = RTMath::CentsToFreqRatioUnlimited(pitchbasecents) * (double(pSample->SamplesPerSecond) / double(pEngine->SampleRate));              this->PitchBase = RTMath::CentsToFreqRatioUnlimited(pitchbasecents) * (double(pSample->SamplesPerSecond) / double(pEngine->SampleRate));
206              this->PitchBend = RTMath::CentsToFreqRatio(PitchBend / 8192.0 * 100.0 * pEngineChannel->pInstrument->PitchbendRange);              this->PitchBendRange = 1.0 / 8192.0 * 100.0 * pEngineChannel->pInstrument->PitchbendRange;
207                this->PitchBend = RTMath::CentsToFreqRatio(PitchBend * PitchBendRange);
208          }          }
209    
210          // the length of the decay and release curves are dependent on the velocity          // the length of the decay and release curves are dependent on the velocity
# Line 746  namespace LinuxSampler { namespace gig { Line 750  namespace LinuxSampler { namespace gig {
750      }      }
751    
752      void Voice::processPitchEvent(RTList<Event>::Iterator& itEvent) {      void Voice::processPitchEvent(RTList<Event>::Iterator& itEvent) {
753          PitchBend = RTMath::CentsToFreqRatio(itEvent->Param.Pitch.Pitch / 8192.0 * 100.0 * pEngineChannel->pInstrument->PitchbendRange);          PitchBend = RTMath::CentsToFreqRatio(itEvent->Param.Pitch.Pitch * PitchBendRange);
754      }      }
755    
756      void Voice::processCutoffEvent(RTList<Event>::Iterator& itEvent) {      void Voice::processCutoffEvent(RTList<Event>::Iterator& itEvent) {

Legend:
Removed from v.1895  
changed lines
  Added in v.2012

  ViewVC Help
Powered by ViewVC