Lines Matching refs:pWTVoice
59 static EAS_I32 WT_UpdatePhaseInc (S_WT_VOICE *pWTVoice, const S_ARTICULATION *pArt, S_SYNTH_CHANNEL…
60 static EAS_I32 WT_UpdateGain (S_SYNTH_VOICE *pVoice, S_WT_VOICE *pWTVoice, const S_ARTICULATION *pA…
61 static void WT_UpdateEG1 (S_WT_VOICE *pWTVoice, const S_ENVELOPE *pEnv);
62 static void WT_UpdateEG2 (S_WT_VOICE *pWTVoice, const S_ENVELOPE *pEnv);
70 static void WT_UpdateFilter (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pIntFrame, const S_ARTICULATION …
169 S_WT_VOICE *pWTVoice; in WT_ReleaseVoice() local
180 pWTVoice = &pVoiceMgr->wtVoices[voiceNum]; in WT_ReleaseVoice()
181 pArticulation = &pSynth->pEAS->pArticulations[pWTVoice->artIndex]; in WT_ReleaseVoice()
184 pWTVoice->eg1State = eEnvelopeStateRelease; in WT_ReleaseVoice()
185 pWTVoice->eg1Increment = pArticulation->eg1.releaseTime; in WT_ReleaseVoice()
194 pWTVoice->eg2State = eEnvelopeStateRelease; in WT_ReleaseVoice()
195 pWTVoice->eg2Increment = pArticulation->eg2.releaseTime; in WT_ReleaseVoice()
250 S_WT_VOICE *pWTVoice; in WT_SustainPedal() local
261 pWTVoice = &pVoiceMgr->wtVoices[voiceNum]; in WT_SustainPedal()
262 if (pWTVoice->eg1Value < pSynth->pEAS->pArticulations[pWTVoice->artIndex].eg1.sustainLevel) in WT_SustainPedal()
267 pWTVoice->eg1State = eEnvelopeStateDecay; in WT_SustainPedal()
313 S_WT_VOICE *pWTVoice; in WT_StartVoice() local
331 pWTVoice = &pVoiceMgr->wtVoices[voiceNum]; in WT_StartVoice()
344 pWTVoice->artIndex = pRegion->artIndex; in WT_StartVoice()
350 pArt = &pSynth->pEAS->pArticulations[pWTVoice->artIndex]; in WT_StartVoice()
353 pWTVoice->eg1State = eEnvelopeStateAttack; in WT_StartVoice()
354 pWTVoice->eg1Value = 0; in WT_StartVoice()
355 pWTVoice->eg1Increment = pArt->eg1.attackTime; in WT_StartVoice()
356 pWTVoice->eg2State = eEnvelopeStateAttack; in WT_StartVoice()
357 pWTVoice->eg2Value = 0; in WT_StartVoice()
358 pWTVoice->eg2Increment = pArt->eg2.attackTime; in WT_StartVoice()
361 pWTVoice->modLFO.lfoValue = 0; in WT_StartVoice()
362 pWTVoice->modLFO.lfoPhase = -pArt->lfoDelay; in WT_StartVoice()
376 EAS_CalcPanControl(pan, &pWTVoice->gainLeft, &pWTVoice->gainRight); in WT_StartVoice()
381 pWTVoice->filter.z1 = 0; in WT_StartVoice()
382 pWTVoice->filter.z2 = 0; in WT_StartVoice()
388 pWTVoice->phaseAccum = 4574296; in WT_StartVoice()
389 pWTVoice->loopStart = WT_NOISE_GENERATOR; in WT_StartVoice()
390 pWTVoice->loopEnd = 4574295; in WT_StartVoice()
399 …pWTVoice->phaseAccum = (EAS_U32) pSynth->pEAS->pSamples + pSynth->pEAS->pSampleOffsets[pRegion->wa… in WT_StartVoice()
401 pWTVoice->phaseAccum = pSynth->pEAS->pSampleOffsets[pRegion->waveIndex]; in WT_StartVoice()
403 …pWTVoice->phaseAccum = (EAS_U32) pSynth->pEAS->pSamples + pSynth->pEAS->pSampleOffsets[pRegion->wa… in WT_StartVoice()
409 pWTVoice->loopStart = pWTVoice->phaseAccum + pRegion->loopStart; in WT_StartVoice()
410 pWTVoice->loopEnd = pWTVoice->phaseAccum + pRegion->loopEnd - 1; in WT_StartVoice()
412 pWTVoice->loopStart = pWTVoice->phaseAccum + (pRegion->loopStart<<1); in WT_StartVoice()
413 pWTVoice->loopEnd = pWTVoice->phaseAccum + (pRegion->loopEnd<<1) - 2; in WT_StartVoice()
418 …pWTVoice->loopStart = pWTVoice->loopEnd = pWTVoice->phaseAccum + pSynth->pEAS->pSampleLen[pRegion-… in WT_StartVoice()
420 …pWTVoice->loopStart = pWTVoice->loopEnd = pWTVoice->phaseAccum + pSynth->pEAS->pSampleLen[pRegion-… in WT_StartVoice()
429 wtConfig.phaseAccum = pWTVoice->phaseAccum; in WT_StartVoice()
430 wtConfig.loopStart = pWTVoice->loopStart; in WT_StartVoice()
431 wtConfig.loopEnd = pWTVoice->loopEnd; in WT_StartVoice()
435 wtConfig.gainLeft = pWTVoice->gainLeft; in WT_StartVoice()
436 wtConfig.gainRight = pWTVoice->gainRight; in WT_StartVoice()
460 EAS_BOOL WT_CheckSampleEnd (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame, EAS_BOOL update) in WT_CheckSampleEnd() argument
469 …endPhaseFrac = pWTVoice->phaseFrac + (pWTIntFrame->frame.phaseIncrement << SYNTH_UPDATE_PERIOD_IN_… in WT_CheckSampleEnd()
471 endPhaseAccum = pWTVoice->phaseAccum + GET_PHASE_INT_PART(endPhaseFrac); in WT_CheckSampleEnd()
474 endPhaseAccum = pWTVoice->phaseAccum + (EAS_U32)(endPhaseFrac >> 14); in WT_CheckSampleEnd()
476 if (endPhaseAccum >= pWTVoice->loopEnd) in WT_CheckSampleEnd()
479 numSamples = (EAS_I32) (pWTVoice->loopEnd - pWTVoice->phaseAccum); in WT_CheckSampleEnd()
485 numSamples = (numSamples << NUM_PHASE_FRAC_BITS) - (EAS_I32) pWTVoice->phaseFrac; in WT_CheckSampleEnd()
504 pWTVoice->phaseFrac = endPhaseFrac; in WT_CheckSampleEnd()
505 pWTVoice->phaseAccum = endPhaseAccum; in WT_CheckSampleEnd()
531 S_WT_VOICE *pWTVoice; in WT_UpdateVoice() local
544 pWTVoice = &pVoiceMgr->wtVoices[voiceNum]; in WT_UpdateVoice()
546 pArt = &pSynth->pEAS->pArticulations[pWTVoice->artIndex]; in WT_UpdateVoice()
551 WT_UpdateEG1(pWTVoice, &pArt->eg1); in WT_UpdateVoice()
552 WT_UpdateEG2(pWTVoice, &pArt->eg2); in WT_UpdateVoice()
555 WT_UpdateLFO(&pWTVoice->modLFO, pArt->lfoFreq); in WT_UpdateVoice()
560 WT_UpdateFilter(pWTVoice, &intFrame, pArt); in WT_UpdateVoice()
566 intFrame.frame.gainTarget = WT_UpdateGain(pVoice, pWTVoice, pArt, pChannel, pWTRegion->gain); in WT_UpdateVoice()
576 intFrame.frame.phaseIncrement = WT_UpdatePhaseInc(pWTVoice, pArt, pChannel, temp); in WT_UpdateVoice()
577 if (pWTVoice->loopStart == WT_NOISE_GENERATOR) { in WT_UpdateVoice()
580 temp = pWTVoice->loopEnd - pWTVoice->loopStart; in WT_UpdateVoice()
588 ALOGW("%p phaseIncrement=%d", pWTVoice, (int)intFrame.frame.phaseIncrement); in WT_UpdateVoice()
599 if ((pWTVoice->loopStart != WT_NOISE_GENERATOR) && (pWTVoice->loopStart == pWTVoice->loopEnd)) in WT_UpdateVoice()
600 done = WT_CheckSampleEnd(pWTVoice, &intFrame, (EAS_BOOL) (voiceNum >= NUM_PRIMARY_VOICES)); in WT_UpdateVoice()
613 WT_ProcessVoice(pWTVoice, &intFrame); in WT_UpdateVoice()
619 WT_ProcessVoice(pWTVoice, &intFrame); in WT_UpdateVoice()
626 if ((pVoice->voiceState != eVoiceStateStolen) && (pWTVoice->eg1State == eEnvelopeStateMuted)) in WT_UpdateVoice()
658 static EAS_I32 WT_UpdatePhaseInc (S_WT_VOICE *pWTVoice, const S_ARTICULATION *pArt, S_SYNTH_CHANNEL… in WT_UpdatePhaseInc() argument
671 temp = MULT_EG1_EG1(pWTVoice->modLFO.lfoValue, temp); in WT_UpdatePhaseInc()
680 (MULT_EG1_EG1(pWTVoice->eg2Value, pArt->eg2ToPitch)) + in WT_UpdatePhaseInc()
681 (MULT_EG1_EG1(pWTVoice->modLFO.lfoValue, pArt->lfoToPitch)); in WT_UpdatePhaseInc()
768 static EAS_I32 WT_UpdateGain (S_SYNTH_VOICE *pVoice, S_WT_VOICE *pWTVoice, const S_ARTICULATION *pA… in WT_UpdateGain() argument
791 lfoGain = MULT_EG1_EG1(pWTVoice->modLFO.lfoValue, pArt->lfoToGain); in WT_UpdateGain()
799 temp = (EAS_I16)MULT_EG1_EG1(temp, pWTVoice->eg1Value); in WT_UpdateGain()
823 static void WT_UpdateEG1 (S_WT_VOICE *pWTVoice, const S_ENVELOPE *pEnv) in WT_UpdateEG1() argument
827 switch (pWTVoice->eg1State) in WT_UpdateEG1()
830 temp = pWTVoice->eg1Value + pWTVoice->eg1Increment; in WT_UpdateEG1()
839 pWTVoice->eg1State = eEnvelopeStateDecay; in WT_UpdateEG1()
840 pWTVoice->eg1Increment = pEnv->decayTime; in WT_UpdateEG1()
847 temp = MULT_EG1_EG1(pWTVoice->eg1Value, pWTVoice->eg1Increment); in WT_UpdateEG1()
857 pWTVoice->eg1State = eEnvelopeStateSustain; in WT_UpdateEG1()
861 pWTVoice->eg1State = eEnvelopeStateMuted; in WT_UpdateEG1()
870 temp = MULT_EG1_EG1(pWTVoice->eg1Value, pWTVoice->eg1Increment); in WT_UpdateEG1()
876 pWTVoice->eg1State = eEnvelopeStateMuted; in WT_UpdateEG1()
896 pWTVoice->eg1Value = (EAS_I16) temp; in WT_UpdateEG1()
916 static void WT_UpdateEG2 (S_WT_VOICE *pWTVoice, const S_ENVELOPE *pEnv) in WT_UpdateEG2() argument
920 switch (pWTVoice->eg2State) in WT_UpdateEG2()
923 temp = pWTVoice->eg2Value + pWTVoice->eg2Increment; in WT_UpdateEG2()
932 pWTVoice->eg2State = eEnvelopeStateDecay; in WT_UpdateEG2()
934 pWTVoice->eg2Increment = pEnv->decayTime; in WT_UpdateEG2()
941 temp = pWTVoice->eg2Value -pWTVoice->eg2Increment; in WT_UpdateEG2()
950 pWTVoice->eg2State = eEnvelopeStateSustain; in WT_UpdateEG2()
958 temp = pWTVoice->eg2Value - pWTVoice->eg2Increment; in WT_UpdateEG2()
963 pWTVoice->eg2State = eEnvelopeStateMuted; in WT_UpdateEG2()
983 pWTVoice->eg2Value = (EAS_I16) temp; in WT_UpdateEG2()
1043 static void WT_UpdateFilter (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pIntFrame, const S_ARTICULATION … in WT_UpdateFilter() argument
1055 cutoff = MULT_EG1_EG1(pWTVoice->eg2Value, pArt->eg2ToFc); in WT_UpdateFilter()