Closed ryukau closed 4 years ago
That sounds great, looking forward to using it.
All these values will be updated for each DSP processing cycle.
Do you mean each sample, so iow audio rate, or each sample block, iow control rate, like the faders?
Update will be done in control rate.
OK, thanks.
Currently I'm using Faust's --one-sample
option. So I could also provide a trigger signal which outputs 1 at the start of beat and/or bar, and outputs 0 otherwise.
When you defined h/vslider
or other UI primitive to receive tempo sync information, please let me know the name of it.
What does --one-sample
do? I don't understand the help text:
-os --one-sample generate one sample computation.
On plugin, DSP method is called for each time DAW sends empty buffer. It looks like below:
// float** means 2D array here. 1D for channels, and other 1D for frames.
void run(int bufferSize, float** input, float** output) {
for (/* each frame */) {
for (/* each channel */) {
// Do some DSP processing.
}
}
}
In real code, there's usually no for loop over the channel count. I put it to make it explicit.
Without --one-sample
, Faust outputs C++ code that takes entire buffer and fills it, like the code above.
With --one-sample
, Faust output C++ code that takes only 1 frame, and it looks like code below.
// Notice that argument is float*, not float**. So it's 1D array of channels.
void run(int bufferSize, float* input, float* output) {
for (/* each channel */) {
// Do some DSP processing.
}
}
I'm using --one-sample
to supply accurate gate
timing for MIDI note-on/off.
Continued from: https://github.com/ryukau/LV2Plugins/issues/29
DPF can send tempo in BPM.
For position, it will be the frame count to the next beat (integer), or fraction of a beat (float). Frame count to the next bar is also possible to provide.
All these values will be updated for each DSP processing cycle.