pub fn split_at_durations(stream: &mut Stream) -> Result<()>Expand description
Cuts every note, chord and rest whose length no single written value
writes into pieces that each are one, tied: music21’s splitAtDurations
with recurse.
A rest filling its measure’s whole bar is left as it is, as a whole-bar rest is written as one whatever its length. Spanners joining a note that is cut start on its first piece and end on its last.
use music21_rs::makenotation::split_at_durations;
use music21_rs::{Duration, Note, Stream};
let mut line = Stream::new();
line.insert(0.0, Note::from_name("C4")?.with_duration(Duration::new(5.0)?));
split_at_durations(&mut line)?;
assert_eq!(line.len(), 2);
assert_eq!(line.events()[1].offset(), 4.0);§Errors
A length no tie of written values reaches.