Lines Matching refs:pChorusData
87 S_CHORUS_OBJECT *pChorusData;
93 pChorusData = EAS_CMEnumFXData(EAS_MODULE_CHORUS);
97 pChorusData = EAS_HWMalloc(pEASData->hwInstData, sizeof(S_CHORUS_OBJECT));
99 if (pChorusData == NULL)
106 EAS_HWMemSet(pChorusData, 0, sizeof(S_CHORUS_OBJECT));
108 ChorusReadInPresets(pChorusData);
111 pChorusData->bypass = EAS_CHORUS_BYPASS_DEFAULT;
112 pChorusData->preset = EAS_CHORUS_PRESET_DEFAULT;
113 pChorusData->m_nLevel = EAS_CHORUS_LEVEL_DEFAULT;
114 pChorusData->m_nRate = EAS_CHORUS_RATE_DEFAULT;
115 pChorusData->m_nDepth = EAS_CHORUS_DEPTH_DEFAULT;
124 pChorusData->m_nRate = (EAS_I16)
125 ((((EAS_I32)CHORUS_SHAPE_SIZE<<16)/(20*(EAS_I32)_OUTPUT_SAMPLE_RATE)) * pChorusData->m_nRate);
131 pChorusData->m_nDepth = (EAS_I16)
132 (((((EAS_I32)pChorusData->m_nDepth * _OUTPUT_SAMPLE_RATE)>>5) * 105) >> 16);
134 pChorusData->m_nLevel = pChorusData->m_nLevel;
139 pChorusData->chorusDelayL[index] = 0;
143 pChorusData->chorusDelayR[index] = 0;
147 pChorusData->chorusIndexL = 0;
148 pChorusData->chorusIndexR = 0;
152 pChorusData->lfoLPhase = 0;
153 pChorusData->lfoRPhase = (CHORUS_SHAPE_SIZE << 16) >> 2; // 1/4 of total, i.e. 90 degrees out of phase;
157 pChorusData->chorusTapPosition = (EAS_I16)((CHORUS_DELAY_MS * _OUTPUT_SAMPLE_RATE)/1000);
160 pPreset = &pChorusData->m_sPreset.m_sPreset[pChorusData->m_nNextChorus];
162 pChorusData->m_nLevel = pPreset->m_nLevel;
163 pChorusData->m_nRate = pPreset->m_nRate;
164 pChorusData->m_nDepth = pPreset->m_nDepth;
166 pChorusData->m_nRate = (EAS_I16)
167 ((((EAS_I32)CHORUS_SHAPE_SIZE<<16)/(20*(EAS_I32)_OUTPUT_SAMPLE_RATE)) * pChorusData->m_nRate);
170 pChorusData->m_nDepth = (EAS_I16)
171 (((((EAS_I32)pChorusData->m_nDepth * _OUTPUT_SAMPLE_RATE)>>5) * 105) >> 16);
173 *pInstData = pChorusData;
268 S_CHORUS_OBJECT *pChorusData;
270 pChorusData = (S_CHORUS_OBJECT*) pInstData;
273 if (pChorusData->bypass == EAS_TRUE || pChorusData->m_nLevel == 0)
280 if (pChorusData->m_nNextChorus != pChorusData->m_nCurrentChorus)
282 ChorusUpdate(pChorusData);
299 pChorusData->chorusDelayL[pChorusData->chorusIndexL] = nInputSample;
303 lfoValueLeft = WeightedTap(EAS_chorusShape, 0, pChorusData->lfoLPhase, CHORUS_SHAPE_SIZE);
308 positionOffsetL = pChorusData->m_nDepth * (((EAS_I32)lfoValueLeft) << 1);
311 positionOffsetL += ((EAS_I32)pChorusData->chorusTapPosition) << 16;
314 tapL = WeightedTap(pChorusData->chorusDelayL, pChorusData->chorusIndexL, positionOffsetL, CHORUS_L_SIZE);
317 tempValue = MULT_EG1_EG1(tapL, pChorusData->m_nLevel);
326 if ((pChorusData->chorusIndexL+=1) >= CHORUS_L_SIZE)
327 pChorusData->chorusIndexL = 0;
330 pChorusData->lfoLPhase += pChorusData->m_nRate;
331 while (pChorusData->lfoLPhase >= (CHORUS_SHAPE_SIZE<<16))
333 pChorusData->lfoLPhase -= (CHORUS_SHAPE_SIZE<<16);
345 pChorusData->chorusDelayR[pChorusData->chorusIndexR] = nInputSample;
349 lfoValueRight = WeightedTap(EAS_chorusShape, 0, pChorusData->lfoRPhase, CHORUS_SHAPE_SIZE);
354 positionOffsetR = pChorusData->m_nDepth * (((EAS_I32)lfoValueRight) << 1);
357 positionOffsetR += ((EAS_I32)pChorusData->chorusTapPosition) << 16;
360 tapR = WeightedTap(pChorusData->chorusDelayR, pChorusData->chorusIndexR, positionOffsetR, CHORUS_R_SIZE);
363 tempValue = MULT_EG1_EG1(tapR, pChorusData->m_nLevel);
371 if ((pChorusData->chorusIndexR+=1) >= CHORUS_R_SIZE)
372 pChorusData->chorusIndexR = 0;
375 pChorusData->lfoRPhase += pChorusData->m_nRate;
376 while (pChorusData->lfoRPhase >= (CHORUS_SHAPE_SIZE<<16))
378 pChorusData->lfoRPhase -= (CHORUS_SHAPE_SIZE<<16);
529 static EAS_RESULT ChorusReadInPresets(S_CHORUS_OBJECT *pChorusData)
538 S_CHORUS_PRESET *pPreset = &pChorusData->m_sPreset.m_sPreset[defaultPreset];
585 static EAS_RESULT ChorusUpdate(S_CHORUS_OBJECT *pChorusData)
587 S_CHORUS_PRESET *pPreset = &pChorusData->m_sPreset.m_sPreset[pChorusData->m_nNextChorus];
589 pChorusData->m_nLevel = pPreset->m_nLevel;
590 pChorusData->m_nRate = pPreset->m_nRate;
591 pChorusData->m_nDepth = pPreset->m_nDepth;
593 pChorusData->m_nRate = (EAS_I16)
594 ((((EAS_I32)CHORUS_SHAPE_SIZE<<16)/(20*(EAS_I32)_OUTPUT_SAMPLE_RATE)) * pChorusData->m_nRate);
597 pChorusData->m_nDepth = (EAS_I16)
598 (((((EAS_I32)pChorusData->m_nDepth * _OUTPUT_SAMPLE_RATE)>>5) * 105) >> 16);
600 pChorusData->m_nCurrentChorus = pChorusData->m_nNextChorus;