35 |
const int Voice::FILTER_UPDATE_MASK(CalculateFilterUpdateMask()); |
const int Voice::FILTER_UPDATE_MASK(CalculateFilterUpdateMask()); |
36 |
|
|
37 |
float Voice::CalculateFilterCutoffCoeff() { |
float Voice::CalculateFilterCutoffCoeff() { |
38 |
return log(FILTER_CUTOFF_MIN / FILTER_CUTOFF_MAX); |
return log(CONFIG_FILTER_CUTOFF_MIN / CONFIG_FILTER_CUTOFF_MAX); |
39 |
} |
} |
40 |
|
|
41 |
int Voice::CalculateFilterUpdateMask() { |
int Voice::CalculateFilterUpdateMask() { |
42 |
if (FILTER_UPDATE_PERIOD <= 0) return 0; |
if (CONFIG_FILTER_UPDATE_STEPS <= 0) return 0; |
43 |
int power_of_two; |
int power_of_two; |
44 |
for (power_of_two = 0; 1<<power_of_two < FILTER_UPDATE_PERIOD; power_of_two++); |
for (power_of_two = 0; 1<<power_of_two < CONFIG_FILTER_UPDATE_STEPS; power_of_two++); |
45 |
return (1 << power_of_two) - 1; |
return (1 << power_of_two) - 1; |
46 |
} |
} |
47 |
|
|
117 |
* Initializes and triggers the voice, a disk stream will be launched if |
* Initializes and triggers the voice, a disk stream will be launched if |
118 |
* needed. |
* needed. |
119 |
* |
* |
120 |
* @param pEngineChannel - engine channel on which this voice was ordered |
* @param pEngineChannel - engine channel on which this voice was ordered |
121 |
* @param itNoteOnEvent - event that caused triggering of this voice |
* @param itNoteOnEvent - event that caused triggering of this voice |
122 |
* @param PitchBend - MIDI detune factor (-8192 ... +8191) |
* @param PitchBend - MIDI detune factor (-8192 ... +8191) |
123 |
* @param pInstrument - points to the loaded instrument which provides sample wave(s) and articulation data |
* @param pInstrument - points to the loaded instrument which provides sample wave(s) and articulation data |
124 |
* @param iLayer - layer number this voice refers to (only if this is a layered sound of course) |
* @param iLayer - layer number this voice refers to (only if this is a layered sound of course) |
125 |
* @param ReleaseTriggerVoice - if this new voice is a release trigger voice (optional, default = false) |
* @param ReleaseTriggerVoice - if this new voice is a release trigger voice (optional, default = false) |
126 |
* @param VoiceStealing - wether the voice is allowed to steal voices for further subvoices |
* @param VoiceStealingAllowed - wether the voice is allowed to steal voices for further subvoices |
127 |
* @returns 0 on success, a value < 0 if the voice wasn't triggered |
* @returns 0 on success, a value < 0 if the voice wasn't triggered |
128 |
* (either due to an error or e.g. because no region is |
* (either due to an error or e.g. because no region is |
129 |
* defined for the given key) |
* defined for the given key) |
130 |
*/ |
*/ |
131 |
int Voice::Trigger(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOnEvent, int PitchBend, ::gig::Instrument* pInstrument, int iLayer, bool ReleaseTriggerVoice, bool VoiceStealing) { |
int Voice::Trigger(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOnEvent, int PitchBend, ::gig::Instrument* pInstrument, int iLayer, bool ReleaseTriggerVoice, bool VoiceStealingAllowed) { |
132 |
this->pEngineChannel = pEngineChannel; |
this->pEngineChannel = pEngineChannel; |
133 |
if (!pInstrument) { |
if (!pInstrument) { |
134 |
dmsg(1,("voice::trigger: !pInstrument\n")); |
dmsg(1,("voice::trigger: !pInstrument\n")); |
145 |
Delay = itNoteOnEvent->FragmentPos(); |
Delay = itNoteOnEvent->FragmentPos(); |
146 |
itTriggerEvent = itNoteOnEvent; |
itTriggerEvent = itNoteOnEvent; |
147 |
itKillEvent = Pool<Event>::Iterator(); |
itKillEvent = Pool<Event>::Iterator(); |
|
itChildVoice = Pool<Voice>::Iterator(); |
|
148 |
|
|
149 |
if (!pRegion) { |
if (!pRegion) { |
150 |
dmsg(4, ("gig::Voice: No Region defined for MIDI key %d\n", MIDIKey)); |
dmsg(4, ("gig::Voice: No Region defined for MIDI key %d\n", MIDIKey)); |
151 |
return -1; |
return -1; |
152 |
} |
} |
153 |
|
|
154 |
KeyGroup = pRegion->KeyGroup; |
// only mark the first voice of a layered voice (group) to be in a |
155 |
|
// key group, so the layered voices won't kill each other |
156 |
|
KeyGroup = (iLayer == 0 && !ReleaseTriggerVoice) ? pRegion->KeyGroup : 0; |
157 |
|
|
158 |
// get current dimension values to select the right dimension region |
// get current dimension values to select the right dimension region |
159 |
//FIXME: controller values for selecting the dimension region here are currently not sample accurate |
//FIXME: controller values for selecting the dimension region here are currently not sample accurate |
165 |
break; |
break; |
166 |
case ::gig::dimension_layer: |
case ::gig::dimension_layer: |
167 |
DimValues[i] = iLayer; |
DimValues[i] = iLayer; |
|
// if this is the 1st layer then spawn further voices for all the other layers |
|
|
if (iLayer == 0) |
|
|
for (int iNewLayer = 1; iNewLayer < pRegion->pDimensionDefinitions[i].zones; iNewLayer++) |
|
|
itChildVoice = pEngine->LaunchVoice(pEngineChannel, itNoteOnEvent, iNewLayer, ReleaseTriggerVoice, VoiceStealing); |
|
168 |
break; |
break; |
169 |
case ::gig::dimension_velocity: |
case ::gig::dimension_velocity: |
170 |
DimValues[i] = itNoteOnEvent->Param.Note.Velocity; |
DimValues[i] = itNoteOnEvent->Param.Note.Velocity; |
179 |
case ::gig::dimension_keyboard: |
case ::gig::dimension_keyboard: |
180 |
DimValues[i] = (uint) pEngineChannel->CurrentKeyDimension; |
DimValues[i] = (uint) pEngineChannel->CurrentKeyDimension; |
181 |
break; |
break; |
182 |
|
case ::gig::dimension_roundrobin: |
183 |
|
DimValues[i] = (uint) pEngineChannel->pMIDIKeyInfo[MIDIKey].RoundRobinIndex; // incremented for each note on |
184 |
|
break; |
185 |
|
case ::gig::dimension_random: |
186 |
|
pEngine->RandomSeed = pEngine->RandomSeed * 1103515245 + 12345; // classic pseudo random number generator |
187 |
|
DimValues[i] = (uint) pEngine->RandomSeed >> (32 - pRegion->pDimensionDefinitions[i].bits); // highest bits are most random |
188 |
|
break; |
189 |
case ::gig::dimension_modwheel: |
case ::gig::dimension_modwheel: |
190 |
DimValues[i] = pEngineChannel->ControllerTable[1]; |
DimValues[i] = pEngineChannel->ControllerTable[1]; |
191 |
break; |
break; |
296 |
DiskVoice = cachedsamples < pSample->SamplesTotal; |
DiskVoice = cachedsamples < pSample->SamplesTotal; |
297 |
|
|
298 |
if (DiskVoice) { // voice to be streamed from disk |
if (DiskVoice) { // voice to be streamed from disk |
299 |
MaxRAMPos = cachedsamples - (pEngine->MaxSamplesPerCycle << MAX_PITCH) / pSample->Channels; //TODO: this calculation is too pessimistic and may better be moved to Render() method, so it calculates MaxRAMPos dependent to the current demand of sample points to be rendered (e.g. in case of JACK) |
MaxRAMPos = cachedsamples - (pEngine->MaxSamplesPerCycle << CONFIG_MAX_PITCH) / pSample->Channels; //TODO: this calculation is too pessimistic and may better be moved to Render() method, so it calculates MaxRAMPos dependent to the current demand of sample points to be rendered (e.g. in case of JACK) |
300 |
|
|
301 |
// check if there's a loop defined which completely fits into the cached (RAM) part of the sample |
// check if there's a loop defined which completely fits into the cached (RAM) part of the sample |
302 |
if (pSample->Loops && pSample->LoopEnd <= MaxRAMPos) { |
if (pSample->Loops && pSample->LoopEnd <= MaxRAMPos) { |
535 |
} |
} |
536 |
|
|
537 |
|
|
538 |
#if FORCE_FILTER_USAGE |
#if CONFIG_FORCE_FILTER |
539 |
const bool bUseFilter = true; |
const bool bUseFilter = true; |
540 |
#else // use filter only if instrument file told so |
#else // use filter only if instrument file told so |
541 |
const bool bUseFilter = pDimRgn->VCFEnabled; |
const bool bUseFilter = pDimRgn->VCFEnabled; |
542 |
#endif // FORCE_FILTER_USAGE |
#endif // CONFIG_FORCE_FILTER |
543 |
SYNTHESIS_MODE_SET_FILTER(SynthesisMode, bUseFilter); |
SYNTHESIS_MODE_SET_FILTER(SynthesisMode, bUseFilter); |
544 |
if (bUseFilter) { |
if (bUseFilter) { |
545 |
#ifdef OVERRIDE_FILTER_CUTOFF_CTRL |
#ifdef CONFIG_OVERRIDE_CUTOFF_CTRL |
546 |
VCFCutoffCtrl.controller = OVERRIDE_FILTER_CUTOFF_CTRL; |
VCFCutoffCtrl.controller = CONFIG_OVERRIDE_CUTOFF_CTRL; |
547 |
#else // use the one defined in the instrument file |
#else // use the one defined in the instrument file |
548 |
switch (pDimRgn->VCFCutoffController) { |
switch (pDimRgn->VCFCutoffController) { |
549 |
case ::gig::vcf_cutoff_ctrl_modwheel: |
case ::gig::vcf_cutoff_ctrl_modwheel: |
579 |
VCFCutoffCtrl.controller = 0; |
VCFCutoffCtrl.controller = 0; |
580 |
break; |
break; |
581 |
} |
} |
582 |
#endif // OVERRIDE_FILTER_CUTOFF_CTRL |
#endif // CONFIG_OVERRIDE_CUTOFF_CTRL |
583 |
|
|
584 |
#ifdef OVERRIDE_FILTER_RES_CTRL |
#ifdef CONFIG_OVERRIDE_RESONANCE_CTRL |
585 |
VCFResonanceCtrl.controller = OVERRIDE_FILTER_RES_CTRL; |
VCFResonanceCtrl.controller = CONFIG_OVERRIDE_RESONANCE_CTRL; |
586 |
#else // use the one defined in the instrument file |
#else // use the one defined in the instrument file |
587 |
switch (pDimRgn->VCFResonanceController) { |
switch (pDimRgn->VCFResonanceController) { |
588 |
case ::gig::vcf_res_ctrl_genpurpose3: |
case ::gig::vcf_res_ctrl_genpurpose3: |
601 |
default: |
default: |
602 |
VCFResonanceCtrl.controller = 0; |
VCFResonanceCtrl.controller = 0; |
603 |
} |
} |
604 |
#endif // OVERRIDE_FILTER_RES_CTRL |
#endif // CONFIG_OVERRIDE_RESONANCE_CTRL |
605 |
|
|
606 |
#ifndef OVERRIDE_FILTER_TYPE |
#ifndef CONFIG_OVERRIDE_FILTER_TYPE |
607 |
FilterLeft.SetType(pDimRgn->VCFType); |
FilterLeft.SetType(pDimRgn->VCFType); |
608 |
FilterRight.SetType(pDimRgn->VCFType); |
FilterRight.SetType(pDimRgn->VCFType); |
609 |
#else // override filter type |
#else // override filter type |
610 |
FilterLeft.SetType(OVERRIDE_FILTER_TYPE); |
FilterLeft.SetType(CONFIG_OVERRIDE_FILTER_TYPE); |
611 |
FilterRight.SetType(OVERRIDE_FILTER_TYPE); |
FilterRight.SetType(CONFIG_OVERRIDE_FILTER_TYPE); |
612 |
#endif // OVERRIDE_FILTER_TYPE |
#endif // CONFIG_OVERRIDE_FILTER_TYPE |
613 |
|
|
614 |
VCFCutoffCtrl.value = pEngineChannel->ControllerTable[VCFCutoffCtrl.controller]; |
VCFCutoffCtrl.value = pEngineChannel->ControllerTable[VCFCutoffCtrl.controller]; |
615 |
VCFResonanceCtrl.value = pEngineChannel->ControllerTable[VCFResonanceCtrl.controller]; |
VCFResonanceCtrl.value = pEngineChannel->ControllerTable[VCFResonanceCtrl.controller]; |
616 |
|
|
617 |
// calculate cutoff frequency |
// calculate cutoff frequency |
618 |
float cutoff = (!VCFCutoffCtrl.controller) |
float cutoff = (!VCFCutoffCtrl.controller) |
619 |
? exp((float) (127 - itNoteOnEvent->Param.Note.Velocity) * (float) pDimRgn->VCFVelocityScale * 6.2E-5f * FILTER_CUTOFF_COEFF) * FILTER_CUTOFF_MAX |
? exp((float) (127 - itNoteOnEvent->Param.Note.Velocity) * (float) pDimRgn->VCFVelocityScale * 6.2E-5f * FILTER_CUTOFF_COEFF) * CONFIG_FILTER_CUTOFF_MAX |
620 |
: exp((float) VCFCutoffCtrl.value * 0.00787402f * FILTER_CUTOFF_COEFF) * FILTER_CUTOFF_MAX; |
: exp((float) VCFCutoffCtrl.value * 0.00787402f * FILTER_CUTOFF_COEFF) * CONFIG_FILTER_CUTOFF_MAX; |
621 |
|
|
622 |
// calculate resonance |
// calculate resonance |
623 |
float resonance = (float) VCFResonanceCtrl.value * 0.00787f; // 0.0..1.0 |
float resonance = (float) VCFResonanceCtrl.value * 0.00787f; // 0.0..1.0 |
626 |
} |
} |
627 |
Constrain(resonance, 0.0, 1.0); // correct resonance if outside allowed value range (0.0..1.0) |
Constrain(resonance, 0.0, 1.0); // correct resonance if outside allowed value range (0.0..1.0) |
628 |
|
|
629 |
VCFCutoffCtrl.fvalue = cutoff - FILTER_CUTOFF_MIN; |
VCFCutoffCtrl.fvalue = cutoff - CONFIG_FILTER_CUTOFF_MIN; |
630 |
VCFResonanceCtrl.fvalue = resonance; |
VCFResonanceCtrl.fvalue = resonance; |
631 |
|
|
632 |
FilterUpdateCounter = -1; |
FilterUpdateCounter = -1; |
723 |
|
|
724 |
// add silence sample at the end if we reached the end of the stream (for the interpolator) |
// add silence sample at the end if we reached the end of the stream (for the interpolator) |
725 |
if (DiskStreamRef.State == Stream::state_end) { |
if (DiskStreamRef.State == Stream::state_end) { |
726 |
const int maxSampleWordsPerCycle = (pEngine->MaxSamplesPerCycle << MAX_PITCH) * pSample->Channels + 6; // +6 for the interpolator algorithm |
const int maxSampleWordsPerCycle = (pEngine->MaxSamplesPerCycle << CONFIG_MAX_PITCH) * pSample->Channels + 6; // +6 for the interpolator algorithm |
727 |
if (sampleWordsLeftToRead <= maxSampleWordsPerCycle) { |
if (sampleWordsLeftToRead <= maxSampleWordsPerCycle) { |
728 |
// remember how many sample words there are before any silence has been added |
// remember how many sample words there are before any silence has been added |
729 |
if (RealSampleWordsLeftToRead < 0) RealSampleWordsLeftToRead = sampleWordsLeftToRead; |
if (RealSampleWordsLeftToRead < 0) RealSampleWordsLeftToRead = sampleWordsLeftToRead; |
755 |
} |
} |
756 |
|
|
757 |
// Reset synthesis event lists (except VCO, as VCO events apply channel wide currently) |
// Reset synthesis event lists (except VCO, as VCO events apply channel wide currently) |
758 |
pEngine->pSynthesisEvents[Event::destination_vca]->clear(); |
pEngineChannel->pSynthesisEvents[Event::destination_vca]->clear(); |
759 |
pEngine->pSynthesisEvents[Event::destination_vcfc]->clear(); |
pEngineChannel->pSynthesisEvents[Event::destination_vcfc]->clear(); |
760 |
pEngine->pSynthesisEvents[Event::destination_vcfr]->clear(); |
pEngineChannel->pSynthesisEvents[Event::destination_vcfr]->clear(); |
761 |
|
|
762 |
// Reset delay |
// Reset delay |
763 |
Delay = 0; |
Delay = 0; |
797 |
void Voice::ProcessEvents(uint Samples) { |
void Voice::ProcessEvents(uint Samples) { |
798 |
|
|
799 |
// dispatch control change events |
// dispatch control change events |
800 |
RTList<Event>::Iterator itCCEvent = pEngine->pCCEvents->first(); |
RTList<Event>::Iterator itCCEvent = pEngineChannel->pCCEvents->first(); |
801 |
if (Delay) { // skip events that happened before this voice was triggered |
if (Delay) { // skip events that happened before this voice was triggered |
802 |
while (itCCEvent && itCCEvent->FragmentPos() <= Delay) ++itCCEvent; |
while (itCCEvent && itCCEvent->FragmentPos() <= Delay) ++itCCEvent; |
803 |
} |
} |
804 |
while (itCCEvent) { |
while (itCCEvent) { |
805 |
if (itCCEvent->Param.CC.Controller) { // if valid MIDI controller |
if (itCCEvent->Param.CC.Controller) { // if valid MIDI controller |
806 |
if (itCCEvent->Param.CC.Controller == VCFCutoffCtrl.controller) { |
if (itCCEvent->Param.CC.Controller == VCFCutoffCtrl.controller) { |
807 |
*pEngine->pSynthesisEvents[Event::destination_vcfc]->allocAppend() = *itCCEvent; |
*pEngineChannel->pSynthesisEvents[Event::destination_vcfc]->allocAppend() = *itCCEvent; |
808 |
} |
} |
809 |
if (itCCEvent->Param.CC.Controller == VCFResonanceCtrl.controller) { |
if (itCCEvent->Param.CC.Controller == VCFResonanceCtrl.controller) { |
810 |
*pEngine->pSynthesisEvents[Event::destination_vcfr]->allocAppend() = *itCCEvent; |
*pEngineChannel->pSynthesisEvents[Event::destination_vcfr]->allocAppend() = *itCCEvent; |
811 |
} |
} |
812 |
if (itCCEvent->Param.CC.Controller == pLFO1->ExtController) { |
if (itCCEvent->Param.CC.Controller == pLFO1->ExtController) { |
813 |
pLFO1->SendEvent(itCCEvent); |
pLFO1->SendEvent(itCCEvent); |
820 |
} |
} |
821 |
if (pDimRgn->AttenuationController.type == ::gig::attenuation_ctrl_t::type_controlchange && |
if (pDimRgn->AttenuationController.type == ::gig::attenuation_ctrl_t::type_controlchange && |
822 |
itCCEvent->Param.CC.Controller == pDimRgn->AttenuationController.controller_number) { // if crossfade event |
itCCEvent->Param.CC.Controller == pDimRgn->AttenuationController.controller_number) { // if crossfade event |
823 |
*pEngine->pSynthesisEvents[Event::destination_vca]->allocAppend() = *itCCEvent; |
*pEngineChannel->pSynthesisEvents[Event::destination_vca]->allocAppend() = *itCCEvent; |
824 |
} |
} |
825 |
} |
} |
826 |
|
|
830 |
|
|
831 |
// process pitch events |
// process pitch events |
832 |
{ |
{ |
833 |
RTList<Event>* pVCOEventList = pEngine->pSynthesisEvents[Event::destination_vco]; |
RTList<Event>* pVCOEventList = pEngineChannel->pSynthesisEvents[Event::destination_vco]; |
834 |
RTList<Event>::Iterator itVCOEvent = pVCOEventList->first(); |
RTList<Event>::Iterator itVCOEvent = pVCOEventList->first(); |
835 |
if (Delay) { // skip events that happened before this voice was triggered |
if (Delay) { // skip events that happened before this voice was triggered |
836 |
while (itVCOEvent && itVCOEvent->FragmentPos() <= Delay) ++itVCOEvent; |
while (itVCOEvent && itVCOEvent->FragmentPos() <= Delay) ++itVCOEvent; |
868 |
|
|
869 |
// process volume / attenuation events (TODO: we only handle and _expect_ crossfade events here ATM !) |
// process volume / attenuation events (TODO: we only handle and _expect_ crossfade events here ATM !) |
870 |
{ |
{ |
871 |
RTList<Event>* pVCAEventList = pEngine->pSynthesisEvents[Event::destination_vca]; |
RTList<Event>* pVCAEventList = pEngineChannel->pSynthesisEvents[Event::destination_vca]; |
872 |
RTList<Event>::Iterator itVCAEvent = pVCAEventList->first(); |
RTList<Event>::Iterator itVCAEvent = pVCAEventList->first(); |
873 |
if (Delay) { // skip events that happened before this voice was triggered |
if (Delay) { // skip events that happened before this voice was triggered |
874 |
while (itVCAEvent && itVCAEvent->FragmentPos() <= Delay) ++itVCAEvent; |
while (itVCAEvent && itVCAEvent->FragmentPos() <= Delay) ++itVCAEvent; |
897 |
|
|
898 |
// process filter cutoff events |
// process filter cutoff events |
899 |
{ |
{ |
900 |
RTList<Event>* pCutoffEventList = pEngine->pSynthesisEvents[Event::destination_vcfc]; |
RTList<Event>* pCutoffEventList = pEngineChannel->pSynthesisEvents[Event::destination_vcfc]; |
901 |
RTList<Event>::Iterator itCutoffEvent = pCutoffEventList->first(); |
RTList<Event>::Iterator itCutoffEvent = pCutoffEventList->first(); |
902 |
if (Delay) { // skip events that happened before this voice was triggered |
if (Delay) { // skip events that happened before this voice was triggered |
903 |
while (itCutoffEvent && itCutoffEvent->FragmentPos() <= Delay) ++itCutoffEvent; |
while (itCutoffEvent && itCutoffEvent->FragmentPos() <= Delay) ++itCutoffEvent; |
910 |
// calculate the influence length of this event (in sample points) |
// calculate the influence length of this event (in sample points) |
911 |
uint end = (itNextCutoffEvent) ? itNextCutoffEvent->FragmentPos() : Samples; |
uint end = (itNextCutoffEvent) ? itNextCutoffEvent->FragmentPos() : Samples; |
912 |
|
|
913 |
cutoff = exp((float) itCutoffEvent->Param.CC.Value * 0.00787402f * FILTER_CUTOFF_COEFF) * FILTER_CUTOFF_MAX - FILTER_CUTOFF_MIN; |
cutoff = exp((float) itCutoffEvent->Param.CC.Value * 0.00787402f * FILTER_CUTOFF_COEFF) * CONFIG_FILTER_CUTOFF_MAX - CONFIG_FILTER_CUTOFF_MIN; |
914 |
|
|
915 |
// apply cutoff frequency to the cutoff parameter sequence |
// apply cutoff frequency to the cutoff parameter sequence |
916 |
for (uint i = itCutoffEvent->FragmentPos(); i < end; i++) { |
for (uint i = itCutoffEvent->FragmentPos(); i < end; i++) { |
924 |
|
|
925 |
// process filter resonance events |
// process filter resonance events |
926 |
{ |
{ |
927 |
RTList<Event>* pResonanceEventList = pEngine->pSynthesisEvents[Event::destination_vcfr]; |
RTList<Event>* pResonanceEventList = pEngineChannel->pSynthesisEvents[Event::destination_vcfr]; |
928 |
RTList<Event>::Iterator itResonanceEvent = pResonanceEventList->first(); |
RTList<Event>::Iterator itResonanceEvent = pResonanceEventList->first(); |
929 |
if (Delay) { // skip events that happened before this voice was triggered |
if (Delay) { // skip events that happened before this voice was triggered |
930 |
while (itResonanceEvent && itResonanceEvent->FragmentPos() <= Delay) ++itResonanceEvent; |
while (itResonanceEvent && itResonanceEvent->FragmentPos() <= Delay) ++itResonanceEvent; |
963 |
biquad_param_t bqmain; |
biquad_param_t bqmain; |
964 |
float prev_cutoff = pEngine->pSynthesisParameters[Event::destination_vcfc][0]; |
float prev_cutoff = pEngine->pSynthesisParameters[Event::destination_vcfc][0]; |
965 |
float prev_res = pEngine->pSynthesisParameters[Event::destination_vcfr][0]; |
float prev_res = pEngine->pSynthesisParameters[Event::destination_vcfr][0]; |
966 |
FilterLeft.SetParameters( &bqbase, &bqmain, prev_cutoff + FILTER_CUTOFF_MIN, prev_res, pEngine->SampleRate); |
FilterLeft.SetParameters( &bqbase, &bqmain, prev_cutoff + CONFIG_FILTER_CUTOFF_MIN, prev_res, pEngine->SampleRate); |
967 |
FilterRight.SetParameters(&bqbase, &bqmain, prev_cutoff + FILTER_CUTOFF_MIN, prev_res, pEngine->SampleRate); |
FilterRight.SetParameters(&bqbase, &bqmain, prev_cutoff + CONFIG_FILTER_CUTOFF_MIN, prev_res, pEngine->SampleRate); |
968 |
pEngine->pBasicFilterParameters[0] = bqbase; |
pEngine->pBasicFilterParameters[0] = bqbase; |
969 |
pEngine->pMainFilterParameters[0] = bqmain; |
pEngine->pMainFilterParameters[0] = bqmain; |
970 |
|
|
977 |
{ |
{ |
978 |
prev_cutoff = pEngine->pSynthesisParameters[Event::destination_vcfc][i]; |
prev_cutoff = pEngine->pSynthesisParameters[Event::destination_vcfc][i]; |
979 |
prev_res = pEngine->pSynthesisParameters[Event::destination_vcfr][i]; |
prev_res = pEngine->pSynthesisParameters[Event::destination_vcfr][i]; |
980 |
FilterLeft.SetParameters( &bqbase, &bqmain, prev_cutoff + FILTER_CUTOFF_MIN, prev_res, pEngine->SampleRate); |
FilterLeft.SetParameters( &bqbase, &bqmain, prev_cutoff + CONFIG_FILTER_CUTOFF_MIN, prev_res, pEngine->SampleRate); |
981 |
FilterRight.SetParameters(&bqbase, &bqmain, prev_cutoff + FILTER_CUTOFF_MIN, prev_res, pEngine->SampleRate); |
FilterRight.SetParameters(&bqbase, &bqmain, prev_cutoff + CONFIG_FILTER_CUTOFF_MIN, prev_res, pEngine->SampleRate); |
982 |
} |
} |
983 |
} |
} |
984 |
|
|
1037 |
* @param itKillEvent - event which caused the voice to be killed |
* @param itKillEvent - event which caused the voice to be killed |
1038 |
*/ |
*/ |
1039 |
void Voice::Kill(Pool<Event>::Iterator& itKillEvent) { |
void Voice::Kill(Pool<Event>::Iterator& itKillEvent) { |
1040 |
//FIXME: just two sanity checks for debugging, can be removed |
#if CONFIG_DEVMODE |
1041 |
if (!itKillEvent) dmsg(1,("gig::Voice::Kill(): ERROR, !itKillEvent !!!\n")); |
if (!itKillEvent) dmsg(1,("gig::Voice::Kill(): ERROR, !itKillEvent !!!\n")); |
1042 |
if (itKillEvent && !itKillEvent.isValid()) dmsg(1,("gig::Voice::Kill(): ERROR, itKillEvent invalid !!!\n")); |
if (itKillEvent && !itKillEvent.isValid()) dmsg(1,("gig::Voice::Kill(): ERROR, itKillEvent invalid !!!\n")); |
1043 |
|
#endif // CONFIG_DEVMODE |
1044 |
|
|
1045 |
if (itTriggerEvent && itKillEvent->FragmentPos() <= itTriggerEvent->FragmentPos()) return; |
if (itTriggerEvent && itKillEvent->FragmentPos() <= itTriggerEvent->FragmentPos()) return; |
1046 |
this->itKillEvent = itKillEvent; |
this->itKillEvent = itKillEvent; |