polyrhythm 0.1.1

Utilities for generating polyrhythms.
Documentation
  • Coverage
  • 0%
    0 out of 3 items documented0 out of 1 items with examples
  • Size
  • Source code size: 21.05 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.07 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Documentation
  • bring-shrubbery/polyrhythm
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • bring-shrubbery

Polyrhythm

Generate polyrhythms in Rust.

Usage

fn get_polyrhythm(beats: &Vec<usize>) -> Option<Vec<Vec<usize>>>

  • Input: Accepts a vector of number of beats for each track.
  • Output: Returns a vector of same-length vectors, that contain either 1 or 0 indicating beat or no beat respectively. The number of the nested vectors is determined by a least common multiple of the beats in each track.

Example usage:

let beats = vec![2, 3];
let result = get_polyrhythm(&beats);

// result:
// vec![
//   vec![1, 0, 0, 1, 0, 0],
//   vec![1, 0, 1, 0, 1, 0]
// ]

License

Mozilla Public License 2.0