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 - 2008 Christian Schoenebeck * |
* Copyright (C) 2005 - 2008 Christian Schoenebeck * |
7 |
* Copyright (C) 2009 - 2012 Christian Schoenebeck and Grigor Iliev * |
* Copyright (C) 2009 - 2016 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 * |
29 |
|
|
30 |
namespace LinuxSampler { namespace sf2 { |
namespace LinuxSampler { namespace sf2 { |
31 |
|
|
32 |
typedef LinuxSampler::VoiceBase<EngineChannel, ::sf2::Region, ::sf2::Sample, DiskThread> SF2Voice; |
typedef LinuxSampler::VoiceBase<EngineChannel, ::sf2::Region, ::sf2::Sample, DiskThread> SF2VoiceBase; |
33 |
Voice::Voice(): SignalRack(this), SF2Voice(&SignalRack) { |
|
34 |
|
Voice::Voice(): SF2VoiceBase(&SignalRack), SignalRack(this) { |
35 |
pEngine = NULL; |
pEngine = NULL; |
36 |
pEG1 = NULL; |
pEG1 = NULL; |
37 |
pEG2 = NULL; |
pEG2 = NULL; |
62 |
si.ChannelCount = pSample->GetChannelCount(); |
si.ChannelCount = pSample->GetChannelCount(); |
63 |
si.FrameSize = pSample->GetFrameSize(); |
si.FrameSize = pSample->GetFrameSize(); |
64 |
si.BitDepth = (pSample->GetFrameSize() / pSample->GetChannelCount()) * 8; |
si.BitDepth = (pSample->GetFrameSize() / pSample->GetChannelCount()) * 8; |
65 |
si.TotalFrameCount = pSample->GetTotalFrameCount(); |
si.TotalFrameCount = (uint)pSample->GetTotalFrameCount(); |
66 |
|
|
67 |
si.HasLoops = pRegion->HasLoop; |
si.HasLoops = pRegion->HasLoop; |
68 |
si.LoopStart = (si.HasLoops) ? pRegion->LoopStart : 0; |
si.LoopStart = (si.HasLoops) ? pRegion->LoopStart : 0; |
128 |
} |
} |
129 |
}*/ // TODO: ^^^ |
}*/ // TODO: ^^^ |
130 |
} |
} |
131 |
|
|
132 |
|
void Voice::ProcessChannelPressureEvent(RTList<Event>::Iterator& itEvent) { |
133 |
|
//TODO: ... |
134 |
|
} |
135 |
|
|
136 |
|
void Voice::ProcessPolyphonicKeyPressureEvent(RTList<Event>::Iterator& itEvent) { |
137 |
|
//TODO: ... |
138 |
|
} |
139 |
|
|
140 |
void Voice::ProcessCutoffEvent(RTList<Event>::Iterator& itEvent) { |
void Voice::ProcessCutoffEvent(RTList<Event>::Iterator& itEvent) { |
141 |
/*int ccvalue = itEvent->Param.CC.Value; |
/*int ccvalue = itEvent->Param.CC.Value; |
306 |
ctrl = 83; |
ctrl = 83; |
307 |
break; |
break; |
308 |
case ::gig::vcf_cutoff_ctrl_aftertouch: |
case ::gig::vcf_cutoff_ctrl_aftertouch: |
309 |
ctrl = 128; |
ctrl = CTRL_TABLE_IDX_AFTERTOUCH; |
310 |
break; |
break; |
311 |
case ::gig::vcf_cutoff_ctrl_none: |
case ::gig::vcf_cutoff_ctrl_none: |
312 |
default: |
default: |
343 |
} |
} |
344 |
|
|
345 |
void Voice::ProcessGroupEvent(RTList<Event>::Iterator& itEvent) { |
void Voice::ProcessGroupEvent(RTList<Event>::Iterator& itEvent) { |
346 |
if (itEvent->Param.Note.Key != MIDIKey) { |
if (itEvent->Param.Note.Key != HostKey()) { |
347 |
// kill the voice fast |
// kill the voice fast |
348 |
SignalRack.EnterFadeOutStage(); |
SignalRack.EnterFadeOutStage(); |
349 |
} |
} |
353 |
SignalRack.CalculateFadeOutCoeff(FadeOutTime, SampleRate); |
SignalRack.CalculateFadeOutCoeff(FadeOutTime, SampleRate); |
354 |
} |
} |
355 |
|
|
356 |
|
int Voice::CalculatePan(uint8_t pan) { |
357 |
|
int p = pan + RgnInfo.Pan; |
358 |
|
|
359 |
|
if (p < 0) return 0; |
360 |
|
if (p > 127) return 127; |
361 |
|
return p; |
362 |
|
} |
363 |
|
|
364 |
|
release_trigger_t Voice::GetReleaseTriggerFlags() { |
365 |
|
return release_trigger_none; |
366 |
|
} |
367 |
|
|
368 |
}} // namespace LinuxSampler::sf2 |
}} // namespace LinuxSampler::sf2 |