/[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 2382 by persson, Sun Dec 2 16:30:42 2012 UTC revision 2448 by schoenebeck, Fri May 3 14:26:32 2013 UTC
# Line 755  namespace LinuxSampler { Line 755  namespace LinuxSampler {
755    
756          return pitch;          return pitch;
757      }      }
758        
759        void AbstractVoice::onScaleTuningChanged() {
760            PitchInfo pitch = this->Pitch;
761            double pitchbasecents = InstrInfo.FineTune + RgnInfo.FineTune + GetEngine()->ScaleTuning[MIDIKey % 12];
762            
763            // GSt behaviour: maximum transpose up is 40 semitones. If
764            // MIDI key is more than 40 semitones above unity note,
765            // the transpose is not done.
766            if (!SmplInfo.Unpitched && (MIDIKey - (int) RgnInfo.UnityNote) < 40) pitchbasecents += (MIDIKey - (int) RgnInfo.UnityNote) * 100;
767            
768            pitch.PitchBase = RTMath::CentsToFreqRatioUnlimited(pitchbasecents) * (double(SmplInfo.SampleRate) / double(GetEngine()->SampleRate));
769            this->Pitch = pitch;
770        }
771    
772      double AbstractVoice::CalculateVolume(double velocityAttenuation) {      double AbstractVoice::CalculateVolume(double velocityAttenuation) {
773          // For 16 bit samples, we downscale by 32768 to convert from          // For 16 bit samples, we downscale by 32768 to convert from

Legend:
Removed from v.2382  
changed lines
  Added in v.2448

  ViewVC Help
Powered by ViewVC