makes annoying 440Hz tone
This commit is contained in:
parent
386a4f36da
commit
3e18a96554
@ -20,14 +20,23 @@
|
|||||||
|
|
||||||
START_NAMESPACE_DISTRHO
|
START_NAMESPACE_DISTRHO
|
||||||
|
|
||||||
Sonnenlicht::Sonnenlicht() : Plugin(kParameterCount, 0, 0) {
|
Sonnenlicht::Sonnenlicht() : Plugin(kParameterCount, 0, 0), fSampleRate(getSampleRate()) {
|
||||||
printf("initialiser called\n");
|
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(); }
|
||||||
|
@ -54,6 +54,8 @@ class Sonnenlicht : public Plugin {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
double fSampleRate;
|
double fSampleRate;
|
||||||
|
float phase;
|
||||||
|
float w;
|
||||||
|
|
||||||
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Sonnenlicht);
|
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Sonnenlicht);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user