mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
Add Dotted option to a-delay, because dotted intervals cannot be expressed via the integer Divisor param
This commit is contained in:
parent
6af2f4e127
commit
0c7895298d
2 changed files with 30 additions and 6 deletions
|
|
@ -53,6 +53,7 @@ typedef enum {
|
|||
ADELAY_SYNC,
|
||||
ADELAY_TIME,
|
||||
ADELAY_DIVISOR,
|
||||
ADELAY_DOTTED,
|
||||
ADELAY_WETDRY,
|
||||
ADELAY_FEEDBACK,
|
||||
ADELAY_LPF,
|
||||
|
|
@ -82,6 +83,7 @@ typedef struct {
|
|||
const LV2_Atom_Sequence* atombpm;
|
||||
|
||||
float* inv;
|
||||
float* dotted;
|
||||
float* sync;
|
||||
float* time;
|
||||
float* divisor;
|
||||
|
|
@ -108,6 +110,7 @@ typedef struct {
|
|||
float feedbackold;
|
||||
float divisorold;
|
||||
float gainold;
|
||||
float dottedold;
|
||||
float invertold;
|
||||
float timeold;
|
||||
float delaytimeold;
|
||||
|
|
@ -201,6 +204,9 @@ connect_port(LV2_Handle instance,
|
|||
case ADELAY_DIVISOR:
|
||||
adelay->divisor = (float*)data;
|
||||
break;
|
||||
case ADELAY_DOTTED:
|
||||
adelay->dotted = (float*)data;
|
||||
break;
|
||||
case ADELAY_WETDRY:
|
||||
adelay->wetdry = (float*)data;
|
||||
break;
|
||||
|
|
@ -283,6 +289,7 @@ activate(LV2_Handle instance)
|
|||
adelay->divisorold = 0.f;
|
||||
adelay->gainold = 0.f;
|
||||
adelay->invertold = 0.f;
|
||||
adelay->dottedold = 0.f;
|
||||
adelay->timeold = 0.f;
|
||||
adelay->delaytimeold = 0.f;
|
||||
adelay->syncold = 0.f;
|
||||
|
|
@ -417,6 +424,9 @@ run(LV2_Handle instance, uint32_t n_samples)
|
|||
if (*(adelay->inv) != adelay->invertold) {
|
||||
recalc = true;
|
||||
}
|
||||
if (*(adelay->dotted) != adelay->dottedold) {
|
||||
recalc = true;
|
||||
}
|
||||
if (*(adelay->sync) != adelay->syncold) {
|
||||
recalc = true;
|
||||
}
|
||||
|
|
@ -441,6 +451,9 @@ run(LV2_Handle instance, uint32_t n_samples)
|
|||
lpfRbj(adelay, adelay->lpfold, srate);
|
||||
if (*(adelay->sync) > 0.5f && adelay->bpmvalid) {
|
||||
*(adelay->delaytime) = adelay->beatunit * 1000.f * 60.f / (adelay->bpm * *(adelay->divisor));
|
||||
if (*(adelay->dotted) > 0.5f) {
|
||||
*(adelay->delaytime) *= 1.5;
|
||||
}
|
||||
} else {
|
||||
*(adelay->delaytime) = *(adelay->time);
|
||||
}
|
||||
|
|
@ -484,6 +497,7 @@ run(LV2_Handle instance, uint32_t n_samples)
|
|||
adelay->feedbackold = *(adelay->feedback);
|
||||
adelay->divisorold = *(adelay->divisor);
|
||||
adelay->invertold = *(adelay->inv);
|
||||
adelay->dottedold = *(adelay->dotted);
|
||||
adelay->timeold = *(adelay->time);
|
||||
adelay->syncold = *(adelay->sync);
|
||||
adelay->wetdryold = wetdry;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue