Exemple #1
0
static void _pluginGainProcessAudio(void *pluginPtr, SampleBuffer inputs,
                                    SampleBuffer outputs) {
  Plugin plugin = (Plugin)pluginPtr;
  PluginGainSettings settings = (PluginGainSettings)plugin->extraData;
  unsigned long channel, sample;

  sampleBufferCopyAndMapChannels(outputs, inputs);

  for (channel = 0; channel < outputs->numChannels; ++channel) {
    for (sample = 0; sample < outputs->blocksize; ++sample) {
      outputs->samples[channel][sample] *= settings->gain;
    }
  }
}
Exemple #2
0
static void _pluginLimiterProcessAudio(void *pluginPtr, SampleBuffer inputs,
                                       SampleBuffer outputs) {
  unsigned long channel, sample;

  sampleBufferCopyAndMapChannels(outputs, inputs);

  for (channel = 0; channel < outputs->numChannels; ++channel) {
    for (sample = 0; sample < outputs->blocksize; ++sample) {
      if (outputs->samples[channel][sample] > 1.0f) {
        outputs->samples[channel][sample] = 1.0f;
      } else if (outputs->samples[channel][sample] < -1.0f) {
        outputs->samples[channel][sample] = -1.0f;
      }
    }
  }
}
static void _pluginPassthruProcessAudio(void* pluginPtr, SampleBuffer inputs, SampleBuffer outputs) {
  sampleBufferCopyAndMapChannels(outputs, inputs);
}