Lines Matching refs:pWTVoice

58 static EAS_I32 WT_UpdatePhaseInc (S_WT_VOICE *pWTVoice, const S_ARTICULATION *pArt, S_SYNTH_CHANNEL…
59 static EAS_I32 WT_UpdateGain (S_SYNTH_VOICE *pVoice, S_WT_VOICE *pWTVoice, const S_ARTICULATION *pA…
60 static void WT_UpdateEG1 (S_WT_VOICE *pWTVoice, const S_ENVELOPE *pEnv);
61 static void WT_UpdateEG2 (S_WT_VOICE *pWTVoice, const S_ENVELOPE *pEnv);
69 static void WT_UpdateFilter (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pIntFrame, const S_ARTICULATION …
168 S_WT_VOICE *pWTVoice; in WT_ReleaseVoice() local
179 pWTVoice = &pVoiceMgr->wtVoices[voiceNum]; in WT_ReleaseVoice()
180 pArticulation = &pSynth->pEAS->pArticulations[pWTVoice->artIndex]; in WT_ReleaseVoice()
183 pWTVoice->eg1State = eEnvelopeStateRelease; in WT_ReleaseVoice()
184 pWTVoice->eg1Increment = pArticulation->eg1.releaseTime; in WT_ReleaseVoice()
193 pWTVoice->eg2State = eEnvelopeStateRelease; in WT_ReleaseVoice()
194 pWTVoice->eg2Increment = pArticulation->eg2.releaseTime; in WT_ReleaseVoice()
249 S_WT_VOICE *pWTVoice; in WT_SustainPedal() local
260 pWTVoice = &pVoiceMgr->wtVoices[voiceNum]; in WT_SustainPedal()
261 if (pWTVoice->eg1Value < pSynth->pEAS->pArticulations[pWTVoice->artIndex].eg1.sustainLevel) in WT_SustainPedal()
266 pWTVoice->eg1State = eEnvelopeStateDecay; in WT_SustainPedal()
312 S_WT_VOICE *pWTVoice; in WT_StartVoice() local
330 pWTVoice = &pVoiceMgr->wtVoices[voiceNum]; in WT_StartVoice()
343 pWTVoice->artIndex = pRegion->artIndex; in WT_StartVoice()
349 pArt = &pSynth->pEAS->pArticulations[pWTVoice->artIndex]; in WT_StartVoice()
352 pWTVoice->eg1State = eEnvelopeStateAttack; in WT_StartVoice()
353 pWTVoice->eg1Value = 0; in WT_StartVoice()
354 pWTVoice->eg1Increment = pArt->eg1.attackTime; in WT_StartVoice()
355 pWTVoice->eg2State = eEnvelopeStateAttack; in WT_StartVoice()
356 pWTVoice->eg2Value = 0; in WT_StartVoice()
357 pWTVoice->eg2Increment = pArt->eg2.attackTime; in WT_StartVoice()
360 pWTVoice->modLFO.lfoValue = 0; in WT_StartVoice()
361 pWTVoice->modLFO.lfoPhase = -pArt->lfoDelay; in WT_StartVoice()
375 EAS_CalcPanControl(pan, &pWTVoice->gainLeft, &pWTVoice->gainRight); in WT_StartVoice()
380 pWTVoice->filter.z1 = 0; in WT_StartVoice()
381 pWTVoice->filter.z2 = 0; in WT_StartVoice()
387 pWTVoice->phaseAccum = 4574296; in WT_StartVoice()
388 pWTVoice->loopStart = WT_NOISE_GENERATOR; in WT_StartVoice()
389 pWTVoice->loopEnd = 4574295; in WT_StartVoice()
398pWTVoice->phaseAccum = (EAS_U32) pSynth->pEAS->pSamples + pSynth->pEAS->pSampleOffsets[pRegion->wa… in WT_StartVoice()
400 pWTVoice->phaseAccum = pSynth->pEAS->pSampleOffsets[pRegion->waveIndex]; in WT_StartVoice()
402pWTVoice->phaseAccum = (EAS_U32) pSynth->pEAS->pSamples + pSynth->pEAS->pSampleOffsets[pRegion->wa… in WT_StartVoice()
407 pWTVoice->loopStart = pWTVoice->phaseAccum + pRegion->loopStart; in WT_StartVoice()
408 pWTVoice->loopEnd = pWTVoice->phaseAccum + pRegion->loopEnd - 1; in WT_StartVoice()
411pWTVoice->loopStart = pWTVoice->loopEnd = pWTVoice->phaseAccum + pSynth->pEAS->pSampleLen[pRegion-… in WT_StartVoice()
418 wtConfig.phaseAccum = pWTVoice->phaseAccum; in WT_StartVoice()
419 wtConfig.loopStart = pWTVoice->loopStart; in WT_StartVoice()
420 wtConfig.loopEnd = pWTVoice->loopEnd; in WT_StartVoice()
424 wtConfig.gainLeft = pWTVoice->gainLeft; in WT_StartVoice()
425 wtConfig.gainRight = pWTVoice->gainRight; in WT_StartVoice()
449 EAS_BOOL WT_CheckSampleEnd (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame, EAS_BOOL update) in WT_CheckSampleEnd() argument
458 …endPhaseFrac = pWTVoice->phaseFrac + (pWTIntFrame->frame.phaseIncrement << SYNTH_UPDATE_PERIOD_IN_… in WT_CheckSampleEnd()
459 endPhaseAccum = pWTVoice->phaseAccum + GET_PHASE_INT_PART(endPhaseFrac); in WT_CheckSampleEnd()
460 if (endPhaseAccum >= pWTVoice->loopEnd) in WT_CheckSampleEnd()
463 numSamples = (EAS_I32) (pWTVoice->loopEnd - pWTVoice->phaseAccum); in WT_CheckSampleEnd()
467 numSamples = (EAS_I32) ((numSamples << NUM_PHASE_FRAC_BITS) - pWTVoice->phaseFrac); in WT_CheckSampleEnd()
486 pWTVoice->phaseFrac = endPhaseFrac; in WT_CheckSampleEnd()
487 pWTVoice->phaseAccum = endPhaseAccum; in WT_CheckSampleEnd()
513 S_WT_VOICE *pWTVoice; in WT_UpdateVoice() local
527 pWTVoice = &pVoiceMgr->wtVoices[voiceNum]; in WT_UpdateVoice()
529 pArt = &pSynth->pEAS->pArticulations[pWTVoice->artIndex]; in WT_UpdateVoice()
534 WT_UpdateEG1(pWTVoice, &pArt->eg1); in WT_UpdateVoice()
535 WT_UpdateEG2(pWTVoice, &pArt->eg2); in WT_UpdateVoice()
538 WT_UpdateLFO(&pWTVoice->modLFO, pArt->lfoFreq); in WT_UpdateVoice()
543 WT_UpdateFilter(pWTVoice, &intFrame, pArt); in WT_UpdateVoice()
549 intFrame.frame.gainTarget = WT_UpdateGain(pVoice, pWTVoice, pArt, pChannel, pWTRegion->gain); in WT_UpdateVoice()
559 intFrame.frame.phaseIncrement = WT_UpdatePhaseInc(pWTVoice, pArt, pChannel, temp); in WT_UpdateVoice()
567 if ((pWTVoice->loopStart != WT_NOISE_GENERATOR) && (pWTVoice->loopStart == pWTVoice->loopEnd)) in WT_UpdateVoice()
568 done = WT_CheckSampleEnd(pWTVoice, &intFrame, (EAS_BOOL) (voiceNum >= NUM_PRIMARY_VOICES)); in WT_UpdateVoice()
581 WT_ProcessVoice(pWTVoice, &intFrame); in WT_UpdateVoice()
587 WT_ProcessVoice(pWTVoice, &intFrame); in WT_UpdateVoice()
594 if ((pVoice->voiceState != eVoiceStateStolen) && (pWTVoice->eg1State == eEnvelopeStateMuted)) in WT_UpdateVoice()
626 static EAS_I32 WT_UpdatePhaseInc (S_WT_VOICE *pWTVoice, const S_ARTICULATION *pArt, S_SYNTH_CHANNEL… in WT_UpdatePhaseInc() argument
639 temp = MULT_EG1_EG1(pWTVoice->modLFO.lfoValue, temp); in WT_UpdatePhaseInc()
648 (MULT_EG1_EG1(pWTVoice->eg2Value, pArt->eg2ToPitch)) + in WT_UpdatePhaseInc()
649 (MULT_EG1_EG1(pWTVoice->modLFO.lfoValue, pArt->lfoToPitch)); in WT_UpdatePhaseInc()
736 static EAS_I32 WT_UpdateGain (S_SYNTH_VOICE *pVoice, S_WT_VOICE *pWTVoice, const S_ARTICULATION *pA… in WT_UpdateGain() argument
759 lfoGain = MULT_EG1_EG1(pWTVoice->modLFO.lfoValue, pArt->lfoToGain); in WT_UpdateGain()
767 temp = (EAS_I16)MULT_EG1_EG1(temp, pWTVoice->eg1Value); in WT_UpdateGain()
791 static void WT_UpdateEG1 (S_WT_VOICE *pWTVoice, const S_ENVELOPE *pEnv) in WT_UpdateEG1() argument
795 switch (pWTVoice->eg1State) in WT_UpdateEG1()
798 temp = pWTVoice->eg1Value + pWTVoice->eg1Increment; in WT_UpdateEG1()
807 pWTVoice->eg1State = eEnvelopeStateDecay; in WT_UpdateEG1()
808 pWTVoice->eg1Increment = pEnv->decayTime; in WT_UpdateEG1()
815 temp = MULT_EG1_EG1(pWTVoice->eg1Value, pWTVoice->eg1Increment); in WT_UpdateEG1()
825 pWTVoice->eg1State = eEnvelopeStateSustain; in WT_UpdateEG1()
829 pWTVoice->eg1State = eEnvelopeStateMuted; in WT_UpdateEG1()
838 temp = MULT_EG1_EG1(pWTVoice->eg1Value, pWTVoice->eg1Increment); in WT_UpdateEG1()
844 pWTVoice->eg1State = eEnvelopeStateMuted; in WT_UpdateEG1()
864 pWTVoice->eg1Value = (EAS_I16) temp; in WT_UpdateEG1()
884 static void WT_UpdateEG2 (S_WT_VOICE *pWTVoice, const S_ENVELOPE *pEnv) in WT_UpdateEG2() argument
888 switch (pWTVoice->eg2State) in WT_UpdateEG2()
891 temp = pWTVoice->eg2Value + pWTVoice->eg2Increment; in WT_UpdateEG2()
900 pWTVoice->eg2State = eEnvelopeStateDecay; in WT_UpdateEG2()
902 pWTVoice->eg2Increment = pEnv->decayTime; in WT_UpdateEG2()
909 temp = pWTVoice->eg2Value -pWTVoice->eg2Increment; in WT_UpdateEG2()
918 pWTVoice->eg2State = eEnvelopeStateSustain; in WT_UpdateEG2()
926 temp = pWTVoice->eg2Value - pWTVoice->eg2Increment; in WT_UpdateEG2()
931 pWTVoice->eg2State = eEnvelopeStateMuted; in WT_UpdateEG2()
951 pWTVoice->eg2Value = (EAS_I16) temp; in WT_UpdateEG2()
1011 static void WT_UpdateFilter (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pIntFrame, const S_ARTICULATION … in WT_UpdateFilter() argument
1023 cutoff = MULT_EG1_EG1(pWTVoice->eg2Value, pArt->eg2ToFc); in WT_UpdateFilter()