summaryrefslogtreecommitdiff
path: root/src/seq/sequencer.rs
diff options
context:
space:
mode:
authorthajohns <thajohns@clarkson.edu>2021-09-09 01:16:04 -0400
committerGraham Northup <grahamnorthup@yahoo.com>2021-09-10 04:05:55 -0400
commit911a4a80eb7e4d98a96b813ebff3e659d50f040c (patch)
tree7f3c0964b49f2f0d03d18da16f367c5fe8ff1a1d /src/seq/sequencer.rs
parentd6e399973e9bc6447a28b80cacffcbc6a768f1ed (diff)
formatted some more
Diffstat (limited to 'src/seq/sequencer.rs')
-rw-r--r--src/seq/sequencer.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/seq/sequencer.rs b/src/seq/sequencer.rs
index 753a2f1..deedc4b 100644
--- a/src/seq/sequencer.rs
+++ b/src/seq/sequencer.rs
@@ -1,6 +1,6 @@
-use super::{NoteStream, Note, IV};
+use super::{Note, NoteStream, IV};
-pub fn coalesce<'a, I: Iterator<Item=&'a NoteStream>>(stream_iter: I) -> NoteStream {
+pub fn coalesce<'a, I: Iterator<Item = &'a NoteStream>>(stream_iter: I) -> NoteStream {
let mut output = NoteStream::new();
for ns in stream_iter {
@@ -16,13 +16,15 @@ pub struct SchedParams {
impl Default for SchedParams {
fn default() -> SchedParams {
- SchedParams {
- epsilon: 0.0,
- }
+ SchedParams { epsilon: 0.0 }
}
}
-pub fn schedule<'a, 'b: 'a, I: Iterator<Item=&'a Note>, F: FnMut(&'a Note) -> Option<&'b str>>(notes: I, mut classifier: F, params: &SchedParams) -> IV {
+pub fn schedule<'a, 'b: 'a, I: Iterator<Item = &'a Note>, F: FnMut(&'a Note) -> Option<&'b str>>(
+ notes: I,
+ mut classifier: F,
+ params: &SchedParams,
+) -> IV {
let mut output: IV = Default::default();
for note in notes {
@@ -41,7 +43,7 @@ pub fn schedule<'a, 'b: 'a, I: Iterator<Item=&'a Note>, F: FnMut(&'a Note) -> Op
if ns.len() > 0 {
let nt = &ns[ns.len() - 1];
if note.time.0 < nt.time.0 + nt.dur.0 + params.epsilon {
- continue
+ continue;
}
}
found = Some(idx);