MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / pitch_synch_par_reset

Method pitch_synch_par_reset

extlibs/soloud/src/audiosource/speech/klatt.cpp:367–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365/* Reset selected parameters pitch-synchronously */
366
367void klatt::pitch_synch_par_reset(int ns)
368{
369 if (mF0FundamentalFreq > 0)
370 {
371 mT0 = (40 * mSampleRate) / mF0FundamentalFreq;
372
373 /* Period in samp*4 */
374 mAmpVoice = DBtoLIN(mVoicingAmpdb);
375
376 /* Duration of period before amplitude modulation */
377 mNMod = mT0;
378
379 if (mVoicingAmpdb > 0)
380 {
381 mNMod >>= 1;
382 }
383
384 /* Breathiness of voicing waveform */
385
386 mAmpBreth = DBtoLIN(mFrame.mVoicingBreathiness) * 0.1f;
387
388 /* Set open phase of glottal period */
389 /* where 40 <= open phase <= 263 */
390
391 mNOpen = 4 * mFrame.mNoSamplesInOpenPeriod;
392
393 if (mNOpen >= (mT0 - 1))
394 {
395 mNOpen = mT0 - 2;
396 }
397
398 if (mNOpen < 40)
399 {
400 mNOpen = 40; /* F0 max = 1000 Hz */
401 }
402
403 int temp;
404 float temp1;
405
406 temp = mSampleRate / mNOpen;
407 mCritDampedGlotLowPassFilter.initResonator(0L, temp, mSampleRate);
408
409 /* Make gain at F1 about constant */
410
411 temp1 = mNOpen * .00833f;
412 mCritDampedGlotLowPassFilter.setGain(temp1 * temp1);
413
414 /* Truncate skewness so as not to exceed duration of closed phase
415 of glottal period */
416
417 temp = mT0 - mNOpen;
418
419 if (mSkewnessOfAlternatePeriods > temp)
420 {
421 mSkewnessOfAlternatePeriods = temp;
422 }
423
424 if (mSkew >= 0)

Callers

nothing calls this directly

Calls 3

DBtoLINFunction · 0.85
initResonatorMethod · 0.80
setGainMethod · 0.80

Tested by

no test coverage detected