/[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 2114 by persson, Tue Aug 10 12:05:19 2010 UTC revision 2175 by persson, Mon Apr 25 08:12:36 2011 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 - 2010 Christian Schoenebeck and Grigor Iliev      *   *   Copyright (C) 2009 - 2011 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 32  namespace LinuxSampler { namespace sf2 { Line 32  namespace LinuxSampler { namespace sf2 {
32      Voice::Voice() {      Voice::Voice() {
33          pEngine = NULL;          pEngine = NULL;
34          pEG1 = &EG1;          pEG1 = &EG1;
35            pEG2 = &EG2;
36      }      }
37    
38      Voice::~Voice() {      Voice::~Voice() {
# Line 106  namespace LinuxSampler { namespace sf2 { Line 107  namespace LinuxSampler { namespace sf2 {
107          ri.EG3Attack     = 0; // TODO:          ri.EG3Attack     = 0; // TODO:
108          ri.EG3Depth      = 0; // TODO:          ri.EG3Depth      = 0; // TODO:
109          ri.VCFEnabled    = false; // TODO:          ri.VCFEnabled    = false; // TODO:
110          ri.VCFType       = ::gig::vcf_type_lowpass; // TODO:          ri.VCFType       = Filter::vcf_type_2p_lowpass; // TODO:
111          ri.VCFResonance  = 0; // TODO:          ri.VCFResonance  = 0; // TODO:
112    
113          ri.ReleaseTriggerDecay = 0; // TODO:          ri.ReleaseTriggerDecay = 0; // TODO:
# Line 265  namespace LinuxSampler { namespace sf2 { Line 266  namespace LinuxSampler { namespace sf2 {
266          return eg;          return eg;
267      }      }
268    
269        void Voice::TriggerEG2(const EGInfo& egInfo, double velrelease, double velocityAttenuation, uint sampleRate, uint8_t velocity) {
270            EG2.trigger(uint(RgnInfo.EG2PreAttack),
271                        RgnInfo.EG2Attack * egInfo.Attack,
272                        false,
273                        RgnInfo.EG2Decay1 * egInfo.Decay * velrelease,
274                        RgnInfo.EG2Decay2 * egInfo.Decay * velrelease,
275                        RgnInfo.EG2InfiniteSustain,
276                        uint(RgnInfo.EG2Sustain),
277                        RgnInfo.EG2Release * egInfo.Release * velrelease,
278                        velocityAttenuation,
279                        sampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE);
280        }
281    
282      void Voice::InitLFO1() {      void Voice::InitLFO1() {
283          /*uint16_t lfo1_internal_depth;          /*uint16_t lfo1_internal_depth;
284          switch (pRegion->LFO1Controller) {          switch (pRegion->LFO1Controller) {
# Line 403  namespace LinuxSampler { namespace sf2 { Line 417  namespace LinuxSampler { namespace sf2 {
417      float Voice::CalculateCutoffBase(uint8_t MIDIKeyVelocity) {      float Voice::CalculateCutoffBase(uint8_t MIDIKeyVelocity) {
418          /*float cutoff = pRegion->GetVelocityCutoff(MIDIKeyVelocity);          /*float cutoff = pRegion->GetVelocityCutoff(MIDIKeyVelocity);
419          if (pRegion->VCFKeyboardTracking) {          if (pRegion->VCFKeyboardTracking) {
420              cutoff *= exp((MIDIKeyVelocity - pRegion->VCFKeyboardTrackingBreakpoint) * 0.057762265f); // (ln(2) / 12)              cutoff *= RTMath::CentsToFreqRatioUnlimited((MIDIKey - pRegion->VCFKeyboardTrackingBreakpoint) * 100);
421          }          }
422          return cutoff;*/ // TODO: ^^^          return cutoff;*/ // TODO: ^^^
423          return 1.0f;          return 1.0f;

Legend:
Removed from v.2114  
changed lines
  Added in v.2175

  ViewVC Help
Powered by ViewVC