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