/[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 244 by schoenebeck, Fri Sep 17 01:01:11 2004 UTC revision 247 by senkov, Sun Sep 19 23:44:23 2004 UTC
# Line 118  namespace LinuxSampler { namespace gig { Line 118  namespace LinuxSampler { namespace gig {
118    
119          Type            = type_normal;          Type            = type_normal;
120          Active          = true;          Active          = true;
121          MIDIKey         = pNoteOnEvent->Key;          MIDIKey         = pNoteOnEvent->Param.Note.Key;
122          pRegion         = pInstrument->GetRegion(MIDIKey);          pRegion         = pInstrument->GetRegion(MIDIKey);
123          PlaybackState   = playback_state_ram; // we always start playback from RAM cache and switch then to disk if needed          PlaybackState   = playback_state_ram; // we always start playback from RAM cache and switch then to disk if needed
124          Delay           = pNoteOnEvent->FragmentPos();          Delay           = pNoteOnEvent->FragmentPos();
# Line 149  namespace LinuxSampler { namespace gig { Line 149  namespace LinuxSampler { namespace gig {
149                              pEngine->LaunchVoice(pNoteOnEvent, iNewLayer, ReleaseTriggerVoice);                              pEngine->LaunchVoice(pNoteOnEvent, iNewLayer, ReleaseTriggerVoice);
150                      break;                      break;
151                  case ::gig::dimension_velocity:                  case ::gig::dimension_velocity:
152                      DimValues[i] = pNoteOnEvent->Velocity;                      DimValues[i] = pNoteOnEvent->Param.Note.Velocity;
153                      break;                      break;
154                  case ::gig::dimension_channelaftertouch:                  case ::gig::dimension_channelaftertouch:
155                      DimValues[i] = 0; //TODO: we currently ignore this dimension                      DimValues[i] = 0; //TODO: we currently ignore this dimension
# Line 159  namespace LinuxSampler { namespace gig { Line 159  namespace LinuxSampler { namespace gig {
159                      DimValues[i] = (uint) ReleaseTriggerVoice;                      DimValues[i] = (uint) ReleaseTriggerVoice;
160                      break;                      break;
161                  case ::gig::dimension_keyboard:                  case ::gig::dimension_keyboard:
162                      DimValues[i] = (uint) pNoteOnEvent->Key;                      DimValues[i] = (uint) pNoteOnEvent->Param.Note.Key;
163                      break;                      break;
164                  case ::gig::dimension_modwheel:                  case ::gig::dimension_modwheel:
165                      DimValues[i] = pEngine->ControllerTable[1];                      DimValues[i] = pEngine->ControllerTable[1];
# Line 245  namespace LinuxSampler { namespace gig { Line 245  namespace LinuxSampler { namespace gig {
245                  CrossfadeVolume = 1.0f; //TODO: aftertouch not supported yet                  CrossfadeVolume = 1.0f; //TODO: aftertouch not supported yet
246                  break;                  break;
247              case ::gig::attenuation_ctrl_t::type_velocity:              case ::gig::attenuation_ctrl_t::type_velocity:
248                  CrossfadeVolume = CrossfadeAttenuation(pNoteOnEvent->Velocity);                  CrossfadeVolume = CrossfadeAttenuation(pNoteOnEvent->Param.Note.Velocity);
249                  break;                  break;
250              case ::gig::attenuation_ctrl_t::type_controlchange: //FIXME: currently not sample accurate              case ::gig::attenuation_ctrl_t::type_controlchange: //FIXME: currently not sample accurate
251                  CrossfadeVolume = CrossfadeAttenuation(pEngine->ControllerTable[pDimRgn->AttenuationController.controller_number]);                  CrossfadeVolume = CrossfadeAttenuation(pEngine->ControllerTable[pDimRgn->AttenuationController.controller_number]);
# Line 255  namespace LinuxSampler { namespace gig { Line 255  namespace LinuxSampler { namespace gig {
255                  CrossfadeVolume = 1.0f;                  CrossfadeVolume = 1.0f;
256          }          }
257    
258            const float fpan = float(RTMath::Max(RTMath::Min(pDimRgn->Pan, 63), -64)) / 64.0f;
259            PanLeft  = 1.0f - fpan;
260            PanRight = 1.0f + fpan;
261    
262          pSample = pDimRgn->pSample; // sample won't change until the voice is finished          pSample = pDimRgn->pSample; // sample won't change until the voice is finished
263    
264          Pos = pDimRgn->SampleStartOffset; // offset where we should start playback of sample (0 - 2000 sample points)          Pos = pDimRgn->SampleStartOffset; // offset where we should start playback of sample (0 - 2000 sample points)
# Line 300  namespace LinuxSampler { namespace gig { Line 304  namespace LinuxSampler { namespace gig {
304          }          }
305    
306    
307          Volume = pDimRgn->GetVelocityAttenuation(pNoteOnEvent->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(pNoteOnEvent->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)
308    
309    
310          // setup EG 1 (VCA EG)          // setup EG 1 (VCA EG)
# Line 315  namespace LinuxSampler { namespace gig { Line 319  namespace LinuxSampler { namespace gig {
319                      eg1controllervalue = 0; // TODO: aftertouch not yet supported                      eg1controllervalue = 0; // TODO: aftertouch not yet supported
320                      break;                      break;
321                  case ::gig::eg1_ctrl_t::type_velocity:                  case ::gig::eg1_ctrl_t::type_velocity:
322                      eg1controllervalue = pNoteOnEvent->Velocity;                      eg1controllervalue = pNoteOnEvent->Param.Note.Velocity;
323                      break;                      break;
324                  case ::gig::eg1_ctrl_t::type_controlchange: // MIDI control change controller                  case ::gig::eg1_ctrl_t::type_controlchange: // MIDI control change controller
325                      eg1controllervalue = pEngine->ControllerTable[pDimRgn->EG1Controller.controller_number];                      eg1controllervalue = pEngine->ControllerTable[pDimRgn->EG1Controller.controller_number];
# Line 354  namespace LinuxSampler { namespace gig { Line 358  namespace LinuxSampler { namespace gig {
358                      eg2controllervalue = 0; // TODO: aftertouch not yet supported                      eg2controllervalue = 0; // TODO: aftertouch not yet supported
359                      break;                      break;
360                  case ::gig::eg2_ctrl_t::type_velocity:                  case ::gig::eg2_ctrl_t::type_velocity:
361                      eg2controllervalue = pNoteOnEvent->Velocity;                      eg2controllervalue = pNoteOnEvent->Param.Note.Velocity;
362                      break;                      break;
363                  case ::gig::eg2_ctrl_t::type_controlchange: // MIDI control change controller                  case ::gig::eg2_ctrl_t::type_controlchange: // MIDI control change controller
364                      eg2controllervalue = pEngine->ControllerTable[pDimRgn->EG2Controller.controller_number];                      eg2controllervalue = pEngine->ControllerTable[pDimRgn->EG2Controller.controller_number];
# Line 582  namespace LinuxSampler { namespace gig { Line 586  namespace LinuxSampler { namespace gig {
586    
587              // calculate cutoff frequency              // calculate cutoff frequency
588              float cutoff = (!VCFCutoffCtrl.controller)              float cutoff = (!VCFCutoffCtrl.controller)
589                  ? exp((float) (127 - pNoteOnEvent->Velocity) * (float) pDimRgn->VCFVelocityScale * 6.2E-5f * FILTER_CUTOFF_COEFF) * FILTER_CUTOFF_MAX                  ? exp((float) (127 - pNoteOnEvent->Param.Note.Velocity) * (float) pDimRgn->VCFVelocityScale * 6.2E-5f * FILTER_CUTOFF_COEFF) * FILTER_CUTOFF_MAX
590                  : exp((float) VCFCutoffCtrl.value * 0.00787402f * FILTER_CUTOFF_COEFF) * FILTER_CUTOFF_MAX;                  : exp((float) VCFCutoffCtrl.value * 0.00787402f * FILTER_CUTOFF_COEFF) * FILTER_CUTOFF_MAX;
591    
592              // calculate resonance              // calculate resonance
593              float resonance = (float) VCFResonanceCtrl.value * 0.00787f;   // 0.0..1.0              float resonance = (float) VCFResonanceCtrl.value * 0.00787f;   // 0.0..1.0
594              if (pDimRgn->VCFKeyboardTracking) {              if (pDimRgn->VCFKeyboardTracking) {
595                  resonance += (float) (pNoteOnEvent->Key - pDimRgn->VCFKeyboardTrackingBreakpoint) * 0.00787f;                  resonance += (float) (pNoteOnEvent->Param.Note.Key - pDimRgn->VCFKeyboardTrackingBreakpoint) * 0.00787f;
596              }              }
597              Constrain(resonance, 0.0, 1.0); // correct resonance if outside allowed value range (0.0..1.0)              Constrain(resonance, 0.0, 1.0); // correct resonance if outside allowed value range (0.0..1.0)
598    
# Line 657  namespace LinuxSampler { namespace gig { Line 661  namespace LinuxSampler { namespace gig {
661    
662              case playback_state_ram: {              case playback_state_ram: {
663                      if (RAMLoop) InterpolateAndLoop(Samples, (sample_t*) pSample->GetCache().pStart, Delay);                      if (RAMLoop) InterpolateAndLoop(Samples, (sample_t*) pSample->GetCache().pStart, Delay);
664                      else         Interpolate(Samples, (sample_t*) pSample->GetCache().pStart, Delay);                      else         InterpolateNoLoop(Samples, (sample_t*) pSample->GetCache().pStart, Delay);
665                      if (DiskVoice) {                      if (DiskVoice) {
666                          // check if we reached the allowed limit of the sample RAM cache                          // check if we reached the allowed limit of the sample RAM cache
667                          if (Pos > MaxRAMPos) {                          if (Pos > MaxRAMPos) {
# Line 691  namespace LinuxSampler { namespace gig { Line 695  namespace LinuxSampler { namespace gig {
695                      }                      }
696    
697                      sample_t* ptr = DiskStreamRef.pStream->GetReadPtr(); // get the current read_ptr within the ringbuffer where we read the samples from                      sample_t* ptr = DiskStreamRef.pStream->GetReadPtr(); // get the current read_ptr within the ringbuffer where we read the samples from
698                      Interpolate(Samples, ptr, Delay);                      InterpolateNoLoop(Samples, ptr, Delay);
699                      DiskStreamRef.pStream->IncrementReadPos(RTMath::DoubleToInt(Pos) * pSample->Channels);                      DiskStreamRef.pStream->IncrementReadPos(RTMath::DoubleToInt(Pos) * pSample->Channels);
700                      Pos -= RTMath::DoubleToInt(Pos);                      Pos -= RTMath::DoubleToInt(Pos);
701                  }                  }
# Line 749  namespace LinuxSampler { namespace gig { Line 753  namespace LinuxSampler { namespace gig {
753              while (pCCEvent && pCCEvent->FragmentPos() <= Delay) pCCEvent = pEngine->pCCEvents->next();              while (pCCEvent && pCCEvent->FragmentPos() <= Delay) pCCEvent = pEngine->pCCEvents->next();
754          }          }
755          while (pCCEvent) {          while (pCCEvent) {
756              if (pCCEvent->Controller) { // if valid MIDI controller              if (pCCEvent->Param.CC.Controller) { // if valid MIDI controller
757                  #if ENABLE_FILTER                  #if ENABLE_FILTER
758                  if (pCCEvent->Controller == VCFCutoffCtrl.controller) {                  if (pCCEvent->Param.CC.Controller == VCFCutoffCtrl.controller) {
759                      pEngine->pSynthesisEvents[Event::destination_vcfc]->alloc_assign(*pCCEvent);                      pEngine->pSynthesisEvents[Event::destination_vcfc]->alloc_assign(*pCCEvent);
760                  }                  }
761                  if (pCCEvent->Controller == VCFResonanceCtrl.controller) {                  if (pCCEvent->Param.CC.Controller == VCFResonanceCtrl.controller) {
762                      pEngine->pSynthesisEvents[Event::destination_vcfr]->alloc_assign(*pCCEvent);                      pEngine->pSynthesisEvents[Event::destination_vcfr]->alloc_assign(*pCCEvent);
763                  }                  }
764                  #endif // ENABLE_FILTER                  #endif // ENABLE_FILTER
765                  if (pCCEvent->Controller == pLFO1->ExtController) {                  if (pCCEvent->Param.CC.Controller == pLFO1->ExtController) {
766                      pLFO1->SendEvent(pCCEvent);                      pLFO1->SendEvent(pCCEvent);
767                  }                  }
768                  #if ENABLE_FILTER                  #if ENABLE_FILTER
769                  if (pCCEvent->Controller == pLFO2->ExtController) {                  if (pCCEvent->Param.CC.Controller == pLFO2->ExtController) {
770                      pLFO2->SendEvent(pCCEvent);                      pLFO2->SendEvent(pCCEvent);
771                  }                  }
772                  #endif // ENABLE_FILTER                  #endif // ENABLE_FILTER
773                  if (pCCEvent->Controller == pLFO3->ExtController) {                  if (pCCEvent->Param.CC.Controller == pLFO3->ExtController) {
774                      pLFO3->SendEvent(pCCEvent);                      pLFO3->SendEvent(pCCEvent);
775                  }                  }
776                  if (pDimRgn->AttenuationController.type == ::gig::attenuation_ctrl_t::type_controlchange &&                  if (pDimRgn->AttenuationController.type == ::gig::attenuation_ctrl_t::type_controlchange &&
777                      pCCEvent->Controller == pDimRgn->AttenuationController.controller_number) { // if crossfade event                      pCCEvent->Param.CC.Controller == pDimRgn->AttenuationController.controller_number) { // if crossfade event
778                      pEngine->pSynthesisEvents[Event::destination_vca]->alloc_assign(*pCCEvent);                      pEngine->pSynthesisEvents[Event::destination_vca]->alloc_assign(*pCCEvent);
779                  }                  }
780              }              }
# Line 800  namespace LinuxSampler { namespace gig { Line 804  namespace LinuxSampler { namespace gig {
804                  // calculate the influence length of this event (in sample points)                  // calculate the influence length of this event (in sample points)
805                  uint end = (pNextVCOEvent) ? pNextVCOEvent->FragmentPos() : Samples;                  uint end = (pNextVCOEvent) ? pNextVCOEvent->FragmentPos() : Samples;
806    
807                  pitch = RTMath::CentsToFreqRatio(((double) pVCOEvent->Pitch / 8192.0) * 200.0); // +-two semitones = +-200 cents                  pitch = RTMath::CentsToFreqRatio(((double) pVCOEvent->Param.Pitch.Pitch / 8192.0) * 200.0); // +-two semitones = +-200 cents
808    
809                  // apply pitch value to the pitch parameter sequence                  // apply pitch value to the pitch parameter sequence
810                  for (uint i = pVCOEvent->FragmentPos(); i < end; i++) {                  for (uint i = pVCOEvent->FragmentPos(); i < end; i++) {
# Line 826  namespace LinuxSampler { namespace gig { Line 830  namespace LinuxSampler { namespace gig {
830                  // calculate the influence length of this event (in sample points)                  // calculate the influence length of this event (in sample points)
831                  uint end = (pNextVCAEvent) ? pNextVCAEvent->FragmentPos() : Samples;                  uint end = (pNextVCAEvent) ? pNextVCAEvent->FragmentPos() : Samples;
832    
833                  crossfadevolume = CrossfadeAttenuation(pVCAEvent->Value);                  crossfadevolume = CrossfadeAttenuation(pVCAEvent->Param.CC.Value);
834    
835                  float effective_volume = crossfadevolume * this->Volume * pEngine->GlobalVolume;                  float effective_volume = crossfadevolume * this->Volume * pEngine->GlobalVolume;
836    
# Line 855  namespace LinuxSampler { namespace gig { Line 859  namespace LinuxSampler { namespace gig {
859                  // calculate the influence length of this event (in sample points)                  // calculate the influence length of this event (in sample points)
860                  uint end = (pNextCutoffEvent) ? pNextCutoffEvent->FragmentPos() : Samples;                  uint end = (pNextCutoffEvent) ? pNextCutoffEvent->FragmentPos() : Samples;
861    
862                  cutoff = exp((float) pCutoffEvent->Value * 0.00787402f * FILTER_CUTOFF_COEFF) * FILTER_CUTOFF_MAX - FILTER_CUTOFF_MIN;                  cutoff = exp((float) pCutoffEvent->Param.CC.Value * 0.00787402f * FILTER_CUTOFF_COEFF) * FILTER_CUTOFF_MAX - FILTER_CUTOFF_MIN;
863    
864                  // apply cutoff frequency to the cutoff parameter sequence                  // apply cutoff frequency to the cutoff parameter sequence
865                  for (uint i = pCutoffEvent->FragmentPos(); i < end; i++) {                  for (uint i = pCutoffEvent->FragmentPos(); i < end; i++) {
# Line 881  namespace LinuxSampler { namespace gig { Line 885  namespace LinuxSampler { namespace gig {
885                  uint end = (pNextResonanceEvent) ? pNextResonanceEvent->FragmentPos() : Samples;                  uint end = (pNextResonanceEvent) ? pNextResonanceEvent->FragmentPos() : Samples;
886    
887                  // convert absolute controller value to differential                  // convert absolute controller value to differential
888                  int ctrldelta = pResonanceEvent->Value - VCFResonanceCtrl.value;                  int ctrldelta = pResonanceEvent->Param.CC.Value - VCFResonanceCtrl.value;
889                  VCFResonanceCtrl.value = pResonanceEvent->Value;                  VCFResonanceCtrl.value = pResonanceEvent->Param.CC.Value;
890    
891                  float resonancedelta = (float) ctrldelta * 0.00787f; // 0.0..1.0                  float resonancedelta = (float) ctrldelta * 0.00787f; // 0.0..1.0
892    
# Line 893  namespace LinuxSampler { namespace gig { Line 897  namespace LinuxSampler { namespace gig {
897    
898                  pResonanceEvent = pNextResonanceEvent;                  pResonanceEvent = pNextResonanceEvent;
899              }              }
900              if (pResonanceEventList->last()) VCFResonanceCtrl.fvalue = pResonanceEventList->last()->Value * 0.00787f; // needed for initialization of parameter matrix next time              if (pResonanceEventList->last()) VCFResonanceCtrl.fvalue = pResonanceEventList->last()->Param.CC.Value * 0.00787f; // needed for initialization of parameter matrix next time
901          }          }
902      #endif // ENABLE_FILTER      #endif // ENABLE_FILTER
903      }      }
# Line 945  namespace LinuxSampler { namespace gig { Line 949  namespace LinuxSampler { namespace gig {
949      #endif // ENABLE_FILTER      #endif // ENABLE_FILTER
950    
951      /**      /**
952       *  Interpolates the input audio data (no loop).       *  Interpolates the input audio data (without looping).
953       *       *
954       *  @param Samples - number of sample points to be rendered in this audio       *  @param Samples - number of sample points to be rendered in this audio
955       *                   fragment cycle       *                   fragment cycle
956       *  @param pSrc    - pointer to input sample data       *  @param pSrc    - pointer to input sample data
957       *  @param Skip    - number of sample points to skip in output buffer       *  @param Skip    - number of sample points to skip in output buffer
958       */       */
959      void Voice::Interpolate(uint Samples, sample_t* pSrc, uint Skip) {      void Voice::InterpolateNoLoop(uint Samples, sample_t* pSrc, uint Skip) {
960          int i = Skip;          int i = Skip;
961    
962          // FIXME: assuming either mono or stereo          // FIXME: assuming either mono or stereo
963          if (this->pSample->Channels == 2) { // Stereo Sample          if (this->pSample->Channels == 2) { // Stereo Sample
964              while (i < Samples) {              while (i < Samples) InterpolateStereo(pSrc, i);
                 InterpolateOneStep_Stereo(pSrc, i,  
                                           pEngine->pSynthesisParameters[Event::destination_vca][i],  
                                           pEngine->pSynthesisParameters[Event::destination_vco][i],  
                                           pEngine->pBasicFilterParameters[i],  
                                           pEngine->pMainFilterParameters[i]);  
             }  
965          }          }
966          else { // Mono Sample          else { // Mono Sample
967              while (i < Samples) {              while (i < Samples) InterpolateMono(pSrc, i);
                 InterpolateOneStep_Mono(pSrc, i,  
                                         pEngine->pSynthesisParameters[Event::destination_vca][i],  
                                         pEngine->pSynthesisParameters[Event::destination_vco][i],  
                                         pEngine->pBasicFilterParameters[i],  
                                         pEngine->pMainFilterParameters[i]);  
             }  
968          }          }
969      }      }
970    
# Line 992  namespace LinuxSampler { namespace gig { Line 984  namespace LinuxSampler { namespace gig {
984              if (pSample->LoopPlayCount) {              if (pSample->LoopPlayCount) {
985                  // render loop (loop count limited)                  // render loop (loop count limited)
986                  while (i < Samples && LoopCyclesLeft) {                  while (i < Samples && LoopCyclesLeft) {
987                      InterpolateOneStep_Stereo(pSrc, i,                      InterpolateStereo(pSrc, i);
                                               pEngine->pSynthesisParameters[Event::destination_vca][i],  
                                               pEngine->pSynthesisParameters[Event::destination_vco][i],  
                                               pEngine->pBasicFilterParameters[i],  
                                               pEngine->pMainFilterParameters[i]);  
988                      if (Pos > pSample->LoopEnd) {                      if (Pos > pSample->LoopEnd) {
989                          Pos = pSample->LoopStart + fmod(Pos - pSample->LoopEnd, pSample->LoopSize);;                          Pos = pSample->LoopStart + fmod(Pos - pSample->LoopEnd, pSample->LoopSize);;
990                          LoopCyclesLeft--;                          LoopCyclesLeft--;
991                      }                      }
992                  }                  }
993                  // render on without loop                  // render on without loop
994                  while (i < Samples) {                  while (i < Samples) InterpolateStereo(pSrc, i);
                     InterpolateOneStep_Stereo(pSrc, i,  
                                               pEngine->pSynthesisParameters[Event::destination_vca][i],  
                                               pEngine->pSynthesisParameters[Event::destination_vco][i],  
                                               pEngine->pBasicFilterParameters[i],  
                                               pEngine->pMainFilterParameters[i]);  
                 }  
995              }              }
996              else { // render loop (endless loop)              else { // render loop (endless loop)
997                  while (i < Samples) {                  while (i < Samples) {
998                      InterpolateOneStep_Stereo(pSrc, i,                      InterpolateStereo(pSrc, i);
                                               pEngine->pSynthesisParameters[Event::destination_vca][i],  
                                               pEngine->pSynthesisParameters[Event::destination_vco][i],  
                                               pEngine->pBasicFilterParameters[i],  
                                               pEngine->pMainFilterParameters[i]);  
999                      if (Pos > pSample->LoopEnd) {                      if (Pos > pSample->LoopEnd) {
1000                          Pos = pSample->LoopStart + fmod(Pos - pSample->LoopEnd, pSample->LoopSize);                          Pos = pSample->LoopStart + fmod(Pos - pSample->LoopEnd, pSample->LoopSize);
1001                      }                      }
# Line 1028  namespace LinuxSampler { namespace gig { Line 1006  namespace LinuxSampler { namespace gig {
1006              if (pSample->LoopPlayCount) {              if (pSample->LoopPlayCount) {
1007                  // render loop (loop count limited)                  // render loop (loop count limited)
1008                  while (i < Samples && LoopCyclesLeft) {                  while (i < Samples && LoopCyclesLeft) {
1009                      InterpolateOneStep_Mono(pSrc, i,                      InterpolateMono(pSrc, i);
                                             pEngine->pSynthesisParameters[Event::destination_vca][i],  
                                             pEngine->pSynthesisParameters[Event::destination_vco][i],  
                                             pEngine->pBasicFilterParameters[i],  
                                             pEngine->pMainFilterParameters[i]);  
1010                      if (Pos > pSample->LoopEnd) {                      if (Pos > pSample->LoopEnd) {
1011                          Pos = pSample->LoopStart + fmod(Pos - pSample->LoopEnd, pSample->LoopSize);;                          Pos = pSample->LoopStart + fmod(Pos - pSample->LoopEnd, pSample->LoopSize);;
1012                          LoopCyclesLeft--;                          LoopCyclesLeft--;
1013                      }                      }
1014                  }                  }
1015                  // render on without loop                  // render on without loop
1016                  while (i < Samples) {                  while (i < Samples) InterpolateMono(pSrc, i);
                     InterpolateOneStep_Mono(pSrc, i,  
                                             pEngine->pSynthesisParameters[Event::destination_vca][i],  
                                             pEngine->pSynthesisParameters[Event::destination_vco][i],  
                                             pEngine->pBasicFilterParameters[i],  
                                             pEngine->pMainFilterParameters[i]);  
                 }  
1017              }              }
1018              else { // render loop (endless loop)              else { // render loop (endless loop)
1019                  while (i < Samples) {                  while (i < Samples) {
1020                      InterpolateOneStep_Mono(pSrc, i,                      InterpolateMono(pSrc, i);
                                             pEngine->pSynthesisParameters[Event::destination_vca][i],  
                                             pEngine->pSynthesisParameters[Event::destination_vco][i],  
                                             pEngine->pBasicFilterParameters[i],  
                                             pEngine->pMainFilterParameters[i]);  
1021                      if (Pos > pSample->LoopEnd) {                      if (Pos > pSample->LoopEnd) {
1022                          Pos = pSample->LoopStart + fmod(Pos - pSample->LoopEnd, pSample->LoopSize);;                          Pos = pSample->LoopStart + fmod(Pos - pSample->LoopEnd, pSample->LoopSize);;
1023                      }                      }

Legend:
Removed from v.244  
changed lines
  Added in v.247

  ViewVC Help
Powered by ViewVC