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 Christian Schoenebeck * |
* Copyright (C) 2005, 2006 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This library is free software; you can redistribute it and/or modify * |
* This library 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 * |
93 |
return (Level += Coeff); |
return (Level += Coeff); |
94 |
} |
} |
95 |
|
|
96 |
|
/** |
97 |
|
* Returns the level which this envelope will have in |
98 |
|
* \a SamplePoints steps. It will not alter anything. |
99 |
|
*/ |
100 |
|
inline float level(const int SamplePoints) const { |
101 |
|
return Level + RTMath::Min(SamplePoints, StepsLeft) * Coeff; |
102 |
|
} |
103 |
|
|
104 |
private: |
private: |
105 |
float Level; ///< current EG output level |
float Level; ///< current EG output level |
106 |
float Coeff; ///< linear coefficient for changing the output level in time |
float Coeff; ///< linear coefficient for changing the output level in time |