/[svn]/linuxsampler/trunk/src/engines/sf2/Voice.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/sf2/Voice.cpp

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

revision 2327 by persson, Sat Mar 10 16:16:14 2012 UTC revision 3034 by schoenebeck, Mon Oct 31 00:05:00 2016 UTC
# Line 4  Line 4 
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
6   *   Copyright (C) 2005 - 2008 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2008 Christian Schoenebeck                       *
7   *   Copyright (C) 2009 - 2012 Christian Schoenebeck and Grigor Iliev      *   *   Copyright (C) 2009 - 2016 Christian Schoenebeck and Grigor Iliev      *
8   *                                                                         *   *                                                                         *
9   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
10   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 29  Line 29 
29    
30  namespace LinuxSampler { namespace sf2 {  namespace LinuxSampler { namespace sf2 {
31    
32      typedef LinuxSampler::VoiceBase<EngineChannel, ::sf2::Region, ::sf2::Sample, DiskThread> SF2Voice;      typedef LinuxSampler::VoiceBase<EngineChannel, ::sf2::Region, ::sf2::Sample, DiskThread> SF2VoiceBase;
33      Voice::Voice(): SignalRack(this), SF2Voice(&SignalRack) {  
34        Voice::Voice(): SF2VoiceBase(&SignalRack), SignalRack(this) {
35          pEngine = NULL;          pEngine = NULL;
36          pEG1 = NULL;          pEG1 = NULL;
37          pEG2 = NULL;          pEG2 = NULL;
# Line 127  namespace LinuxSampler { namespace sf2 { Line 128  namespace LinuxSampler { namespace sf2 {
128              }              }
129          }*/ // TODO: ^^^          }*/ // TODO: ^^^
130      }      }
131        
132        void Voice::ProcessChannelPressureEvent(RTList<Event>::Iterator& itEvent) {
133            //TODO: ...
134        }
135        
136        void Voice::ProcessPolyphonicKeyPressureEvent(RTList<Event>::Iterator& itEvent) {
137            //TODO: ...
138        }
139    
140      void Voice::ProcessCutoffEvent(RTList<Event>::Iterator& itEvent) {      void Voice::ProcessCutoffEvent(RTList<Event>::Iterator& itEvent) {
141          /*int ccvalue = itEvent->Param.CC.Value;          /*int ccvalue = itEvent->Param.CC.Value;
# Line 297  namespace LinuxSampler { namespace sf2 { Line 306  namespace LinuxSampler { namespace sf2 {
306                  ctrl = 83;                  ctrl = 83;
307                  break;                  break;
308              case ::gig::vcf_cutoff_ctrl_aftertouch:              case ::gig::vcf_cutoff_ctrl_aftertouch:
309                  ctrl = 128;                  ctrl = CTRL_TABLE_IDX_AFTERTOUCH;
310                  break;                  break;
311              case ::gig::vcf_cutoff_ctrl_none:              case ::gig::vcf_cutoff_ctrl_none:
312              default:              default:
# Line 334  namespace LinuxSampler { namespace sf2 { Line 343  namespace LinuxSampler { namespace sf2 {
343      }      }
344    
345      void Voice::ProcessGroupEvent(RTList<Event>::Iterator& itEvent) {      void Voice::ProcessGroupEvent(RTList<Event>::Iterator& itEvent) {
346          if (itEvent->Param.Note.Key != MIDIKey) {          if (itEvent->Param.Note.Key != HostKey()) {
347              // kill the voice fast              // kill the voice fast
348              SignalRack.EnterFadeOutStage();              SignalRack.EnterFadeOutStage();
349          }          }
# Line 344  namespace LinuxSampler { namespace sf2 { Line 353  namespace LinuxSampler { namespace sf2 {
353          SignalRack.CalculateFadeOutCoeff(FadeOutTime, SampleRate);          SignalRack.CalculateFadeOutCoeff(FadeOutTime, SampleRate);
354      }      }
355    
356        int Voice::CalculatePan(uint8_t pan) {
357            int p = pan + RgnInfo.Pan;
358    
359            if (p < 0) return 0;
360            if (p > 127) return 127;
361            return p;
362        }
363    
364  }} // namespace LinuxSampler::sf2  }} // namespace LinuxSampler::sf2

Legend:
Removed from v.2327  
changed lines
  Added in v.3034

  ViewVC Help
Powered by ViewVC