/[svn]/linuxsampler/trunk/src/engines/gig/EGADSR.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/gig/EGADSR.cpp

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

revision 796 by persson, Sun Oct 30 08:35:13 2005 UTC revision 797 by persson, Wed Nov 2 19:26:15 2005 UTC
# Line 200  namespace LinuxSampler { namespace gig { Line 200  namespace LinuxSampler { namespace gig {
200      void EGADSR::enterAttackStage(const uint PreAttack, const float AttackTime, const uint SampleRate) {      void EGADSR::enterAttackStage(const uint PreAttack, const float AttackTime, const uint SampleRate) {
201          Stage   = stage_attack;          Stage   = stage_attack;
202          Segment = segment_lin;          Segment = segment_lin;
203          // Measurements of GSt output shows that the real attack time  
204          // is about 65.5% of the value specified in the gig file.          if (AttackTime >= 0.0005f) {
205          StepsLeft = (int) (0.655f * AttackTime * SampleRate);              // Measurements of GSt output shows that the real attack time
206          if (StepsLeft) {              // is about 65.5% of the value specified in the gig file.
207                // The minimum attack value used is 0.032.
208                StepsLeft = int(0.655f * RTMath::Max(AttackTime, 0.032f) * SampleRate);
209              Level = (float) PreAttack / 1000.0;              Level = (float) PreAttack / 1000.0;
210              Coeff = 0.896f * (1.0f - Level) / StepsLeft; // max level is a bit lower if attack != 0              Coeff = 0.896f * (1.0f - Level) / StepsLeft; // max level is a bit lower if attack != 0
211          } else { // immediately jump to the next stage          } else { // attack is zero - immediately jump to the next stage
212              Level = 1.0;              Level = 1.0;
213              if (HoldAttack) enterAttackHoldStage();              if (HoldAttack) enterAttackHoldStage();
214              else            enterDecay1Part1Stage(SampleRate);              else            enterDecay1Part1Stage(SampleRate);

Legend:
Removed from v.796  
changed lines
  Added in v.797

  ViewVC Help
Powered by ViewVC