Lines Matching refs:pWTVoice
55 S_WT_VOICE *pWTVoice; in DLS_MuteVoice() local
58 pWTVoice = &pVoiceMgr->wtVoices[voiceNum]; in DLS_MuteVoice()
59 pDLSArt = &pSynth->pDLS->pDLSArticulations[pWTVoice->artIndex]; in DLS_MuteVoice()
69 pWTVoice->eg1Increment = pDLSArt->eg1ShutdownTime; in DLS_MuteVoice()
71 pWTVoice->eg2Increment = pDLSArt->eg2.releaseTime; in DLS_MuteVoice()
83 S_WT_VOICE *pWTVoice; in DLS_ReleaseVoice() local
86 pWTVoice = &pVoiceMgr->wtVoices[voiceNum]; in DLS_ReleaseVoice()
87 pDLSArt = &pSynth->pDLS->pDLSArticulations[pWTVoice->artIndex]; in DLS_ReleaseVoice()
92 if (pWTVoice->eg1State == eEnvelopeStateAttack) in DLS_ReleaseVoice()
93 pWTVoice->eg1Value = (EAS_I16) ((EAS_flog2(pWTVoice->eg1Value) << 1) + 2048); in DLS_ReleaseVoice()
96 pWTVoice->eg1State = eEnvelopeStateRelease; in DLS_ReleaseVoice()
97 pWTVoice->eg1Increment = pDLSArt->eg1.releaseTime; in DLS_ReleaseVoice()
100 pWTVoice->eg2State = eEnvelopeStateRelease; in DLS_ReleaseVoice()
101 pWTVoice->eg2Increment = pDLSArt->eg2.releaseTime; in DLS_ReleaseVoice()
114 S_WT_VOICE *pWTVoice; in DLS_SustainPedal() local
117 pWTVoice = &pVoiceMgr->wtVoices[voiceNum]; in DLS_SustainPedal()
118 pDLSArt = &pSynth->pDLS->pDLSArticulations[pWTVoice->artIndex]; in DLS_SustainPedal()
121 if (pWTVoice->eg1Value < pDLSArt->eg1.sustainLevel) in DLS_SustainPedal()
125 pWTVoice->eg1State = eEnvelopeStateDecay; in DLS_SustainPedal()
140 static EAS_I32 DLS_UpdatePhaseInc (S_WT_VOICE *pWTVoice, const S_DLS_ARTICULATION *pDLSArt, S_SYNTH… in DLS_UpdatePhaseInc() argument
156 pitchCents += FMUL_15x15(temp, pWTVoice->modLFO.lfoValue); in DLS_UpdatePhaseInc()
170 pitchCents += FMUL_15x15(temp, pWTVoice->vibLFO.lfoValue); in DLS_UpdatePhaseInc()
173 pitchCents += FMUL_15x15(pDLSArt->eg2ToPitch, pWTVoice->eg2Value); in DLS_UpdatePhaseInc()
185 static EAS_I32 DLS_UpdateGain (S_WT_VOICE *pWTVoice, const S_DLS_ARTICULATION *pDLSArt, S_SYNTH_CHA… in DLS_UpdateGain() argument
201 gain += FMUL_15x15(temp, pWTVoice->modLFO.lfoValue); in DLS_UpdateGain()
206 if (pWTVoice->eg1State != eEnvelopeStateAttack) in DLS_UpdateGain()
211 gain += (pWTVoice->eg1Value - 32767) >> 1; in DLS_UpdateGain()
215 temp = EAS_LogToLinear16((pWTVoice->eg1Value - 32767) >> 1); in DLS_UpdateGain()
223 gain = FMUL_15x15(gain, pWTVoice->eg1Value); in DLS_UpdateGain()
247 static void DLS_UpdateFilter (S_SYNTH_VOICE *pVoice, S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pIntFram… in DLS_UpdateFilter() argument
274 cutoff += FMUL_15x15(temp, pWTVoice->modLFO.lfoValue); in DLS_UpdateFilter()
277 cutoff += FMUL_15x15(pWTVoice->eg2Value, pDLSArt->eg2ToFc); in DLS_UpdateFilter()
307 S_WT_VOICE *pWTVoice; in DLS_StartVoice() local
316 pWTVoice = &pVoiceMgr->wtVoices[voiceNum]; in DLS_StartVoice()
319 pWTVoice->artIndex = pDLSRegion->wtRegion.artIndex; in DLS_StartVoice()
320 pDLSArt = &pSynth->pDLS->pDLSArticulations[pWTVoice->artIndex]; in DLS_StartVoice()
323 pWTVoice->eg1State = eEnvelopeStateInit; in DLS_StartVoice()
324 …UpdateEnvelope(pVoice, pChannel, &pDLSArt->eg1, &pWTVoice->eg1Value, &pWTVoice->eg1Increment, &pWT… in DLS_StartVoice()
325 pWTVoice->eg2State = eEnvelopeStateInit; in DLS_StartVoice()
326 …UpdateEnvelope(pVoice, pChannel, &pDLSArt->eg2, &pWTVoice->eg2Value, &pWTVoice->eg2Increment, &pWT… in DLS_StartVoice()
329 pWTVoice->modLFO.lfoValue = 0; in DLS_StartVoice()
330 pWTVoice->modLFO.lfoPhase = pDLSArt->modLFO.lfoDelay; in DLS_StartVoice()
331 pWTVoice->vibLFO.lfoValue = 0; in DLS_StartVoice()
332 pWTVoice->vibLFO.lfoPhase = pDLSArt->vibLFO.lfoDelay; in DLS_StartVoice()
335 …UpdateEnvelope(pVoice, pChannel, &pDLSArt->eg1, &pWTVoice->eg1Value, &pWTVoice->eg1Increment, &pWT… in DLS_StartVoice()
336 …UpdateEnvelope(pVoice, pChannel, &pDLSArt->eg2, &pWTVoice->eg2Value, &pWTVoice->eg2Increment, &pWT… in DLS_StartVoice()
337 …pVoice->gain = (EAS_I16) DLS_UpdateGain(pWTVoice, pDLSArt, pChannel, pDLSRegion->wtRegion.gain, pV… in DLS_StartVoice()
340 …ntrol((EAS_INT) pChannel->pan - 64 + (EAS_INT) pDLSArt->pan, &pWTVoice->gainLeft, &pWTVoice->gainR… in DLS_StartVoice()
344 pWTVoice->filter.z1 = 0; in DLS_StartVoice()
345 pWTVoice->filter.z2 = 0; in DLS_StartVoice()
348 …pWTVoice->phaseAccum = (EAS_U32) pSynth->pDLS->pDLSSamples + pSynth->pDLS->pDLSSampleOffsets[pDLSR… in DLS_StartVoice()
351 pWTVoice->loopStart = pWTVoice->phaseAccum + pDLSRegion->wtRegion.loopStart; in DLS_StartVoice()
352 pWTVoice->loopEnd = pWTVoice->phaseAccum + pDLSRegion->wtRegion.loopEnd - 1; in DLS_StartVoice()
355 …pWTVoice->loopStart = pWTVoice->loopEnd = pWTVoice->phaseAccum + pSynth->pDLS->pDLSSampleLen[pDLSR… in DLS_StartVoice()
380 S_WT_VOICE *pWTVoice; in DLS_UpdateVoice() local
389 pWTVoice = &pVoiceMgr->wtVoices[voiceNum]; in DLS_UpdateVoice()
392 pDLSArt = &pSynth->pDLS->pDLSArticulations[pWTVoice->artIndex]; in DLS_UpdateVoice()
395 …UpdateEnvelope(pVoice, pChannel, &pDLSArt->eg1, &pWTVoice->eg1Value, &pWTVoice->eg1Increment, &pWT… in DLS_UpdateVoice()
396 …UpdateEnvelope(pVoice, pChannel, &pDLSArt->eg2, &pWTVoice->eg2Value, &pWTVoice->eg2Increment, &pWT… in DLS_UpdateVoice()
399 WT_UpdateLFO(&pWTVoice->modLFO, pDLSArt->modLFO.lfoFreq); in DLS_UpdateVoice()
400 WT_UpdateLFO(&pWTVoice->vibLFO, pDLSArt->vibLFO.lfoFreq); in DLS_UpdateVoice()
411 intFrame.frame.phaseIncrement = DLS_UpdatePhaseInc(pWTVoice, pDLSArt, pChannel, temp); in DLS_UpdateVoice()
414 …intFrame.frame.gainTarget = DLS_UpdateGain(pWTVoice, pDLSArt, pChannel, pDLSRegion->wtRegion.gain,… in DLS_UpdateVoice()
417 DLS_UpdateFilter(pVoice, pWTVoice, &intFrame, pChannel, pDLSArt); in DLS_UpdateVoice()
427 if ((pWTVoice->loopStart != WT_NOISE_GENERATOR) && (pWTVoice->loopStart == pWTVoice->loopEnd)) in DLS_UpdateVoice()
428 done = WT_CheckSampleEnd(pWTVoice, &intFrame, EAS_FALSE); in DLS_UpdateVoice()
430 WT_ProcessVoice(pWTVoice, &intFrame); in DLS_UpdateVoice()
442 if ((pVoice->voiceState != eVoiceStateStolen) && (pWTVoice->eg1State == eEnvelopeStateMuted)) in DLS_UpdateVoice()