diff options
author | Jacob Lee <jacob@unabridgedsoftware.com> | 2021-12-04 10:59:14 -0500 |
---|---|---|
committer | Jacob Lee <jacob@unabridgedsoftware.com> | 2021-12-04 10:59:14 -0500 |
commit | 4924c965542392fe5d092c84f3eddc35afd8f7e2 (patch) | |
tree | 7f2eb74d67893156aa41fb70936e88ef4bdf0a34 /klangfarbrs/src/instrument.rs | |
parent | e91c02971c08a180a3b1dc3dee9a0b035a79fa95 (diff) |
Remove hacky trick for instrument and update the instrument in the trigger method on the synth instead
Diffstat (limited to 'klangfarbrs/src/instrument.rs')
-rw-r--r-- | klangfarbrs/src/instrument.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/klangfarbrs/src/instrument.rs b/klangfarbrs/src/instrument.rs index 6fc797b..bf08fe4 100644 --- a/klangfarbrs/src/instrument.rs +++ b/klangfarbrs/src/instrument.rs @@ -2,7 +2,6 @@ use super::{ Partial, Sample, Hz, SamplesPerSecond }; pub struct Instrument { pub partials: Vec<Partial>, - pub complete: bool, } impl Instrument { @@ -10,8 +9,7 @@ impl Instrument { Self { partials: partial_multipliers.iter() .map(|&p| Partial::new(1.0, 1.0, p, 0.0, sample_rate, 2000, base_freq)) - .collect(), - complete: false, + .collect() } } @@ -34,7 +32,6 @@ impl Iterator for Instrument { .map(|i| i.unwrap()).collect(); if filtered.is_empty() { - self.complete = true; None } else { Some(filtered.iter().sum()) |