Browse Source

make cv trigger sample-accurate

master
Alexandros Theodotou 3 years ago
parent
commit
10224e3147
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 3
      .gitignore
  2. 2
      meson.build
  3. 13
      src/zlfo.c

3
.gitignore vendored

@ -86,3 +86,6 @@ vgcore.* @@ -86,3 +86,6 @@ vgcore.*
# subprojects
subprojects/**/*
# callgrind
callgrind.*

2
meson.build

@ -54,7 +54,7 @@ zlfodir = join_paths(lv2dir, 'ZLFO.lv2') @@ -54,7 +54,7 @@ zlfodir = join_paths(lv2dir, 'ZLFO.lv2')
zlfo_cdata = configuration_data ()
zlfo_cdata.set (
'PROJECT_URI',
'https://lv2.zrythm.org/plugins')
'https://www.zrythm.org/plugins')
zlfo_cdata.set (
'LFO_URI',
zlfo_cdata.get ('PROJECT_URI') + '/ZLFO')

13
src/zlfo.c

@ -496,19 +496,18 @@ run ( @@ -496,19 +496,18 @@ run (
((float) self->common.period_size /
grid_step_divisor);
/* handle triggers
*
* FIXME CV trigger requires splitting the cycle,
* but for now it applies to the whole cycle */
if (IS_TRIGGERED (self) ||
float_array_contains_nonzero (
self->cv_trigger, n_samples))
/* handle control trigger */
if (IS_TRIGGERED (self))
{
self->common.current_sample = 0;
}
for (uint32_t i = 0; i < n_samples; i++)
{
/* handle cv trigger */
if (self->cv_trigger[i] > 0.00001f)
self->common.current_sample = 0;
/* invert horizontally */
long shifted_current_sample =
self->common.current_sample;

Loading…
Cancel
Save