/[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 56 by schoenebeck, Tue Apr 27 09:21:58 2004 UTC revision 233 by schoenebeck, Tue Sep 7 09:32:21 2004 UTC
# Line 27  Line 27 
27    
28  namespace LinuxSampler { namespace gig {  namespace LinuxSampler { namespace gig {
29    
30      // FIXME: no support for layers (nor crossfades) yet      // TODO: no support for crossfades yet
31    
32      const float Voice::FILTER_CUTOFF_COEFF(CalculateFilterCutoffCoeff());      const float Voice::FILTER_CUTOFF_COEFF(CalculateFilterCutoffCoeff());
33    
34        const int Voice::FILTER_UPDATE_MASK(CalculateFilterUpdateMask());
35    
36      float Voice::CalculateFilterCutoffCoeff() {      float Voice::CalculateFilterCutoffCoeff() {
37          return log(FILTER_CUTOFF_MIN / FILTER_CUTOFF_MAX);          return log(FILTER_CUTOFF_MIN / FILTER_CUTOFF_MAX);
38      }      }
39    
40        int Voice::CalculateFilterUpdateMask() {
41            if (FILTER_UPDATE_PERIOD <= 0) return 0;
42            int power_of_two;
43            for (power_of_two = 0; 1<<power_of_two < FILTER_UPDATE_PERIOD; power_of_two++);
44            return (1 << power_of_two) - 1;
45        }
46    
47      Voice::Voice() {      Voice::Voice() {
48          pEngine     = NULL;          pEngine     = NULL;
49          pDiskThread = NULL;          pDiskThread = NULL;
# Line 62  namespace LinuxSampler { namespace gig { Line 71  namespace LinuxSampler { namespace gig {
71          if (pVCOManipulator)  delete pVCOManipulator;          if (pVCOManipulator)  delete pVCOManipulator;
72      }      }
73    
     void Voice::SetOutput(AudioOutputDevice* pAudioOutputDevice) {  
         this->pOutputLeft        = pAudioOutputDevice->Channel(0)->Buffer();  
         this->pOutputRight       = pAudioOutputDevice->Channel(1)->Buffer();  
         this->MaxSamplesPerCycle = pAudioOutputDevice->MaxSamplesPerCycle();  
         this->SampleRate         = pAudioOutputDevice->SampleRate();  
     }  
   
74      void Voice::SetEngine(Engine* pEngine) {      void Voice::SetEngine(Engine* pEngine) {
75          this->pEngine = pEngine;          this->pEngine = pEngine;
76    
# Line 95  namespace LinuxSampler { namespace gig { Line 97  namespace LinuxSampler { namespace gig {
97          pLFO3  = new LFO<gig::VCOManipulator>(-1200.0f, 1200.0f, LFO<VCOManipulator>::propagation_middle_balanced, pVCOManipulator, pEngine->pEventPool); // +-1 octave (+-1200 cents) max.          pLFO3  = new LFO<gig::VCOManipulator>(-1200.0f, 1200.0f, LFO<VCOManipulator>::propagation_middle_balanced, pVCOManipulator, pEngine->pEventPool); // +-1 octave (+-1200 cents) max.
98    
99          this->pDiskThread = pEngine->pDiskThread;          this->pDiskThread = pEngine->pDiskThread;
100          dmsg(1,("Voice::SetEngine()\n"));          dmsg(6,("Voice::SetEngine()\n"));
101      }      }
102    
103      /**      /**
# Line 105  namespace LinuxSampler { namespace gig { Line 107  namespace LinuxSampler { namespace gig {
107       *  @param pNoteOnEvent - event that caused triggering of this voice       *  @param pNoteOnEvent - event that caused triggering of this voice
108       *  @param PitchBend    - MIDI detune factor (-8192 ... +8191)       *  @param PitchBend    - MIDI detune factor (-8192 ... +8191)
109       *  @param pInstrument  - points to the loaded instrument which provides sample wave(s) and articulation data       *  @param pInstrument  - points to the loaded instrument which provides sample wave(s) and articulation data
110         *  @param iLayer       - layer number this voice refers to (only if this is a layered sound of course)
111       *  @returns            0 on success, a value < 0 if something failed       *  @returns            0 on success, a value < 0 if something failed
112       */       */
113      int Voice::Trigger(Event* pNoteOnEvent, int PitchBend, ::gig::Instrument* pInstrument) {      int Voice::Trigger(Event* pNoteOnEvent, int PitchBend, ::gig::Instrument* pInstrument, int iLayer) {
114          if (!pInstrument) {          if (!pInstrument) {
115             dmsg(1,("voice::trigger: !pInstrument\n"));             dmsg(1,("voice::trigger: !pInstrument\n"));
116             exit(EXIT_FAILURE);             exit(EXIT_FAILURE);
# Line 122  namespace LinuxSampler { namespace gig { Line 125  namespace LinuxSampler { namespace gig {
125          pTriggerEvent   = pNoteOnEvent;          pTriggerEvent   = pNoteOnEvent;
126    
127          if (!pRegion) {          if (!pRegion) {
128              std::cerr << "Audio Thread: No Region defined for MIDI key " << MIDIKey << std::endl << std::flush;              std::cerr << "gig::Voice: No Region defined for MIDI key " << MIDIKey << std::endl << std::flush;
129              Kill();              Kill();
130              return -1;              return -1;
131          }          }
132    
133          //TODO: current MIDI controller values are not taken into account yet          // get current dimension values to select the right dimension region
134          ::gig::DimensionRegion* pDimRgn = NULL;          //FIXME: controller values for selecting the dimension region here are currently not sample accurate
135          for (int i = pRegion->Dimensions - 1; i >= 0; i--) { // Check if instrument has a velocity split          uint DimValues[5] = {0,0,0,0,0};
136              if (pRegion->pDimensionDefinitions[i].dimension == ::gig::dimension_velocity) {          for (int i = pRegion->Dimensions - 1; i >= 0; i--) {
137                  uint DimValues[5] = {0,0,0,0,0};              switch (pRegion->pDimensionDefinitions[i].dimension) {
138                    case ::gig::dimension_samplechannel:
139                        DimValues[i] = 0; //TODO: we currently ignore this dimension
140                        break;
141                    case ::gig::dimension_layer:
142                        DimValues[i] = iLayer;
143                        // if this is the 1st layer then spawn further voices for all the other layers
144                        if (iLayer == 0)
145                            for (int iNewLayer = 1; iNewLayer < pRegion->pDimensionDefinitions[i].zones; iNewLayer++)
146                                pEngine->LaunchVoice(pNoteOnEvent, iNewLayer);
147                        break;
148                    case ::gig::dimension_velocity:
149                      DimValues[i] = pNoteOnEvent->Velocity;                      DimValues[i] = pNoteOnEvent->Velocity;
150                  pDimRgn = pRegion->GetDimensionRegionByValue(DimValues[4],DimValues[3],DimValues[2],DimValues[1],DimValues[0]);                      break;
151                  break;                  case ::gig::dimension_channelaftertouch:
152                        DimValues[i] = 0; //TODO: we currently ignore this dimension
153                        break;
154                    case ::gig::dimension_releasetrigger:
155                        DimValues[i] = 0; //TODO: we currently ignore this dimension
156                        break;
157                    case ::gig::dimension_keyboard:
158                        DimValues[i] = (uint) pNoteOnEvent->Key;
159                        break;
160                    case ::gig::dimension_modwheel:
161                        DimValues[i] = pEngine->ControllerTable[1];
162                        break;
163                    case ::gig::dimension_breath:
164                        DimValues[i] = pEngine->ControllerTable[2];
165                        break;
166                    case ::gig::dimension_foot:
167                        DimValues[i] = pEngine->ControllerTable[4];
168                        break;
169                    case ::gig::dimension_portamentotime:
170                        DimValues[i] = pEngine->ControllerTable[5];
171                        break;
172                    case ::gig::dimension_effect1:
173                        DimValues[i] = pEngine->ControllerTable[12];
174                        break;
175                    case ::gig::dimension_effect2:
176                        DimValues[i] = pEngine->ControllerTable[13];
177                        break;
178                    case ::gig::dimension_genpurpose1:
179                        DimValues[i] = pEngine->ControllerTable[16];
180                        break;
181                    case ::gig::dimension_genpurpose2:
182                        DimValues[i] = pEngine->ControllerTable[17];
183                        break;
184                    case ::gig::dimension_genpurpose3:
185                        DimValues[i] = pEngine->ControllerTable[18];
186                        break;
187                    case ::gig::dimension_genpurpose4:
188                        DimValues[i] = pEngine->ControllerTable[19];
189                        break;
190                    case ::gig::dimension_sustainpedal:
191                        DimValues[i] = pEngine->ControllerTable[64];
192                        break;
193                    case ::gig::dimension_portamento:
194                        DimValues[i] = pEngine->ControllerTable[65];
195                        break;
196                    case ::gig::dimension_sostenutopedal:
197                        DimValues[i] = pEngine->ControllerTable[66];
198                        break;
199                    case ::gig::dimension_softpedal:
200                        DimValues[i] = pEngine->ControllerTable[67];
201                        break;
202                    case ::gig::dimension_genpurpose5:
203                        DimValues[i] = pEngine->ControllerTable[80];
204                        break;
205                    case ::gig::dimension_genpurpose6:
206                        DimValues[i] = pEngine->ControllerTable[81];
207                        break;
208                    case ::gig::dimension_genpurpose7:
209                        DimValues[i] = pEngine->ControllerTable[82];
210                        break;
211                    case ::gig::dimension_genpurpose8:
212                        DimValues[i] = pEngine->ControllerTable[83];
213                        break;
214                    case ::gig::dimension_effect1depth:
215                        DimValues[i] = pEngine->ControllerTable[91];
216                        break;
217                    case ::gig::dimension_effect2depth:
218                        DimValues[i] = pEngine->ControllerTable[92];
219                        break;
220                    case ::gig::dimension_effect3depth:
221                        DimValues[i] = pEngine->ControllerTable[93];
222                        break;
223                    case ::gig::dimension_effect4depth:
224                        DimValues[i] = pEngine->ControllerTable[94];
225                        break;
226                    case ::gig::dimension_effect5depth:
227                        DimValues[i] = pEngine->ControllerTable[95];
228                        break;
229                    case ::gig::dimension_none:
230                        std::cerr << "gig::Voice::Trigger() Error: dimension=none\n" << std::flush;
231                        break;
232                    default:
233                        std::cerr << "gig::Voice::Trigger() Error: Unknown dimension\n" << std::flush;
234              }              }
235          }          }
236          if (!pDimRgn) { // if there was no velocity split          ::gig::DimensionRegion* pDimRgn = pRegion->GetDimensionRegionByValue(DimValues[4],DimValues[3],DimValues[2],DimValues[1],DimValues[0]);
             pDimRgn = pRegion->GetDimensionRegionByValue(0,0,0,0,0);  
         }  
237    
238          pSample = pDimRgn->pSample; // sample won't change until the voice is finished          pSample = pDimRgn->pSample; // sample won't change until the voice is finished
239    
# Line 148  namespace LinuxSampler { namespace gig { Line 242  namespace LinuxSampler { namespace gig {
242          DiskVoice          = cachedsamples < pSample->SamplesTotal;          DiskVoice          = cachedsamples < pSample->SamplesTotal;
243    
244          if (DiskVoice) { // voice to be streamed from disk          if (DiskVoice) { // voice to be streamed from disk
245              MaxRAMPos = cachedsamples - (MaxSamplesPerCycle << MAX_PITCH) / pSample->Channels; //TODO: this calculation is too pessimistic and may better be moved to Render() method, so it calculates MaxRAMPos dependent to the current demand of sample points to be rendered (e.g. in case of JACK)              MaxRAMPos = cachedsamples - (pEngine->MaxSamplesPerCycle << MAX_PITCH) / pSample->Channels; //TODO: this calculation is too pessimistic and may better be moved to Render() method, so it calculates MaxRAMPos dependent to the current demand of sample points to be rendered (e.g. in case of JACK)
246    
247              // check if there's a loop defined which completely fits into the cached (RAM) part of the sample              // check if there's a loop defined which completely fits into the cached (RAM) part of the sample
248              if (pSample->Loops && pSample->LoopEnd <= MaxRAMPos) {              if (pSample->Loops && pSample->LoopEnd <= MaxRAMPos) {
# Line 179  namespace LinuxSampler { namespace gig { Line 273  namespace LinuxSampler { namespace gig {
273          {          {
274              double pitchbasecents = pDimRgn->FineTune * 10;              double pitchbasecents = pDimRgn->FineTune * 10;
275              if (pDimRgn->PitchTrack) pitchbasecents += (MIDIKey - (int) pDimRgn->UnityNote) * 100;              if (pDimRgn->PitchTrack) pitchbasecents += (MIDIKey - (int) pDimRgn->UnityNote) * 100;
276              this->PitchBase = RTMath::CentsToFreqRatio(pitchbasecents);              this->PitchBase = RTMath::CentsToFreqRatio(pitchbasecents) * (double(pSample->SamplesPerSecond) / double(pEngine->pAudioOutputDevice->SampleRate()));
277              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
278          }          }
279    
# Line 305  namespace LinuxSampler { namespace gig { Line 399  namespace LinuxSampler { namespace gig {
399                            pDimRgn->LFO1ControlDepth,                            pDimRgn->LFO1ControlDepth,
400                            pEngine->ControllerTable[pLFO1->ExtController],                            pEngine->ControllerTable[pLFO1->ExtController],
401                            pDimRgn->LFO1FlipPhase,                            pDimRgn->LFO1FlipPhase,
402                            this->SampleRate,                            pEngine->SampleRate,
403                            Delay);                            Delay);
404          }          }
405    
# Line 343  namespace LinuxSampler { namespace gig { Line 437  namespace LinuxSampler { namespace gig {
437                            pDimRgn->LFO2ControlDepth,                            pDimRgn->LFO2ControlDepth,
438                            pEngine->ControllerTable[pLFO2->ExtController],                            pEngine->ControllerTable[pLFO2->ExtController],
439                            pDimRgn->LFO2FlipPhase,                            pDimRgn->LFO2FlipPhase,
440                              pEngine->SampleRate,
441                            Delay);                            Delay);
442          }          }
443      #endif // ENABLE_FILTER      #endif // ENABLE_FILTER
# Line 380  namespace LinuxSampler { namespace gig { Line 475  namespace LinuxSampler { namespace gig {
475                            pDimRgn->LFO3ControlDepth,                            pDimRgn->LFO3ControlDepth,
476                            pEngine->ControllerTable[pLFO3->ExtController],                            pEngine->ControllerTable[pLFO3->ExtController],
477                            false,                            false,
478                            this->SampleRate,                            pEngine->SampleRate,
479                            Delay);                            Delay);
480          }          }
481    
# Line 478  namespace LinuxSampler { namespace gig { Line 573  namespace LinuxSampler { namespace gig {
573              VCFCutoffCtrl.fvalue    = cutoff - FILTER_CUTOFF_MIN;              VCFCutoffCtrl.fvalue    = cutoff - FILTER_CUTOFF_MIN;
574              VCFResonanceCtrl.fvalue = resonance;              VCFResonanceCtrl.fvalue = resonance;
575    
576              FilterLeft.SetParameters(cutoff,  resonance, SampleRate);              FilterLeft.SetParameters(cutoff,  resonance, pEngine->SampleRate);
577              FilterRight.SetParameters(cutoff, resonance, SampleRate);              FilterRight.SetParameters(cutoff, resonance, pEngine->SampleRate);
578    
579              FilterUpdateCounter = -1;              FilterUpdateCounter = -1;
580          }          }
# Line 510  namespace LinuxSampler { namespace gig { Line 605  namespace LinuxSampler { namespace gig {
605      void Voice::Render(uint Samples) {      void Voice::Render(uint Samples) {
606    
607          // Reset the synthesis parameter matrix          // Reset the synthesis parameter matrix
608          pEngine->ResetSynthesisParameters(Event::destination_vca, this->Volume);          pEngine->ResetSynthesisParameters(Event::destination_vca, this->Volume * pEngine->GlobalVolume);
609          pEngine->ResetSynthesisParameters(Event::destination_vco, this->PitchBase);          pEngine->ResetSynthesisParameters(Event::destination_vco, this->PitchBase);
610      #if ENABLE_FILTER      #if ENABLE_FILTER
611          pEngine->ResetSynthesisParameters(Event::destination_vcfc, VCFCutoffCtrl.fvalue);          pEngine->ResetSynthesisParameters(Event::destination_vcfc, VCFCutoffCtrl.fvalue);
# Line 535  namespace LinuxSampler { namespace gig { Line 630  namespace LinuxSampler { namespace gig {
630          pLFO3->Process(Samples);          pLFO3->Process(Samples);
631    
632    
633        #if ENABLE_FILTER
634            CalculateBiquadParameters(Samples); // calculate the final biquad filter parameters
635        #endif // ENABLE_FILTER
636    
637    
638          switch (this->PlaybackState) {          switch (this->PlaybackState) {
639    
640              case playback_state_ram: {              case playback_state_ram: {
# Line 567  namespace LinuxSampler { namespace gig { Line 667  namespace LinuxSampler { namespace gig {
667                      }                      }
668    
669                      // add silence sample at the end if we reached the end of the stream (for the interpolator)                      // add silence sample at the end if we reached the end of the stream (for the interpolator)
670                      if (DiskStreamRef.State == Stream::state_end && DiskStreamRef.pStream->GetReadSpace() < (MaxSamplesPerCycle << MAX_PITCH) / pSample->Channels) {                      if (DiskStreamRef.State == Stream::state_end && DiskStreamRef.pStream->GetReadSpace() < (pEngine->MaxSamplesPerCycle << MAX_PITCH) / pSample->Channels) {
671                          DiskStreamRef.pStream->WriteSilence((MaxSamplesPerCycle << MAX_PITCH) / pSample->Channels);                          DiskStreamRef.pStream->WriteSilence((pEngine->MaxSamplesPerCycle << MAX_PITCH) / pSample->Channels);
672                          this->PlaybackState = playback_state_end;                          this->PlaybackState = playback_state_end;
673                      }                      }
674    
# Line 748  namespace LinuxSampler { namespace gig { Line 848  namespace LinuxSampler { namespace gig {
848      #endif // ENABLE_FILTER      #endif // ENABLE_FILTER
849      }      }
850    
851        #if ENABLE_FILTER
852        /**
853         * Calculate all necessary, final biquad filter parameters.
854         *
855         * @param Samples - number of samples to be rendered in this audio fragment cycle
856         */
857        void Voice::CalculateBiquadParameters(uint Samples) {
858            if (!FilterLeft.Enabled) return;
859    
860            biquad_param_t bqbase;
861            biquad_param_t bqmain;
862            float prev_cutoff = pEngine->pSynthesisParameters[Event::destination_vcfc][0];
863            float prev_res    = pEngine->pSynthesisParameters[Event::destination_vcfr][0];
864            FilterLeft.SetParameters(&bqbase, &bqmain, prev_cutoff, prev_res, pEngine->SampleRate);
865            pEngine->pBasicFilterParameters[0] = bqbase;
866            pEngine->pMainFilterParameters[0]  = bqmain;
867    
868            float* bq;
869            for (int i = 1; i < Samples; i++) {
870                // recalculate biquad parameters if cutoff or resonance differ from previous sample point
871                if (!(i & FILTER_UPDATE_MASK)) if (pEngine->pSynthesisParameters[Event::destination_vcfr][i] != prev_res ||
872                                                   pEngine->pSynthesisParameters[Event::destination_vcfc][i] != prev_cutoff) {
873                    prev_cutoff = pEngine->pSynthesisParameters[Event::destination_vcfc][i];
874                    prev_res    = pEngine->pSynthesisParameters[Event::destination_vcfr][i];
875                    FilterLeft.SetParameters(&bqbase, &bqmain, prev_cutoff, prev_res, pEngine->SampleRate);
876                }
877    
878                //same as 'pEngine->pBasicFilterParameters[i] = bqbase;'
879                bq    = (float*) &pEngine->pBasicFilterParameters[i];
880                bq[0] = bqbase.a1;
881                bq[1] = bqbase.a2;
882                bq[2] = bqbase.b0;
883                bq[3] = bqbase.b1;
884                bq[4] = bqbase.b2;
885    
886                // same as 'pEngine->pMainFilterParameters[i] = bqmain;'
887                bq    = (float*) &pEngine->pMainFilterParameters[i];
888                bq[0] = bqmain.a1;
889                bq[1] = bqmain.a2;
890                bq[2] = bqmain.b0;
891                bq[3] = bqmain.b1;
892                bq[4] = bqmain.b2;
893            }
894        }
895        #endif // ENABLE_FILTER
896    
897      /**      /**
898       *  Interpolates the input audio data (no loop).       *  Interpolates the input audio data (no loop).
899       *       *
# Line 765  namespace LinuxSampler { namespace gig { Line 911  namespace LinuxSampler { namespace gig {
911                  InterpolateOneStep_Stereo(pSrc, i,                  InterpolateOneStep_Stereo(pSrc, i,
912                                            pEngine->pSynthesisParameters[Event::destination_vca][i],                                            pEngine->pSynthesisParameters[Event::destination_vca][i],
913                                            pEngine->pSynthesisParameters[Event::destination_vco][i],                                            pEngine->pSynthesisParameters[Event::destination_vco][i],
914                                            pEngine->pSynthesisParameters[Event::destination_vcfc][i],                                            pEngine->pBasicFilterParameters[i],
915                                            pEngine->pSynthesisParameters[Event::destination_vcfr][i]);                                            pEngine->pMainFilterParameters[i]);
916              }              }
917          }          }
918          else { // Mono Sample          else { // Mono Sample
# Line 774  namespace LinuxSampler { namespace gig { Line 920  namespace LinuxSampler { namespace gig {
920                  InterpolateOneStep_Mono(pSrc, i,                  InterpolateOneStep_Mono(pSrc, i,
921                                          pEngine->pSynthesisParameters[Event::destination_vca][i],                                          pEngine->pSynthesisParameters[Event::destination_vca][i],
922                                          pEngine->pSynthesisParameters[Event::destination_vco][i],                                          pEngine->pSynthesisParameters[Event::destination_vco][i],
923                                          pEngine->pSynthesisParameters[Event::destination_vcfc][i],                                          pEngine->pBasicFilterParameters[i],
924                                          pEngine->pSynthesisParameters[Event::destination_vcfr][i]);                                          pEngine->pMainFilterParameters[i]);
925              }              }
926          }          }
927      }      }
# Line 799  namespace LinuxSampler { namespace gig { Line 945  namespace LinuxSampler { namespace gig {
945                      InterpolateOneStep_Stereo(pSrc, i,                      InterpolateOneStep_Stereo(pSrc, i,
946                                                pEngine->pSynthesisParameters[Event::destination_vca][i],                                                pEngine->pSynthesisParameters[Event::destination_vca][i],
947                                                pEngine->pSynthesisParameters[Event::destination_vco][i],                                                pEngine->pSynthesisParameters[Event::destination_vco][i],
948                                                pEngine->pSynthesisParameters[Event::destination_vcfc][i],                                                pEngine->pBasicFilterParameters[i],
949                                                pEngine->pSynthesisParameters[Event::destination_vcfr][i]);                                                pEngine->pMainFilterParameters[i]);
950                      if (Pos > pSample->LoopEnd) {                      if (Pos > pSample->LoopEnd) {
951                          Pos = pSample->LoopStart + fmod(Pos - pSample->LoopEnd, pSample->LoopSize);;                          Pos = pSample->LoopStart + fmod(Pos - pSample->LoopEnd, pSample->LoopSize);;
952                          LoopCyclesLeft--;                          LoopCyclesLeft--;
# Line 811  namespace LinuxSampler { namespace gig { Line 957  namespace LinuxSampler { namespace gig {
957                      InterpolateOneStep_Stereo(pSrc, i,                      InterpolateOneStep_Stereo(pSrc, i,
958                                                pEngine->pSynthesisParameters[Event::destination_vca][i],                                                pEngine->pSynthesisParameters[Event::destination_vca][i],
959                                                pEngine->pSynthesisParameters[Event::destination_vco][i],                                                pEngine->pSynthesisParameters[Event::destination_vco][i],
960                                                pEngine->pSynthesisParameters[Event::destination_vcfc][i],                                                pEngine->pBasicFilterParameters[i],
961                                                pEngine->pSynthesisParameters[Event::destination_vcfr][i]);                                                pEngine->pMainFilterParameters[i]);
962                  }                  }
963              }              }
964              else { // render loop (endless loop)              else { // render loop (endless loop)
# Line 820  namespace LinuxSampler { namespace gig { Line 966  namespace LinuxSampler { namespace gig {
966                      InterpolateOneStep_Stereo(pSrc, i,                      InterpolateOneStep_Stereo(pSrc, i,
967                                                pEngine->pSynthesisParameters[Event::destination_vca][i],                                                pEngine->pSynthesisParameters[Event::destination_vca][i],
968                                                pEngine->pSynthesisParameters[Event::destination_vco][i],                                                pEngine->pSynthesisParameters[Event::destination_vco][i],
969                                                pEngine->pSynthesisParameters[Event::destination_vcfc][i],                                                pEngine->pBasicFilterParameters[i],
970                                                pEngine->pSynthesisParameters[Event::destination_vcfr][i]);                                                pEngine->pMainFilterParameters[i]);
971                      if (Pos > pSample->LoopEnd) {                      if (Pos > pSample->LoopEnd) {
972                          Pos = pSample->LoopStart + fmod(Pos - pSample->LoopEnd, pSample->LoopSize);                          Pos = pSample->LoopStart + fmod(Pos - pSample->LoopEnd, pSample->LoopSize);
973                      }                      }
# Line 835  namespace LinuxSampler { namespace gig { Line 981  namespace LinuxSampler { namespace gig {
981                      InterpolateOneStep_Mono(pSrc, i,                      InterpolateOneStep_Mono(pSrc, i,
982                                              pEngine->pSynthesisParameters[Event::destination_vca][i],                                              pEngine->pSynthesisParameters[Event::destination_vca][i],
983                                              pEngine->pSynthesisParameters[Event::destination_vco][i],                                              pEngine->pSynthesisParameters[Event::destination_vco][i],
984                                              pEngine->pSynthesisParameters[Event::destination_vcfc][i],                                              pEngine->pBasicFilterParameters[i],
985                                              pEngine->pSynthesisParameters[Event::destination_vcfr][i]);                                              pEngine->pMainFilterParameters[i]);
986                      if (Pos > pSample->LoopEnd) {                      if (Pos > pSample->LoopEnd) {
987                          Pos = pSample->LoopStart + fmod(Pos - pSample->LoopEnd, pSample->LoopSize);;                          Pos = pSample->LoopStart + fmod(Pos - pSample->LoopEnd, pSample->LoopSize);;
988                          LoopCyclesLeft--;                          LoopCyclesLeft--;
# Line 847  namespace LinuxSampler { namespace gig { Line 993  namespace LinuxSampler { namespace gig {
993                      InterpolateOneStep_Mono(pSrc, i,                      InterpolateOneStep_Mono(pSrc, i,
994                                              pEngine->pSynthesisParameters[Event::destination_vca][i],                                              pEngine->pSynthesisParameters[Event::destination_vca][i],
995                                              pEngine->pSynthesisParameters[Event::destination_vco][i],                                              pEngine->pSynthesisParameters[Event::destination_vco][i],
996                                              pEngine->pSynthesisParameters[Event::destination_vcfc][i],                                              pEngine->pBasicFilterParameters[i],
997                                              pEngine->pSynthesisParameters[Event::destination_vcfr][i]);                                              pEngine->pMainFilterParameters[i]);
998                  }                  }
999              }              }
1000              else { // render loop (endless loop)              else { // render loop (endless loop)
# Line 856  namespace LinuxSampler { namespace gig { Line 1002  namespace LinuxSampler { namespace gig {
1002                      InterpolateOneStep_Mono(pSrc, i,                      InterpolateOneStep_Mono(pSrc, i,
1003                                              pEngine->pSynthesisParameters[Event::destination_vca][i],                                              pEngine->pSynthesisParameters[Event::destination_vca][i],
1004                                              pEngine->pSynthesisParameters[Event::destination_vco][i],                                              pEngine->pSynthesisParameters[Event::destination_vco][i],
1005                                              pEngine->pSynthesisParameters[Event::destination_vcfc][i],                                              pEngine->pBasicFilterParameters[i],
1006                                              pEngine->pSynthesisParameters[Event::destination_vcfr][i]);                                              pEngine->pMainFilterParameters[i]);
1007                      if (Pos > pSample->LoopEnd) {                      if (Pos > pSample->LoopEnd) {
1008                          Pos = pSample->LoopStart + fmod(Pos - pSample->LoopEnd, pSample->LoopSize);;                          Pos = pSample->LoopStart + fmod(Pos - pSample->LoopEnd, pSample->LoopSize);;
1009                      }                      }

Legend:
Removed from v.56  
changed lines
  Added in v.233

  ViewVC Help
Powered by ViewVC