1 |
/*************************************************************************** |
2 |
* * |
3 |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005 - 2008 Christian Schoenebeck * |
7 |
* Copyright (C) 2009 - 2010 Christian Schoenebeck and Grigor Iliev * |
8 |
* * |
9 |
* 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 * |
11 |
* the Free Software Foundation; either version 2 of the License, or * |
12 |
* (at your option) any later version. * |
13 |
* * |
14 |
* This program is distributed in the hope that it will be useful, * |
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
17 |
* GNU General Public License for more details. * |
18 |
* * |
19 |
* You should have received a copy of the GNU General Public License * |
20 |
* along with this program; if not, write to the Free Software * |
21 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, * |
22 |
* MA 02111-1307 USA * |
23 |
***************************************************************************/ |
24 |
|
25 |
#include "Voice.h" |
26 |
|
27 |
#include "Engine.h" |
28 |
#include "EngineChannel.h" |
29 |
|
30 |
namespace LinuxSampler { namespace sf2 { |
31 |
|
32 |
Voice::Voice() { |
33 |
pEngine = NULL; |
34 |
pEG1 = &EG1; |
35 |
} |
36 |
|
37 |
Voice::~Voice() { |
38 |
|
39 |
} |
40 |
|
41 |
EngineChannel* Voice::GetSf2EngineChannel() { |
42 |
return static_cast<EngineChannel*>(pEngineChannel); |
43 |
} |
44 |
|
45 |
void Voice::SetEngine(LinuxSampler::Engine* pEngine) { |
46 |
Engine* engine = static_cast<Engine*>(pEngine); |
47 |
this->pEngine = engine; |
48 |
this->pDiskThread = engine->pDiskThread; |
49 |
dmsg(6,("Voice::SetEngine()\n")); |
50 |
} |
51 |
|
52 |
Voice::SampleInfo Voice::GetSampleInfo() { |
53 |
SampleInfo si; |
54 |
si.SampleRate = pSample->SampleRate; |
55 |
si.ChannelCount = pSample->GetChannelCount(); |
56 |
si.FrameSize = pSample->GetFrameSize(); |
57 |
si.BitDepth = (pSample->GetFrameSize() / pSample->GetChannelCount()) * 8; |
58 |
si.TotalFrameCount = pSample->GetTotalFrameCount(); |
59 |
|
60 |
si.HasLoops = pRegion->HasLoop; |
61 |
si.LoopStart = (si.HasLoops) ? pRegion->LoopStart : 0; |
62 |
si.LoopLength = (si.HasLoops) ? ((pRegion->LoopEnd) - pRegion->LoopStart): 0; |
63 |
si.LoopPlayCount = 0; // TODO: |
64 |
si.Unpitched = pSample->IsUnpitched(); |
65 |
|
66 |
return si; |
67 |
} |
68 |
|
69 |
Voice::RegionInfo Voice::GetRegionInfo() { |
70 |
::sf2::Region* reg = NULL; |
71 |
::sf2::Preset* preset = GetSf2EngineChannel()->pInstrument; |
72 |
for (int i = 0; i < preset->GetRegionCount(); i++) { // TODO: some optimization? |
73 |
if (preset->GetRegion(i)->pInstrument == pRegion->GetParentInstrument()) { |
74 |
reg = preset->GetRegion(i); // TODO: Can the instrument belongs to more than one preset regions? |
75 |
break; |
76 |
} |
77 |
} |
78 |
|
79 |
RegionInfo ri; |
80 |
ri.UnityNote = pRegion->GetUnityNote(); |
81 |
ri.FineTune = pRegion->GetFineTune(reg) + (pRegion->GetCoarseTune(reg) * 100); |
82 |
ri.Pan = pRegion->GetPan(reg); |
83 |
ri.SampleStartOffset = pRegion->startAddrsOffset + pRegion->startAddrsCoarseOffset; |
84 |
|
85 |
// sample amplitude |
86 |
ri.EG1PreAttack = 1000; |
87 |
ri.EG1Attack = pRegion->GetEG1Attack(reg); |
88 |
ri.EG1Hold = pRegion->GetEG1Hold(reg); |
89 |
ri.EG1Decay1 = pRegion->GetEG1Decay(reg); |
90 |
ri.EG1Decay2 = pRegion->GetEG1Decay(reg); |
91 |
ri.EG1Sustain = pRegion->GetEG1Sustain(reg); |
92 |
ri.EG1InfiniteSustain = true; |
93 |
ri.EG1Release = pRegion->GetEG1Release(reg); |
94 |
|
95 |
// filter cutoff frequency |
96 |
ri.EG2PreAttack = 1000; |
97 |
ri.EG2Attack = pRegion->GetEG2Attack(reg); |
98 |
//ri.EG2Hold = pRegion->EG2Hold; // TODO: |
99 |
ri.EG2Decay1 = pRegion->GetEG2Decay(reg); |
100 |
ri.EG2Decay2 = pRegion->GetEG2Decay(reg); |
101 |
ri.EG2Sustain = pRegion->GetEG2Sustain(reg); |
102 |
ri.EG2InfiniteSustain = true; |
103 |
ri.EG2Release = pRegion->GetEG2Release(reg); |
104 |
|
105 |
// sample pitch |
106 |
ri.EG3Attack = 0; // TODO: |
107 |
ri.EG3Depth = 0; // TODO: |
108 |
ri.VCFEnabled = false; // TODO: |
109 |
ri.VCFType = ::gig::vcf_type_lowpass; // TODO: |
110 |
ri.VCFResonance = 0; // TODO: |
111 |
|
112 |
ri.ReleaseTriggerDecay = 0; // TODO: |
113 |
|
114 |
return ri; |
115 |
} |
116 |
|
117 |
Voice::InstrumentInfo Voice::GetInstrumentInfo() { |
118 |
InstrumentInfo ii; |
119 |
ii.FineTune = 0; // TODO: |
120 |
ii.PitchbendRange = 2; // TODO: |
121 |
|
122 |
return ii; |
123 |
} |
124 |
|
125 |
double Voice::GetSampleAttenuation() { |
126 |
return 1.0; // TODO: |
127 |
} |
128 |
|
129 |
double Voice::GetVelocityAttenuation(uint8_t MIDIKeyVelocity) { |
130 |
return double(MIDIKeyVelocity) / 127.0f; // TODO: |
131 |
} |
132 |
|
133 |
double Voice::GetVelocityRelease(uint8_t MIDIKeyVelocity) { |
134 |
return 0.9; // TODO: |
135 |
} |
136 |
|
137 |
void Voice::ProcessCCEvent(RTList<Event>::Iterator& itEvent) { |
138 |
/*if (itEvent->Type == Event::type_control_change && itEvent->Param.CC.Controller) { // if (valid) MIDI control change event |
139 |
if (pRegion->AttenuationController.type == ::gig::attenuation_ctrl_t::type_controlchange && |
140 |
itEvent->Param.CC.Controller == pRegion->AttenuationController.controller_number) { |
141 |
CrossfadeSmoother.update(AbstractEngine::CrossfadeCurve[CrossfadeAttenuation(itEvent->Param.CC.Value)]); |
142 |
} |
143 |
}*/ // TODO: ^^^ |
144 |
} |
145 |
|
146 |
void Voice::ProcessCutoffEvent(RTList<Event>::Iterator& itEvent) { |
147 |
/*int ccvalue = itEvent->Param.CC.Value; |
148 |
if (VCFCutoffCtrl.value == ccvalue) return; |
149 |
VCFCutoffCtrl.value == ccvalue; |
150 |
if (pRegion->VCFCutoffControllerInvert) ccvalue = 127 - ccvalue; |
151 |
if (ccvalue < pRegion->VCFVelocityScale) ccvalue = pRegion->VCFVelocityScale; |
152 |
float cutoff = CutoffBase * float(ccvalue); |
153 |
if (cutoff > 127.0f) cutoff = 127.0f; |
154 |
|
155 |
VCFCutoffCtrl.fvalue = cutoff; // needed for initialization of fFinalCutoff next time |
156 |
fFinalCutoff = cutoff;*/ // TODO: ^^^ |
157 |
} |
158 |
|
159 |
double Voice::CalculateCrossfadeVolume(uint8_t MIDIKeyVelocity) { |
160 |
/*float crossfadeVolume; |
161 |
switch (pRegion->AttenuationController.type) { |
162 |
case ::gig::attenuation_ctrl_t::type_channelaftertouch: |
163 |
crossfadeVolume = Engine::CrossfadeCurve[CrossfadeAttenuation(GetSf2EngineChannel()->ControllerTable[128])]; |
164 |
break; |
165 |
case ::gig::attenuation_ctrl_t::type_velocity: |
166 |
crossfadeVolume = Engine::CrossfadeCurve[CrossfadeAttenuation(MIDIKeyVelocity)]; |
167 |
break; |
168 |
case ::gig::attenuation_ctrl_t::type_controlchange: //FIXME: currently not sample accurate |
169 |
crossfadeVolume = Engine::CrossfadeCurve[CrossfadeAttenuation(GetSf2EngineChannel()->ControllerTable[pRegion->AttenuationController.controller_number])]; |
170 |
break; |
171 |
case ::gig::attenuation_ctrl_t::type_none: // no crossfade defined |
172 |
default: |
173 |
crossfadeVolume = 1.0f; |
174 |
} |
175 |
|
176 |
return crossfadeVolume;*/ // TODO: ^^^ |
177 |
return 1.0f; |
178 |
} |
179 |
|
180 |
double Voice::GetEG1ControllerValue(uint8_t MIDIKeyVelocity) { |
181 |
/*double eg1controllervalue = 0; |
182 |
switch (pRegion->EG1Controller.type) { |
183 |
case ::gig::eg1_ctrl_t::type_none: // no controller defined |
184 |
eg1controllervalue = 0; |
185 |
break; |
186 |
case ::gig::eg1_ctrl_t::type_channelaftertouch: |
187 |
eg1controllervalue = GetSf2EngineChannel()->ControllerTable[128]; |
188 |
break; |
189 |
case ::gig::eg1_ctrl_t::type_velocity: |
190 |
eg1controllervalue = MIDIKeyVelocity; |
191 |
break; |
192 |
case ::gig::eg1_ctrl_t::type_controlchange: // MIDI control change controller |
193 |
eg1controllervalue = GetSf2EngineChannel()->ControllerTable[pRegion->EG1Controller.controller_number]; |
194 |
break; |
195 |
} |
196 |
if (pRegion->EG1ControllerInvert) eg1controllervalue = 127 - eg1controllervalue; |
197 |
|
198 |
return eg1controllervalue;*/ // TODO: ^^^ |
199 |
return 0; |
200 |
} |
201 |
|
202 |
Voice::EGInfo Voice::CalculateEG1ControllerInfluence(double eg1ControllerValue) { |
203 |
/*EGInfo eg; |
204 |
// (eg1attack is different from the others) |
205 |
eg.Attack = (pRegion->EG1ControllerAttackInfluence) ? |
206 |
1 + 0.031 * (double) (pRegion->EG1ControllerAttackInfluence == 1 ? |
207 |
1 : 1 << pRegion->EG1ControllerAttackInfluence) * eg1ControllerValue : 1.0; |
208 |
eg.Decay = (pRegion->EG1ControllerDecayInfluence) ? 1 + 0.00775 * (double) (1 << pRegion->EG1ControllerDecayInfluence) * eg1ControllerValue : 1.0; |
209 |
eg.Release = (pRegion->EG1ControllerReleaseInfluence) ? 1 + 0.00775 * (double) (1 << pRegion->EG1ControllerReleaseInfluence) * eg1ControllerValue : 1.0; |
210 |
|
211 |
return eg;*/ // TODO: ^^^ |
212 |
EGInfo eg; |
213 |
eg.Attack = 1.0; |
214 |
eg.Decay = 1.0; |
215 |
eg.Release = 1.0; |
216 |
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) { |
233 |
/*double eg2controllervalue = 0; |
234 |
switch (pRegion->EG2Controller.type) { |
235 |
case ::gig::eg2_ctrl_t::type_none: // no controller defined |
236 |
eg2controllervalue = 0; |
237 |
break; |
238 |
case ::gig::eg2_ctrl_t::type_channelaftertouch: |
239 |
eg2controllervalue = GetSf2EngineChannel()->ControllerTable[128]; |
240 |
break; |
241 |
case ::gig::eg2_ctrl_t::type_velocity: |
242 |
eg2controllervalue = MIDIKeyVelocity; |
243 |
break; |
244 |
case ::gig::eg2_ctrl_t::type_controlchange: // MIDI control change controller |
245 |
eg2controllervalue = GetSf2EngineChannel()->ControllerTable[pRegion->EG2Controller.controller_number]; |
246 |
break; |
247 |
} |
248 |
if (pRegion->EG2ControllerInvert) eg2controllervalue = 127 - eg2controllervalue; |
249 |
|
250 |
return eg2controllervalue;*/ // TODO: ^^^ |
251 |
return 0; |
252 |
} |
253 |
|
254 |
Voice::EGInfo Voice::CalculateEG2ControllerInfluence(double eg2ControllerValue) { |
255 |
/*EGInfo eg; |
256 |
eg.Attack = (pRegion->EG2ControllerAttackInfluence) ? 1 + 0.00775 * (double) (1 << pRegion->EG2ControllerAttackInfluence) * eg2ControllerValue : 1.0; |
257 |
eg.Decay = (pRegion->EG2ControllerDecayInfluence) ? 1 + 0.00775 * (double) (1 << pRegion->EG2ControllerDecayInfluence) * eg2ControllerValue : 1.0; |
258 |
eg.Release = (pRegion->EG2ControllerReleaseInfluence) ? 1 + 0.00775 * (double) (1 << pRegion->EG2ControllerReleaseInfluence) * eg2ControllerValue : 1.0; |
259 |
|
260 |
return eg;*/ // TODO: ^^^ |
261 |
EGInfo eg; |
262 |
eg.Attack = 1.0; |
263 |
eg.Decay = 1.0; |
264 |
eg.Release = 1.0; |
265 |
return eg; |
266 |
} |
267 |
|
268 |
void Voice::InitLFO1() { |
269 |
/*uint16_t lfo1_internal_depth; |
270 |
switch (pRegion->LFO1Controller) { |
271 |
case ::gig::lfo1_ctrl_internal: |
272 |
lfo1_internal_depth = pRegion->LFO1InternalDepth; |
273 |
pLFO1->ExtController = 0; // no external controller |
274 |
bLFO1Enabled = (lfo1_internal_depth > 0); |
275 |
break; |
276 |
case ::gig::lfo1_ctrl_modwheel: |
277 |
lfo1_internal_depth = 0; |
278 |
pLFO1->ExtController = 1; // MIDI controller 1 |
279 |
bLFO1Enabled = (pRegion->LFO1ControlDepth > 0); |
280 |
break; |
281 |
case ::gig::lfo1_ctrl_breath: |
282 |
lfo1_internal_depth = 0; |
283 |
pLFO1->ExtController = 2; // MIDI controller 2 |
284 |
bLFO1Enabled = (pRegion->LFO1ControlDepth > 0); |
285 |
break; |
286 |
case ::gig::lfo1_ctrl_internal_modwheel: |
287 |
lfo1_internal_depth = pRegion->LFO1InternalDepth; |
288 |
pLFO1->ExtController = 1; // MIDI controller 1 |
289 |
bLFO1Enabled = (lfo1_internal_depth > 0 || pRegion->LFO1ControlDepth > 0); |
290 |
break; |
291 |
case ::gig::lfo1_ctrl_internal_breath: |
292 |
lfo1_internal_depth = pRegion->LFO1InternalDepth; |
293 |
pLFO1->ExtController = 2; // MIDI controller 2 |
294 |
bLFO1Enabled = (lfo1_internal_depth > 0 || pRegion->LFO1ControlDepth > 0); |
295 |
break; |
296 |
default: |
297 |
lfo1_internal_depth = 0; |
298 |
pLFO1->ExtController = 0; // no external controller |
299 |
bLFO1Enabled = false; |
300 |
} |
301 |
if (bLFO1Enabled) { |
302 |
pLFO1->trigger(pRegion->LFO1Frequency, |
303 |
start_level_min, |
304 |
lfo1_internal_depth, |
305 |
pRegion->LFO1ControlDepth, |
306 |
pRegion->LFO1FlipPhase, |
307 |
pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE); |
308 |
pLFO1->update(pLFO1->ExtController ? GetSf2EngineChannel()->ControllerTable[pLFO1->ExtController] : 0); |
309 |
}*/ // TODO: ^^^ |
310 |
bLFO1Enabled = false; |
311 |
} |
312 |
|
313 |
void Voice::InitLFO2() { |
314 |
/*uint16_t lfo2_internal_depth; |
315 |
switch (pRegion->LFO2Controller) { |
316 |
case ::gig::lfo2_ctrl_internal: |
317 |
lfo2_internal_depth = pRegion->LFO2InternalDepth; |
318 |
pLFO2->ExtController = 0; // no external controller |
319 |
bLFO2Enabled = (lfo2_internal_depth > 0); |
320 |
break; |
321 |
case ::gig::lfo2_ctrl_modwheel: |
322 |
lfo2_internal_depth = 0; |
323 |
pLFO2->ExtController = 1; // MIDI controller 1 |
324 |
bLFO2Enabled = (pRegion->LFO2ControlDepth > 0); |
325 |
break; |
326 |
case ::gig::lfo2_ctrl_foot: |
327 |
lfo2_internal_depth = 0; |
328 |
pLFO2->ExtController = 4; // MIDI controller 4 |
329 |
bLFO2Enabled = (pRegion->LFO2ControlDepth > 0); |
330 |
break; |
331 |
case ::gig::lfo2_ctrl_internal_modwheel: |
332 |
lfo2_internal_depth = pRegion->LFO2InternalDepth; |
333 |
pLFO2->ExtController = 1; // MIDI controller 1 |
334 |
bLFO2Enabled = (lfo2_internal_depth > 0 || pRegion->LFO2ControlDepth > 0); |
335 |
break; |
336 |
case ::gig::lfo2_ctrl_internal_foot: |
337 |
lfo2_internal_depth = pRegion->LFO2InternalDepth; |
338 |
pLFO2->ExtController = 4; // MIDI controller 4 |
339 |
bLFO2Enabled = (lfo2_internal_depth > 0 || pRegion->LFO2ControlDepth > 0); |
340 |
break; |
341 |
default: |
342 |
lfo2_internal_depth = 0; |
343 |
pLFO2->ExtController = 0; // no external controller |
344 |
bLFO2Enabled = false; |
345 |
} |
346 |
if (bLFO2Enabled) { |
347 |
pLFO2->trigger(pRegion->LFO2Frequency, |
348 |
start_level_max, |
349 |
lfo2_internal_depth, |
350 |
pRegion->LFO2ControlDepth, |
351 |
pRegion->LFO2FlipPhase, |
352 |
pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE); |
353 |
pLFO2->update(pLFO2->ExtController ? GetSf2EngineChannel()->ControllerTable[pLFO2->ExtController] : 0); |
354 |
}*/ // TODO: ^^^ |
355 |
bLFO2Enabled = false; |
356 |
} |
357 |
|
358 |
void Voice::InitLFO3() { |
359 |
/*uint16_t lfo3_internal_depth; |
360 |
switch (pRegion->LFO3Controller) { |
361 |
case ::gig::lfo3_ctrl_internal: |
362 |
lfo3_internal_depth = pRegion->LFO3InternalDepth; |
363 |
pLFO3->ExtController = 0; // no external controller |
364 |
bLFO3Enabled = (lfo3_internal_depth > 0); |
365 |
break; |
366 |
case ::gig::lfo3_ctrl_modwheel: |
367 |
lfo3_internal_depth = 0; |
368 |
pLFO3->ExtController = 1; // MIDI controller 1 |
369 |
bLFO3Enabled = (pRegion->LFO3ControlDepth > 0); |
370 |
break; |
371 |
case ::gig::lfo3_ctrl_aftertouch: |
372 |
lfo3_internal_depth = 0; |
373 |
pLFO3->ExtController = 128; |
374 |
bLFO3Enabled = true; |
375 |
break; |
376 |
case ::gig::lfo3_ctrl_internal_modwheel: |
377 |
lfo3_internal_depth = pRegion->LFO3InternalDepth; |
378 |
pLFO3->ExtController = 1; // MIDI controller 1 |
379 |
bLFO3Enabled = (lfo3_internal_depth > 0 || pRegion->LFO3ControlDepth > 0); |
380 |
break; |
381 |
case ::gig::lfo3_ctrl_internal_aftertouch: |
382 |
lfo3_internal_depth = pRegion->LFO3InternalDepth; |
383 |
pLFO1->ExtController = 128; |
384 |
bLFO3Enabled = (lfo3_internal_depth > 0 || pRegion->LFO3ControlDepth > 0); |
385 |
break; |
386 |
default: |
387 |
lfo3_internal_depth = 0; |
388 |
pLFO3->ExtController = 0; // no external controller |
389 |
bLFO3Enabled = false; |
390 |
} |
391 |
if (bLFO3Enabled) { |
392 |
pLFO3->trigger(pRegion->LFO3Frequency, |
393 |
start_level_mid, |
394 |
lfo3_internal_depth, |
395 |
pRegion->LFO3ControlDepth, |
396 |
false, |
397 |
pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE); |
398 |
pLFO3->update(pLFO3->ExtController ? GetSf2EngineChannel()->ControllerTable[pLFO3->ExtController] : 0); |
399 |
}*/ // TODO: ^^^ |
400 |
bLFO3Enabled = false; |
401 |
} |
402 |
|
403 |
float Voice::CalculateCutoffBase(uint8_t MIDIKeyVelocity) { |
404 |
/*float cutoff = pRegion->GetVelocityCutoff(MIDIKeyVelocity); |
405 |
if (pRegion->VCFKeyboardTracking) { |
406 |
cutoff *= exp((MIDIKeyVelocity - pRegion->VCFKeyboardTrackingBreakpoint) * 0.057762265f); // (ln(2) / 12) |
407 |
} |
408 |
return cutoff;*/ // TODO: ^^^ |
409 |
return 1.0f; |
410 |
} |
411 |
|
412 |
float Voice::CalculateFinalCutoff(float cutoffBase) { |
413 |
/*int cvalue; |
414 |
if (VCFCutoffCtrl.controller) { |
415 |
cvalue = GetSf2EngineChannel()->ControllerTable[VCFCutoffCtrl.controller]; |
416 |
if (pRegion->VCFCutoffControllerInvert) cvalue = 127 - cvalue; |
417 |
// VCFVelocityScale in this case means Minimum cutoff |
418 |
if (cvalue < pRegion->VCFVelocityScale) cvalue = pRegion->VCFVelocityScale; |
419 |
} |
420 |
else { |
421 |
cvalue = pRegion->VCFCutoff; |
422 |
} |
423 |
float fco = cutoffBase * float(cvalue); |
424 |
if (fco > 127.0f) fco = 127.0f; |
425 |
|
426 |
return fco;*/ // TODO: ^^^ |
427 |
return 0.0f; |
428 |
} |
429 |
|
430 |
uint8_t Voice::GetVCFCutoffCtrl() { |
431 |
/*uint8_t ctrl; |
432 |
switch (pRegion->VCFCutoffController) { |
433 |
case ::gig::vcf_cutoff_ctrl_modwheel: |
434 |
ctrl = 1; |
435 |
break; |
436 |
case ::gig::vcf_cutoff_ctrl_effect1: |
437 |
ctrl = 12; |
438 |
break; |
439 |
case ::gig::vcf_cutoff_ctrl_effect2: |
440 |
ctrl = 13; |
441 |
break; |
442 |
case ::gig::vcf_cutoff_ctrl_breath: |
443 |
ctrl = 2; |
444 |
break; |
445 |
case ::gig::vcf_cutoff_ctrl_foot: |
446 |
ctrl = 4; |
447 |
break; |
448 |
case ::gig::vcf_cutoff_ctrl_sustainpedal: |
449 |
ctrl = 64; |
450 |
break; |
451 |
case ::gig::vcf_cutoff_ctrl_softpedal: |
452 |
ctrl = 67; |
453 |
break; |
454 |
case ::gig::vcf_cutoff_ctrl_genpurpose7: |
455 |
ctrl = 82; |
456 |
break; |
457 |
case ::gig::vcf_cutoff_ctrl_genpurpose8: |
458 |
ctrl = 83; |
459 |
break; |
460 |
case ::gig::vcf_cutoff_ctrl_aftertouch: |
461 |
ctrl = 128; |
462 |
break; |
463 |
case ::gig::vcf_cutoff_ctrl_none: |
464 |
default: |
465 |
ctrl = 0; |
466 |
break; |
467 |
} |
468 |
|
469 |
return ctrl;*/ // TODO: ^^^ |
470 |
return 0; |
471 |
} |
472 |
|
473 |
uint8_t Voice::GetVCFResonanceCtrl() { |
474 |
/*uint8_t ctrl; |
475 |
switch (pRegion->VCFResonanceController) { |
476 |
case ::gig::vcf_res_ctrl_genpurpose3: |
477 |
ctrl = 18; |
478 |
break; |
479 |
case ::gig::vcf_res_ctrl_genpurpose4: |
480 |
ctrl = 19; |
481 |
break; |
482 |
case ::gig::vcf_res_ctrl_genpurpose5: |
483 |
ctrl = 80; |
484 |
break; |
485 |
case ::gig::vcf_res_ctrl_genpurpose6: |
486 |
ctrl = 81; |
487 |
break; |
488 |
case ::gig::vcf_res_ctrl_none: |
489 |
default: |
490 |
ctrl = 0; |
491 |
} |
492 |
|
493 |
return ctrl;*/ // TODO: ^^^ |
494 |
return 0; |
495 |
} |
496 |
|
497 |
}} // namespace LinuxSampler::sf2 |