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 * |
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 |