/[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 2055 by persson, Sat Jan 30 10:30:02 2010 UTC revision 2408 by persson, Sat Feb 2 08:22:49 2013 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
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 - 2010 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2013 Christian Schoenebeck                       *
7   *                                                                         *   *                                                                         *
8   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
9   *   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 172  namespace LinuxSampler { namespace gig { Line 172  namespace LinuxSampler { namespace gig {
172          Stage   = stage_attack;          Stage   = stage_attack;
173          Segment = segment_lin;          Segment = segment_lin;
174    
175          if (AttackTime >= 0.0005f) {          if (AttackTime >= 1e-8) {
176              // Measurements of GSt output shows that the real attack time              // Measurements of GSt output shows that the real attack time
177              // is about 65.5% of the value specified in the gig file.              // is about 65.5% of the value specified in the gig file.
178              // The minimum attack value used is 0.032.              // The minimum attack value used is 0.0316.
179              StepsLeft = int(0.655f * RTMath::Max(AttackTime, 0.032f) * SampleRate);              StepsLeft = int(0.655f * RTMath::Max(AttackTime, 0.0316f) * SampleRate);
180              Level = (float) PreAttack / 1000.0;              Level = (float) PreAttack / 1000.0;
181              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
182          } else { // attack is zero - immediately jump to the next stage          } else { // attack is zero - immediately jump to the next stage

Legend:
Removed from v.2055  
changed lines
  Added in v.2408

  ViewVC Help
Powered by ViewVC