diff options
Diffstat (limited to 'src/quantiser.c')
-rw-r--r-- | src/quantiser.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/quantiser.c b/src/quantiser.c index 419467f..8607359 100644 --- a/src/quantiser.c +++ b/src/quantiser.c @@ -154,6 +154,14 @@ cleanup(LV2_Handle instance) } static void +activate(LV2_Handle instance) +{ + Quantiser* plugin = (Quantiser*)instance; + + plugin->last_found = 0.0f; +} + +static void connect_port(LV2_Handle instance, uint32_t port, void* data) @@ -246,7 +254,7 @@ run(LV2_Handle instance, float out_changed; float range; float offset; - float found; + float found = last_found; int found_index = 0; /* Clip count if out of range */ @@ -436,7 +444,7 @@ static const LV2_Descriptor descriptor = { QUANTISER_URI, instantiate, connect_port, - NULL, + activate, run, NULL, cleanup, |