So I’m building my first plugin/module. This is what I want to do, I post it here, not so much so someone tell me what to do, but I wonder how I go about finding how to go about it. I’m looking into the API and I am not even sure how to search about thing like volume (I guess it might be related to voltage?)
I want
1- A hardcoded frequency (on 3 differents octaves). 2- A volume knob
3- In gate to trigger the sounds (which would always play if not triggered) 4- In for volume (would override the volume on the module itself)
4- 2 outputs for left and right.
I got the UI with the input/output/knobs at the right place, and loaded as variable.
How do I check if there is an input? and if there is no Input to get the value from the knob I have setup?
For 2 outputs I get:
outputs[LEFTOUT_OUTPUT].setVoltage(5.f * sine);
outputs[RIGHTOUT_OUTPUT].setVoltage(5.f * sine);
For the static frequency:
float freq = 126.27f;
// Accumulate the phase
phase += freq * args.sampleTime;
if (phase >= 0.5f)
phase -= 1.f;
// Compute the sine output
float sine = std::sin(2.f * M_PI * phase);
But that doesn’t seem to output a sine of 126.27 for example, it seems way too low.
Anyway, I just need a kick in the right direction to go about learning all these basis.