/[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 1259 by schoenebeck, Tue Jun 26 21:41:09 2007 UTC revision 1700 by persson, Sun Feb 17 12:40:59 2008 UTC
# Line 184  namespace LinuxSampler { namespace gig { Line 184  namespace LinuxSampler { namespace gig {
184          // calculate initial pitch value          // calculate initial pitch value
185          {          {
186              double pitchbasecents = pDimRgn->FineTune + (int) pEngine->ScaleTuning[MIDIKey % 12];              double pitchbasecents = pDimRgn->FineTune + (int) pEngine->ScaleTuning[MIDIKey % 12];
187              if (pDimRgn->PitchTrack) pitchbasecents += (MIDIKey - (int) pDimRgn->UnityNote) * 100;  
188                // GSt behaviour: maximum transpose up is 40 semitones. If
189                // MIDI key is more than 40 semitones above unity note,
190                // the transpose is not done.
191                if (pDimRgn->PitchTrack && (MIDIKey - (int) pDimRgn->UnityNote) < 40) pitchbasecents += (MIDIKey - (int) pDimRgn->UnityNote) * 100;
192    
193              this->PitchBase = RTMath::CentsToFreqRatio(pitchbasecents) * (double(pSample->SamplesPerSecond) / double(pEngine->SampleRate));              this->PitchBase = RTMath::CentsToFreqRatio(pitchbasecents) * (double(pSample->SamplesPerSecond) / double(pEngine->SampleRate));
194              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
195          }          }
# Line 921  namespace LinuxSampler { namespace gig { Line 926  namespace LinuxSampler { namespace gig {
926       *  fading down the volume level to avoid clicks and regular processing       *  fading down the volume level to avoid clicks and regular processing
927       *  until the kill event actually occured!       *  until the kill event actually occured!
928       *       *
929       *  @see Kill()       * If it's necessary to know when the voice's disk stream was actually
930         * deleted, then one can set the optional @a bRequestNotification
931         * parameter and this method will then return the handle of the disk
932         * stream (unique identifier) and one can use this handle to poll the
933         * disk thread if this stream has been deleted. In any case this method
934         * will return immediately and will not block until the stream actually
935         * was deleted.
936         *
937         * @param bRequestNotification - (optional) whether the disk thread shall
938         *                                provide a notification once it deleted
939         *                               the respective disk stream
940         *                               (default=false)
941         * @returns handle to the voice's disk stream or @c Stream::INVALID_HANDLE
942         *          if the voice did not use a disk stream at all
943         * @see Kill()
944       */       */
945      void Voice::KillImmediately() {      Stream::Handle Voice::KillImmediately(bool bRequestNotification) {
946            Stream::Handle hStream = Stream::INVALID_HANDLE;
947          if (DiskVoice && DiskStreamRef.State != Stream::state_unused) {          if (DiskVoice && DiskStreamRef.State != Stream::state_unused) {
948              pDiskThread->OrderDeletionOfStream(&DiskStreamRef);              pDiskThread->OrderDeletionOfStream(&DiskStreamRef, bRequestNotification);
949                hStream = DiskStreamRef.hStream;
950          }          }
951          Reset();          Reset();
952            return hStream;
953      }      }
954    
955      /**      /**

Legend:
Removed from v.1259  
changed lines
  Added in v.1700

  ViewVC Help
Powered by ViewVC