/[svn]/linuxsampler/trunk/src/engines/sf2/Voice.cpp
ViewVC logotype

Contents of /linuxsampler/trunk/src/engines/sf2/Voice.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2175 - (show annotations) (download)
Mon Apr 25 08:12:36 2011 UTC (13 years ago) by persson
File size: 22666 byte(s)
* sfz engine: implemeted filters. Filter types: lowpass, bandpass,
  bandreject and highpass. 1, 2, 4 and 6 pole filters. Opcodes:
  fil_type, cutoff, resonance, fil_veltrack, fil_keytrack,
  fil_keycenter, cutoff_cc, cutoff_chanaft.
* sfz engine: bugfix: zero ampeg_sustain didn't work
* gig engine: bugfix: pitch LFO controller "internal+aftertouch" was broken
* gig engine: bugfix: filter keyboard tracking was broken
* gig engine: filter performance fix (an unnecessary copy was made of
  the filter parameters in each sub fragment)
* ASIO driver: fixes for newer gcc versions (fix from PortAudio)

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

  ViewVC Help
Powered by ViewVC