Audio Divider (Suboctave Generator)
Reduces the period of the signal by the factor given, and makes it a square wave in the process. Has some amplitude tracking capability, but not really useful on complex signals.
0.0f && last <= 0.0f) ||
(input[pos] < 0.0f && last >= 0.0)) {
zeroxs++;
if (den == 1) {
out = out > 0.0f ? -1.0f : 1.0f;
lamp = amp / count;
zeroxs = 0;
count = 0;
amp = 0;
}
}
amp += fabs(input[pos]);
if (den > 1 && (zeroxs % den) == den-1) {
out = out > 0.0f ? -1.0f : 1.0f;
lamp = amp / count;
zeroxs = 0;
count = 0;
amp = 0;
}
last = input[pos];
buffer_write(output[pos], out * lamp);
}
plugin_data->last = last;
plugin_data->amp = amp;
plugin_data->lamp = lamp;
plugin_data->zeroxs = zeroxs;
plugin_data->count = count;
plugin_data->out = out;
]]>
Denominator
The factor the incoming frequency will be divided by.
Input
Output