History

Fix lfo depth

Davis Polito committed 4 years ago

Commit 80fdd361 parent 8190e161 file · +4 −4Browse files

Unified · Split

leaf/Src/leaf-oscillators.c+4−4
@@ -2912,7 +2912,7 @@ float tSquareLFO_tick(tSquareLFO* const cy) · 2911 unmodified lines
29122912 // Phasor increment
29132913 float a = tIntPhasor_tick(&c->phasor);
29142914 float b = tIntPhasor_tick(&c->invPhasor);
2915− float tmp = ((a - b)) + c->pulsewidth - 1.0f;
2915+ float tmp = ((a - b)) + c->pulsewidth - 0.5f;
29162916 return 2 * tmp;
29172917 }
29182918
@@ -2974,7 +2974,7 @@ void tSawSquareLFO_free (tSawSquareLFO* const cy) · 55 unmodified lines
29742974 float tSawSquareLFO_tick (tSawSquareLFO* const cy)
29752975 {
29762976 _tSawSquareLFO* c = *cy;
2977− float a = tIntPhasor_tick(&c->saw);
2977+ float a = (tIntPhasor_tick(&c->saw) - 0.5f ) * 2.0f;
29782978 float b = tSquareLFO_tick(&c->square);
29792979 return (1 - c->shape) * a + c->shape * b;
29802980 }
@@ -3081,7 +3081,7 @@ void tTriLFO_setFreq(tTriLFO* const cy, float freq) · 100 unmodified lines
30813081 void tTriLFO_setPhase(tTriLFO* const cy, float phase)
30823082 {
30833083 _tTriLFO* c = *cy;
3084−
3084+ phase = (phase + 0.5f);
30853085 int i = phase;
30863086 phase -= i;
30873087 c->phase = phase * TWO_TO_32_INT;
@@ -3110,7 +3110,7 @@ void tSineTriLFO_initToPool (tSineTriLFO* const cy, tMempool* const mp) · 22 unmodified lines
31103110 LEAF* leaf = c->mempool->leaf;
31113111 tTriLFO_initToPool(&c->tri,mp);
31123112 tCycle_initToPool(&c->sine,mp);
3113−
3113+
31143114 }
31153115 void tSineTriLFO_free (tSineTriLFO* const cy)
31163116 {

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