Skip to main content

slash_to_tuple

Function slash_to_tuple 

Source
pub fn slash_to_tuple(value: &str) -> Result<SlashMeter, SlashError>
Expand description

One meter read from text, with the word before it that says how its beat is felt: music21’s slashToTuple.

use music21::meter::tools::{MeterDivision, slash_to_tuple};

let read = slash_to_tuple("slow 6/8").unwrap();
assert_eq!((read.numerator, read.denominator), (6, 8));
assert_eq!(read.division, MeterDivision::Slow);

§Errors

SlashError::Meter where there is no n/d to read.