/[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 2559 by schoenebeck, Sun May 18 17:38:25 2014 UTC
# Line 427  namespace LinuxSampler { Line 427  namespace LinuxSampler {
427              fFinalCutoff    = VCFCutoffCtrl.fvalue;              fFinalCutoff    = VCFCutoffCtrl.fvalue;
428              fFinalResonance = VCFResonanceCtrl.fvalue;              fFinalResonance = VCFResonanceCtrl.fvalue;
429    
430              // process MIDI control change and pitchbend events for this subfragment              // process MIDI control change, aftertouch and pitchbend events for this subfragment
431              processCCEvents(itCCEvent, iSubFragmentEnd);              processCCEvents(itCCEvent, iSubFragmentEnd);
432              uint8_t pan = MIDIPan;              uint8_t pan = MIDIPan;
433              if (pSignalUnitRack != NULL) pan = pSignalUnitRack->GetEndpointUnit()->CalculatePan(MIDIPan);              if (pSignalUnitRack != NULL) pan = pSignalUnitRack->GetEndpointUnit()->CalculatePan(MIDIPan);
# Line 611  namespace LinuxSampler { Line 611  namespace LinuxSampler {
611      }      }
612    
613      /**      /**
614       * Process given list of MIDI control change and pitch bend events for       * Process given list of MIDI control change, aftertouch and pitch bend
615       * the given time.       * events for the given time.
616       *       *
617       * @param itEvent - iterator pointing to the next event to be processed       * @param itEvent - iterator pointing to the next event to be processed
618       * @param End     - youngest time stamp where processing should be stopped       * @param End     - youngest time stamp where processing should be stopped
# Line 644  namespace LinuxSampler { Line 644  namespace LinuxSampler {
644                  }                  }
645              } else if (itEvent->Type == Event::type_pitchbend) { // if pitch bend event              } else if (itEvent->Type == Event::type_pitchbend) { // if pitch bend event
646                  processPitchEvent(itEvent);                  processPitchEvent(itEvent);
647                } else if (itEvent->Type == Event::type_channel_pressure) {
648                    ProcessChannelPressureEvent(itEvent);
649                } else if (itEvent->Type == Event::type_note_pressure) {
650                    ProcessPolyphonicKeyPressureEvent(itEvent);
651              }              }
652    
653              ProcessCCEvent(itEvent);              ProcessCCEvent(itEvent);
# Line 755  namespace LinuxSampler { Line 759  namespace LinuxSampler {
759    
760          return pitch;          return pitch;
761      }      }
762        
763        void AbstractVoice::onScaleTuningChanged() {
764            PitchInfo pitch = this->Pitch;
765            double pitchbasecents = InstrInfo.FineTune + RgnInfo.FineTune + GetEngine()->ScaleTuning[MIDIKey % 12];
766            
767            // GSt behaviour: maximum transpose up is 40 semitones. If
768            // MIDI key is more than 40 semitones above unity note,
769            // the transpose is not done.
770            if (!SmplInfo.Unpitched && (MIDIKey - (int) RgnInfo.UnityNote) < 40) pitchbasecents += (MIDIKey - (int) RgnInfo.UnityNote) * 100;
771            
772            pitch.PitchBase = RTMath::CentsToFreqRatioUnlimited(pitchbasecents) * (double(SmplInfo.SampleRate) / double(GetEngine()->SampleRate));
773            this->Pitch = pitch;
774        }
775    
776      double AbstractVoice::CalculateVolume(double velocityAttenuation) {      double AbstractVoice::CalculateVolume(double velocityAttenuation) {
777          // 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.2559

  ViewVC Help
Powered by ViewVC