/[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 354 by schoenebeck, Sat Jan 29 15:17:59 2005 UTC revision 407 by persson, Wed Feb 23 19:14:14 2005 UTC
# Line 58  namespace LinuxSampler { namespace gig { Line 58  namespace LinuxSampler { namespace gig {
58          pLFO2  = NULL;          pLFO2  = NULL;
59          pLFO3  = NULL;          pLFO3  = NULL;
60          KeyGroup = 0;          KeyGroup = 0;
61          SynthesisMode = 0; //Set all mode bits to 0 first          SynthesisMode = 0; // set all mode bits to 0 first
   
62          // select synthesis implementation (currently either pure C++ or MMX+SSE(1))          // select synthesis implementation (currently either pure C++ or MMX+SSE(1))
63            #if ARCH_X86
64          SYNTHESIS_MODE_SET_IMPLEMENTATION(SynthesisMode, Features::supportsMMX() && Features::supportsSSE());          SYNTHESIS_MODE_SET_IMPLEMENTATION(SynthesisMode, Features::supportsMMX() && Features::supportsSSE());
65            #else
66            SYNTHESIS_MODE_SET_IMPLEMENTATION(SynthesisMode, false);
67            #endif
68          SYNTHESIS_MODE_SET_PROFILING(SynthesisMode, true);          SYNTHESIS_MODE_SET_PROFILING(SynthesisMode, true);
69    
70            FilterLeft.Reset();
71            FilterRight.Reset();
72      }      }
73    
74      Voice::~Voice() {      Voice::~Voice() {
# Line 320  namespace LinuxSampler { namespace gig { Line 326  namespace LinuxSampler { namespace gig {
326    
327          Volume = pDimRgn->GetVelocityAttenuation(itNoteOnEvent->Param.Note.Velocity) / 32768.0f; // we downscale by 32768 to convert from int16 value range to DSP value range (which is -1.0..1.0)          Volume = pDimRgn->GetVelocityAttenuation(itNoteOnEvent->Param.Note.Velocity) / 32768.0f; // we downscale by 32768 to convert from int16 value range to DSP value range (which is -1.0..1.0)
328    
329            Volume *= pDimRgn->SampleAttenuation;
330    
331          // setup EG 1 (VCA EG)          // setup EG 1 (VCA EG)
332          {          {
333              // get current value of EG1 controller              // get current value of EG1 controller
# Line 518  namespace LinuxSampler { namespace gig { Line 526  namespace LinuxSampler { namespace gig {
526    
527    
528          #if FORCE_FILTER_USAGE          #if FORCE_FILTER_USAGE
529          SYNTHESIS_MODE_SET_FILTER(SynthesisMode, true);          const bool bUseFilter = true;
530          #else // use filter only if instrument file told so          #else // use filter only if instrument file told so
531          SYNTHESIS_MODE_SET_FILTER(SynthesisMode, pDimRgn->VCFEnabled);          const bool bUseFilter = pDimRgn->VCFEnabled;
532          #endif // FORCE_FILTER_USAGE          #endif // FORCE_FILTER_USAGE
533          if (pDimRgn->VCFEnabled) {          SYNTHESIS_MODE_SET_FILTER(SynthesisMode, bUseFilter);
534            if (bUseFilter) {
535              #ifdef OVERRIDE_FILTER_CUTOFF_CTRL              #ifdef OVERRIDE_FILTER_CUTOFF_CTRL
536              VCFCutoffCtrl.controller = OVERRIDE_FILTER_CUTOFF_CTRL;              VCFCutoffCtrl.controller = OVERRIDE_FILTER_CUTOFF_CTRL;
537              #else // use the one defined in the instrument file              #else // use the one defined in the instrument file
# Line 944  namespace LinuxSampler { namespace gig { Line 953  namespace LinuxSampler { namespace gig {
953          biquad_param_t bqmain;          biquad_param_t bqmain;
954          float prev_cutoff = pEngine->pSynthesisParameters[Event::destination_vcfc][0];          float prev_cutoff = pEngine->pSynthesisParameters[Event::destination_vcfc][0];
955          float prev_res    = pEngine->pSynthesisParameters[Event::destination_vcfr][0];          float prev_res    = pEngine->pSynthesisParameters[Event::destination_vcfr][0];
956          FilterLeft.SetParameters(&bqbase, &bqmain, prev_cutoff, prev_res, pEngine->SampleRate);          FilterLeft.SetParameters( &bqbase, &bqmain, prev_cutoff + FILTER_CUTOFF_MIN, prev_res, pEngine->SampleRate);
957          FilterRight.SetParameters(&bqbase, &bqmain, prev_cutoff, prev_res, pEngine->SampleRate);          FilterRight.SetParameters(&bqbase, &bqmain, prev_cutoff + FILTER_CUTOFF_MIN, prev_res, pEngine->SampleRate);
958          pEngine->pBasicFilterParameters[0] = bqbase;          pEngine->pBasicFilterParameters[0] = bqbase;
959          pEngine->pMainFilterParameters[0]  = bqmain;          pEngine->pMainFilterParameters[0]  = bqmain;
960    
# Line 958  namespace LinuxSampler { namespace gig { Line 967  namespace LinuxSampler { namespace gig {
967                  {                  {
968                      prev_cutoff = pEngine->pSynthesisParameters[Event::destination_vcfc][i];                      prev_cutoff = pEngine->pSynthesisParameters[Event::destination_vcfc][i];
969                      prev_res    = pEngine->pSynthesisParameters[Event::destination_vcfr][i];                      prev_res    = pEngine->pSynthesisParameters[Event::destination_vcfr][i];
970                      FilterLeft.SetParameters(&bqbase, &bqmain, prev_cutoff, prev_res, pEngine->SampleRate);                      FilterLeft.SetParameters( &bqbase, &bqmain, prev_cutoff + FILTER_CUTOFF_MIN, prev_res, pEngine->SampleRate);
971                      FilterRight.SetParameters(&bqbase, &bqmain, prev_cutoff, prev_res, pEngine->SampleRate);                      FilterRight.SetParameters(&bqbase, &bqmain, prev_cutoff + FILTER_CUTOFF_MIN, prev_res, pEngine->SampleRate);
972                  }                  }
973              }              }
974    

Legend:
Removed from v.354  
changed lines
  Added in v.407

  ViewVC Help
Powered by ViewVC