/[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 563 by schoenebeck, Sun May 22 20:43:32 2005 UTC revision 614 by persson, Mon Jun 6 16:54:20 2005 UTC
# Line 333  namespace LinuxSampler { namespace gig { Line 333  namespace LinuxSampler { namespace gig {
333              this->PitchBend = RTMath::CentsToFreqRatio(((double) PitchBend / 8192.0) * 200.0); // pitchbend wheel +-2 semitones = 200 cents              this->PitchBend = RTMath::CentsToFreqRatio(((double) PitchBend / 8192.0) * 200.0); // pitchbend wheel +-2 semitones = 200 cents
334          }          }
335    
336          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)          const double velocityAttenuation = pDimRgn->GetVelocityAttenuation(itNoteOnEvent->Param.Note.Velocity);
337    
338            Volume = velocityAttenuation / 32768.0f; // we downscale by 32768 to convert from int16 value range to DSP value range (which is -1.0..1.0)
339    
340          Volume *= pDimRgn->SampleAttenuation;          Volume *= pDimRgn->SampleAttenuation;
341    
342            // the length of the decay and release curves are dependent on the velocity
343            const double velrelease = 1 / pDimRgn->GetVelocityRelease(itNoteOnEvent->Param.Note.Velocity);
344    
345          // setup EG 1 (VCA EG)          // setup EG 1 (VCA EG)
346          {          {
347              // get current value of EG1 controller              // get current value of EG1 controller
# Line 366  namespace LinuxSampler { namespace gig { Line 371  namespace LinuxSampler { namespace gig {
371                            pDimRgn->EG1Attack + eg1attack,                            pDimRgn->EG1Attack + eg1attack,
372                            pDimRgn->EG1Hold,                            pDimRgn->EG1Hold,
373                            pSample->LoopStart,                            pSample->LoopStart,
374                            pDimRgn->EG1Decay1 + eg1decay,                            (pDimRgn->EG1Decay1 + eg1decay) * velrelease,
375                            pDimRgn->EG1Decay2 + eg1decay,                            (pDimRgn->EG1Decay2 + eg1decay) * velrelease,
376                            pDimRgn->EG1InfiniteSustain,                            pDimRgn->EG1InfiniteSustain,
377                            pDimRgn->EG1Sustain,                            pDimRgn->EG1Sustain,
378                            pDimRgn->EG1Release + eg1release,                            (pDimRgn->EG1Release + eg1release) * velrelease,
379                            // the SSE synthesis implementation requires                            // the SSE synthesis implementation requires
380                            // the vca start to be 16 byte aligned                            // the vca start to be 16 byte aligned
381                            SYNTHESIS_MODE_GET_IMPLEMENTATION(SynthesisMode) ?                            SYNTHESIS_MODE_GET_IMPLEMENTATION(SynthesisMode) ?
382                            Delay & 0xfffffffc : Delay);                            Delay & 0xfffffffc : Delay,
383                              velocityAttenuation);
384          }          }
385    
386    
# Line 407  namespace LinuxSampler { namespace gig { Line 413  namespace LinuxSampler { namespace gig {
413                            pDimRgn->EG2Attack + eg2attack,                            pDimRgn->EG2Attack + eg2attack,
414                            false,                            false,
415                            pSample->LoopStart,                            pSample->LoopStart,
416                            pDimRgn->EG2Decay1 + eg2decay,                            (pDimRgn->EG2Decay1 + eg2decay) * velrelease,
417                            pDimRgn->EG2Decay2 + eg2decay,                            (pDimRgn->EG2Decay2 + eg2decay) * velrelease,
418                            pDimRgn->EG2InfiniteSustain,                            pDimRgn->EG2InfiniteSustain,
419                            pDimRgn->EG2Sustain,                            pDimRgn->EG2Sustain,
420                            pDimRgn->EG2Release + eg2release,                            (pDimRgn->EG2Release + eg2release) * velrelease,
421                            Delay);                            Delay,
422                              velocityAttenuation);
423          }          }
424    
425    

Legend:
Removed from v.563  
changed lines
  Added in v.614

  ViewVC Help
Powered by ViewVC