Exemple #1
0
void
runSineOscillator_FreqCtrl_AmpAudio(LADSPA_Handle Instance,
                                    unsigned long SampleCount) {
  SineOscillator * poSineOscillator = (SineOscillator *)Instance;
  poSineOscillator->setPhaseStepFromFrequency
    (*(poSineOscillator->m_pfFrequency));
  for (unsigned long lIndex = 0; lIndex < SampleCount; lIndex++) {
    poSineOscillator->m_pfOutput[lIndex]
      = (g_pfSineTable[poSineOscillator->m_lPhase >> SINE_TABLE_SHIFT]
         * poSineOscillator->m_pfAmplitude[lIndex]);
    poSineOscillator->m_lPhase 
      += poSineOscillator->m_lPhaseStep;
  }
}
Exemple #2
0
void 
runSineOscillator_FreqAudio_AmpAudio(LADSPA_Handle Instance,
                                     unsigned long SampleCount) {
  SineOscillator * poSineOscillator = (SineOscillator *)Instance;
  for (unsigned long lIndex = 0; lIndex < SampleCount; lIndex++) {
    /* Extract frequency at this point to guarantee inplace
       support. */
    LADSPA_Data fFrequency
      = (poSineOscillator->m_pfFrequency[lIndex]);
    poSineOscillator->m_pfOutput[lIndex]
      = (g_pfSineTable[poSineOscillator->m_lPhase >> SINE_TABLE_SHIFT]
         * poSineOscillator->m_pfAmplitude[lIndex]);
    poSineOscillator->setPhaseStepFromFrequency(fFrequency);
    poSineOscillator->m_lPhase 
      += poSineOscillator->m_lPhaseStep;
  }
}