summaryrefslogtreecommitdiff
path: root/klangfarbrs/src/phasor.rs
diff options
context:
space:
mode:
authorGrant Shangreaux <grant@unabridgedsoftware.com>2021-11-13 18:35:14 -0600
committerGrant Shangreaux <grant@unabridgedsoftware.com>2021-11-13 18:35:14 -0600
commit31e34297ed073927a63d0d9fccafc868998b8f46 (patch)
tree0246cc3ccc193b779cdf7f5697e32f694767b6a3 /klangfarbrs/src/phasor.rs
parentd3776887db90ac1ea15fd55d833ff6b3042e7caf (diff)
Clean: a bit of junk moved around, Add: Osc::sample method
Diffstat (limited to 'klangfarbrs/src/phasor.rs')
-rw-r--r--klangfarbrs/src/phasor.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/klangfarbrs/src/phasor.rs b/klangfarbrs/src/phasor.rs
index ace374a..5bfc79e 100644
--- a/klangfarbrs/src/phasor.rs
+++ b/klangfarbrs/src/phasor.rs
@@ -46,3 +46,24 @@ mod tests {
// assert_eq!([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 0.1], next)
}
}
+
+
+// TODO: fixup bender/modulator to allow phase modulation again
+// pub struct Bender {}
+
+// impl Bender {
+// // for (i = 0; i < nframes; ++i) {
+// // if (in[i] < x0)
+// // out[i] = (y0/x0)*in[i];
+// // else
+// // out[i] = ((1-y0)/(1-x0)) * (in[i] - x0) + y0;
+// // }
+// fn bend(phase: Phase, phasor_bend: Vector2) -> f32 {
+// if phase < phasor_bend.x {
+// (phasor_bend.y / phasor_bend.x) * phase
+// } else {
+// ((1.0 - phasor_bend.y) / (1.0 - phasor_bend.x)) * (phase - phasor_bend.x) + phasor_bend.y
+// }
+// }
+// }
+