/[svn]/linuxsampler/trunk/src/engines/common/AbstractVoice.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/common/AbstractVoice.cpp

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

revision 3250 by schoenebeck, Sun May 28 22:22:56 2017 UTC revision 3251 by schoenebeck, Mon May 29 22:19:19 2017 UTC
# Line 348  namespace LinuxSampler { Line 348  namespace LinuxSampler {
348      }      }
349            
350      void AbstractVoice::SetSampleStartOffset() {      void AbstractVoice::SetSampleStartOffset() {
351          finalSynthesisParameters.dPos = RgnInfo.SampleStartOffset; // offset where we should start playback of sample (0 - 2000 sample points)          double pos = RgnInfo.SampleStartOffset; // offset where we should start playback of sample
352          Pos = RgnInfo.SampleStartOffset;  
353            // if another sample playback start position was requested by instrument
354            // script (built-in script function play_note())
355            if (pNote && pNote->Override.SampleOffset >= 0) {
356                double overridePos =
357                    double(SmplInfo.SampleRate) * double(pNote->Override.SampleOffset) / 1000000.0;
358                if (overridePos < SmplInfo.TotalFrameCount)
359                    pos = overridePos;
360            }
361    
362            finalSynthesisParameters.dPos = pos;
363            Pos = pos;
364      }      }
365    
366      /**      /**

Legend:
Removed from v.3250  
changed lines
  Added in v.3251

  ViewVC Help
Powered by ViewVC