History

clip vzfilter freq on init; handling for 0 cfxlen in sampler

Matthew Wang committed 6 years ago

Commit d57d77b1 parent 24675fa2 files · +5 −5Browse files

Unified · Split

2 files
  1. leaf/Src/leaf-filters.c +1 −1
  2. leaf/Src/leaf-sampling.c +4 −4
leaf/Src/leaf-filters.c+1−1
@@ -1241,7 +1241,7 @@ void tVZFilter_initToPool (tVZFilter* const vf, VZFilterType type, float · 1240 unmodified lines
1241 1241
1242 LEAF* leaf = f->mempool->leaf;1242 LEAF* leaf = f->mempool->leaf;
1243 1243
1244 f->fc = freq;1244 f->fc = LEAF_clip(0.0f, freq, 0.5f * leaf->sampleRate);
1245 f->type = type;1245 f->type = type;
1246 f->G = ONE_OVER_SQRT2;1246 f->G = ONE_OVER_SQRT2;
1247 f->invG = 1.0f/ONE_OVER_SQRT2;1247 f->invG = 1.0f/ONE_OVER_SQRT2;
leaf/Src/leaf-sampling.c+4−4
@@ -383,7 +383,8 @@ float tSampler_tick (tSampler* const sp) · 382 unmodified lines
383 buff[c3],383 buff[c3],
384 buff[c4],384 buff[c4],
385 alpha);385 alpha);
386 crossfadeMix = (float) offset / (float) cfxlen;386 if (cfxlen > 0.0f) crossfadeMix = (float) offset / (float) cfxlen;
387 else crossfadeMix = 0.0f;
387 }388 }
388 389
389 float flipLength = fabsf(p->flipIdx - p->flipStart);390 float flipLength = fabsf(p->flipIdx - p->flipStart);
@@ -525,8 +526,6 @@ float tSampler_tick (tSampler* const sp) · 135 unmodified lines
525 }526 }
526 }527 }
527 528
528
529
530 p->last = sample;529 p->last = sample;
531 530
532 531
@@ -705,7 +704,8 @@ float tSampler_tickStereo (tSampler* const sp, float* outputArray) · 172 unmodified lines
705 buff[(f4 * p->channels) + 1],704 buff[(f4 * p->channels) + 1],
706 falpha);705 falpha);
707 706
708 flipMix = (float) (cfxlen - flipLength) / (float) cfxlen;707 if (cfxlen > 0) flipMix = (float) (cfxlen - flipLength) / (float) cfxlen;
708 else flipMix = 1.0f;
709 }709 }
710 }710 }
711 711

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t