makes annoying 440Hz tone

This commit is contained in:
Gordon JC Pearce 2024-08-19 08:35:26 +01:00
parent 386a4f36da
commit 3e18a96554
2 changed files with 17 additions and 6 deletions

View File

@ -20,16 +20,25 @@
START_NAMESPACE_DISTRHO
Sonnenlicht::Sonnenlicht() : Plugin(kParameterCount, 0, 0) {
printf("initialiser called\n");
Sonnenlicht::Sonnenlicht() : Plugin(kParameterCount, 0, 0), fSampleRate(getSampleRate()) {
printf("initialiser called\n");
w = 440.0 / fSampleRate;
phase = 0;
}
void Sonnenlicht::run(const float**, float** outputs, uint32_t frames,
const MidiEvent* midiEvents, uint32_t midiEventCount) {
for (uint32_t i = 0; i < frames; i++) {
phase += w;
if (phase > 1) phase -= 1;
outputs[0][i] = phase - 0.5;
outputs[1][i] = phase - 0.5;
void Sonnenlicht::run(const float**, float** outputs,
uint32_t frames, const MidiEvent* midiEvents, uint32_t midiEventCount)
{
}
}
Plugin *createPlugin() { return new Sonnenlicht(); }
Plugin* createPlugin() { return new Sonnenlicht(); }
END_NAMESPACE_DISTRHO

View File

@ -54,6 +54,8 @@ class Sonnenlicht : public Plugin {
private:
double fSampleRate;
float phase;
float w;
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Sonnenlicht);
};