ref: 5a5d9902af9c8b2680721fec0ae49426488bf829
parent: 9d010e10d629076b03a79d505c1a1f496ca2033f
author: Matthew Wang <mjw7@princeton.edu>
date: Wed Jul 28 09:16:34 EDT 2021
flip mbpulse phase
--- a/leaf/Src/leaf-math.c
+++ b/leaf/Src/leaf-math.c
@@ -839,12 +839,6 @@
i = lrintf(r - 0.5f);
r -= (float)i;
i &= MINBLEP_PHASE_MASK; /* extreme modulation can cause i to be out-of-range */
- /* this would be better than the above, but more expensive:
- * while (i < 0) {
- * i += MINBLEP_PHASES;
- * index++;
- * }
- */
while (i < MINBLEP_PHASES * STEP_DD_PULSE_LENGTH) {
buffer[index] += scale * (step_dd_table[i].value + r * step_dd_table[i].delta);
--- a/leaf/Src/leaf-oscillators.c
+++ b/leaf/Src/leaf-oscillators.c
@@ -1181,7 +1181,7 @@
c->_j = j;
c->_k = k;
- return c->out;
+ return -c->out;
}
void tMBPulse_setFreq(tMBPulse* const osc, float f)
@@ -1483,7 +1483,7 @@
c->_j = j;
c->_k = k;
- return c->out;
+ return -c->out;
}
void tMBTriangle_setFreq(tMBTriangle* const osc, float f)
@@ -1655,7 +1655,7 @@
c->_z = z;
c->_j = j;
- return c->out;
+ return -c->out;
}
void tMBSaw_setFreq(tMBSaw* const osc, float f)