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

Contents of /linuxsampler/trunk/src/engines/gig/EGDecay.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1149 - (show annotations) (download)
Sat Apr 7 22:32:47 2007 UTC (16 years, 11 months ago) by schoenebeck
File size: 2191 byte(s)
* minor fix of EGDecay
* fixed compilation errors regarding OSX
(patch by Toshi Nagata)

1 /***************************************************************************
2 * *
3 * LinuxSampler - modular, streaming capable sampler *
4 * *
5 * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck *
6 * Copyright (C) 2005, 2007 Christian Schoenebeck *
7 * *
8 * 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 *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21 * MA 02111-1307 USA *
22 ***************************************************************************/
23
24 #include "EGDecay.h"
25
26 namespace LinuxSampler { namespace gig {
27
28 EGDecay::EGDecay() {
29 }
30
31 void EGDecay::trigger(float Depth, float DecayTime, unsigned int SampleRate) {
32 this->Level = Depth;
33
34 // calculate decay parameters (lin. curve)
35 StepsLeft = (int) (DecayTime * SampleRate);
36 Coeff = (StepsLeft) ? (1.0f - Depth) / (float) StepsLeft : 0.0f;
37
38 dmsg(4,("Depth=%d, DecayTime=%f\n", Depth, DecayTime));
39 }
40
41 }} // namespace LinuxSampler::gig

  ViewVC Help
Powered by ViewVC