Home | History | Annotate | Download | only in lib_src

Lines Matching refs:pWTVoice

55 static EAS_I32 WT_UpdatePhaseInc (S_WT_VOICE *pWTVoice, const S_ARTICULATION *pArt, S_SYNTH_CHANNEL *pChannel, EAS_I32 pitchCents);
56 static EAS_I32 WT_UpdateGain (S_SYNTH_VOICE *pVoice, S_WT_VOICE *pWTVoice, const S_ARTICULATION *pArt, S_SYNTH_CHANNEL *pChannel, EAS_I32 gain);
57 static void WT_UpdateEG1 (S_WT_VOICE *pWTVoice, const S_ENVELOPE *pEnv);
58 static void WT_UpdateEG2 (S_WT_VOICE *pWTVoice, const S_ENVELOPE *pEnv);
66 static void WT_UpdateFilter (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pIntFrame, const S_ARTICULATION *pArt);
165 S_WT_VOICE *pWTVoice;
176 pWTVoice = &pVoiceMgr->wtVoices[voiceNum];
177 pArticulation = &pSynth->pEAS->pArticulations[pWTVoice->artIndex];
180 pWTVoice->eg1State = eEnvelopeStateRelease;
181 pWTVoice->eg1Increment = pArticulation->eg1.releaseTime;
190 pWTVoice->eg2State = eEnvelopeStateRelease;
191 pWTVoice->eg2Increment = pArticulation->eg2.releaseTime;
246 S_WT_VOICE *pWTVoice;
257 pWTVoice = &pVoiceMgr->wtVoices[voiceNum];
258 if (pWTVoice->eg1Value < pSynth->pEAS->pArticulations[pWTVoice->artIndex].eg1.sustainLevel)
263 pWTVoice->eg1State = eEnvelopeStateDecay;
309 S_WT_VOICE *pWTVoice;
327 pWTVoice = &pVoiceMgr->wtVoices[voiceNum];
340 pWTVoice->artIndex = pRegion->artIndex;
346 pArt = &pSynth->pEAS->pArticulations[pWTVoice->artIndex];
349 pWTVoice->eg1State = eEnvelopeStateAttack;
350 pWTVoice->eg1Value = 0;
351 pWTVoice->eg1Increment = pArt->eg1.attackTime;
352 pWTVoice->eg2State = eEnvelopeStateAttack;
353 pWTVoice->eg2Value = 0;
354 pWTVoice->eg2Increment = pArt->eg2.attackTime;
357 pWTVoice->modLFO.lfoValue = 0;
358 pWTVoice->modLFO.lfoPhase = -pArt->lfoDelay;
372 EAS_CalcPanControl(pan, &pWTVoice->gainLeft, &pWTVoice->gainRight);
377 pWTVoice->filter.z1 = 0;
378 pWTVoice->filter.z2 = 0;
384 pWTVoice->phaseAccum = 4574296;
385 pWTVoice->loopStart = WT_NOISE_GENERATOR;
386 pWTVoice->loopEnd = 4574295;
395 pWTVoice->phaseAccum = (EAS_U32) pSynth->pEAS->pSamples + pSynth->pEAS->pSampleOffsets[pRegion->waveIndex];
397 pWTVoice->phaseAccum = pSynth->pEAS->pSampleOffsets[pRegion->waveIndex];
399 pWTVoice->phaseAccum = (EAS_U32) pSynth->pEAS->pSamples + pSynth->pEAS->pSampleOffsets[pRegion->waveIndex];
404 pWTVoice->loopStart = pWTVoice->phaseAccum + pRegion->loopStart;
405 pWTVoice->loopEnd = pWTVoice->phaseAccum + pRegion->loopEnd - 1;
408 pWTVoice->loopStart = pWTVoice->loopEnd = pWTVoice->phaseAccum + pSynth->pEAS->pSampleLen[pRegion->waveIndex] - 1;
415 wtConfig.phaseAccum = pWTVoice->phaseAccum;
416 wtConfig.loopStart = pWTVoice->loopStart;
417 wtConfig.loopEnd = pWTVoice->loopEnd;
421 wtConfig.gainLeft = pWTVoice->gainLeft;
422 wtConfig.gainRight = pWTVoice->gainRight;
446 EAS_BOOL WT_CheckSampleEnd (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame, EAS_BOOL update)
455 endPhaseFrac = pWTVoice->phaseFrac + (pWTIntFrame->frame.phaseIncrement << SYNTH_UPDATE_PERIOD_IN_BITS);
456 endPhaseAccum = pWTVoice->phaseAccum + GET_PHASE_INT_PART(endPhaseFrac);
457 if (endPhaseAccum >= pWTVoice->loopEnd)
460 numSamples = (EAS_I32) (pWTVoice->loopEnd - pWTVoice->phaseAccum);
464 numSamples = (EAS_I32) ((numSamples << NUM_PHASE_FRAC_BITS) - pWTVoice->phaseFrac);
474 pWTVoice->phaseFrac = endPhaseFrac;
475 pWTVoice->phaseAccum = endPhaseAccum;
501 S_WT_VOICE *pWTVoice;
515 pWTVoice = &pVoiceMgr->wtVoices[voiceNum];
517 pArt = &pSynth->pEAS->pArticulations[pWTVoice->artIndex];
522 WT_UpdateEG1(pWTVoice, &pArt->eg1);
523 WT_UpdateEG2(pWTVoice, &pArt->eg2);
526 WT_UpdateLFO(&pWTVoice->modLFO, pArt->lfoFreq);
531 WT_UpdateFilter(pWTVoice, &intFrame, pArt);
537 intFrame.frame.gainTarget = WT_UpdateGain(pVoice, pWTVoice, pArt, pChannel, pWTRegion->gain);
547 intFrame.frame.phaseIncrement = WT_UpdatePhaseInc(pWTVoice, pArt, pChannel, temp);
555 if ((pWTVoice->loopStart != WT_NOISE_GENERATOR) && (pWTVoice->loopStart == pWTVoice->loopEnd))
556 done = WT_CheckSampleEnd(pWTVoice, &intFrame, (EAS_BOOL) (voiceNum >= NUM_PRIMARY_VOICES));
564 WT_ProcessVoice(pWTVoice, &intFrame);
570 WT_ProcessVoice(pWTVoice, &intFrame);
577 if ((pVoice->voiceState != eVoiceStateStolen) && (pWTVoice->eg1State == eEnvelopeStateMuted))
609 static EAS_I32 WT_UpdatePhaseInc (S_WT_VOICE *pWTVoice, const S_ARTICULATION *pArt, S_SYNTH_CHANNEL *pChannel, EAS_I32 pitchCents)
622 temp = MULT_EG1_EG1(pWTVoice->modLFO.lfoValue, temp);
631 (MULT_EG1_EG1(pWTVoice->eg2Value, pArt->eg2ToPitch)) +
632 (MULT_EG1_EG1(pWTVoice->modLFO.lfoValue, pArt->lfoToPitch));
719 static EAS_I32 WT_UpdateGain (S_SYNTH_VOICE *pVoice, S_WT_VOICE *pWTVoice, const S_ARTICULATION *pArt, S_SYNTH_CHANNEL *pChannel, EAS_I32 gain)
742 lfoGain = MULT_EG1_EG1(pWTVoice->modLFO.lfoValue, pArt->lfoToGain);
750 temp = (EAS_I16)MULT_EG1_EG1(temp, pWTVoice->eg1Value);
774 static void WT_UpdateEG1 (S_WT_VOICE *pWTVoice, const S_ENVELOPE *pEnv)
778 switch (pWTVoice->eg1State)
781 temp = pWTVoice->eg1Value + pWTVoice->eg1Increment;
790 pWTVoice->eg1State = eEnvelopeStateDecay;
791 pWTVoice->eg1Increment = pEnv->decayTime;
798 temp = MULT_EG1_EG1(pWTVoice->eg1Value, pWTVoice->eg1Increment);
808 pWTVoice->eg1State = eEnvelopeStateSustain;
812 pWTVoice->eg1State = eEnvelopeStateMuted;
821 temp = MULT_EG1_EG1(pWTVoice->eg1Value, pWTVoice->eg1Increment);
827 pWTVoice->eg1State = eEnvelopeStateMuted;
841 pWTVoice->eg1State); */ }
847 pWTVoice->eg1Value = (EAS_I16) temp;
867 static void WT_UpdateEG2 (S_WT_VOICE *pWTVoice, const S_ENVELOPE *pEnv)
871 switch (pWTVoice->eg2State)
874 temp = pWTVoice->eg2Value + pWTVoice->eg2Increment;
883 pWTVoice->eg2State = eEnvelopeStateDecay;
885 pWTVoice->eg2Increment = pEnv->decayTime;
892 temp = pWTVoice->eg2Value -pWTVoice->eg2Increment;
901 pWTVoice->eg2State = eEnvelopeStateSustain;
909 temp = pWTVoice->eg2Value - pWTVoice->eg2Increment;
914 pWTVoice->eg2State = eEnvelopeStateMuted;
929 pWTVoice->eg2State); */ }
934 pWTVoice->eg2Value = (EAS_I16) temp;
994 static void WT_UpdateFilter (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pIntFrame, const S_ARTICULATION *pArt)
1006 cutoff = MULT_EG1_EG1(pWTVoice->eg2Value, pArt->eg2ToFc);