Skip to main content

discrete_binary_pad

Function discrete_binary_pad 

Source
pub fn discrete_binary_pad(
    series: &[IntegerType],
    fix_range: Option<&[IntegerType]>,
) -> Result<Vec<u8>>
Expand description

A set of integers as a run of ones and zeros over its range: music21’s discreteBinaryPad, so [3, 10, 12] is a one, six noughts, a one, a nought and a one.

The range is the smallest to the largest member unless fix_range gives another, in which case its own smallest and largest bound the run. An empty series with no range is an error, since it has no range of its own.