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 - 2009 Christian Schoenebeck * |
* Copyright (C) 2005 - 2008 Christian Schoenebeck * |
7 |
* Copyright (C) 2009 Grigor Iliev * |
* Copyright (C) 2009 - 2010 Christian Schoenebeck and Grigor Iliev * |
8 |
* * |
* * |
9 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
10 |
* 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 * |
30 |
namespace LinuxSampler { namespace sf2 { |
namespace LinuxSampler { namespace sf2 { |
31 |
|
|
32 |
Voice::Voice() { |
Voice::Voice() { |
33 |
pEngine = NULL; |
pEngine = NULL; |
34 |
|
pEG1 = &EG1; |
35 |
} |
} |
36 |
|
|
37 |
Voice::~Voice() { |
Voice::~Voice() { |
216 |
return eg; |
return eg; |
217 |
} |
} |
218 |
|
|
219 |
|
void Voice::TriggerEG1(const EGInfo& egInfo, double velrelease, double velocityAttenuation, uint sampleRate, uint8_t velocity) { |
220 |
|
EG1.trigger(uint(RgnInfo.EG1PreAttack), |
221 |
|
RgnInfo.EG1Attack * egInfo.Attack, |
222 |
|
RgnInfo.EG1Hold, |
223 |
|
RgnInfo.EG1Decay1 * egInfo.Decay * velrelease, |
224 |
|
RgnInfo.EG1Decay2 * egInfo.Decay * velrelease, |
225 |
|
RgnInfo.EG1InfiniteSustain, |
226 |
|
uint(RgnInfo.EG1Sustain), |
227 |
|
RgnInfo.EG1Release * egInfo.Release * velrelease, |
228 |
|
velocityAttenuation, |
229 |
|
sampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE); |
230 |
|
} |
231 |
|
|
232 |
double Voice::GetEG2ControllerValue(uint8_t MIDIKeyVelocity) { |
double Voice::GetEG2ControllerValue(uint8_t MIDIKeyVelocity) { |
233 |
/*double eg2controllervalue = 0; |
/*double eg2controllervalue = 0; |
234 |
switch (pRegion->EG2Controller.type) { |
switch (pRegion->EG2Controller.type) { |