time_calc 0.9.1

A library for music/DSP time conversions! Provides functions and methods for converting between ticks, ms, samples, bars, beats and measures.
docs.rs failed to build time_calc-0.9.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: time_calc-0.13.0

time_calc

A library for music/DSP time conversions!

time_calc provides functions and methods for converting between ticks, ms, samples, bars, beats and measures.

It looks like this:

const SAMPLE_HZ: SampleHz = 44_100.0;
let bpm: Bpm = 120.0;
let time_sig = TimeSig { top: 4, bottom: 4 };
println!("Convert 4 bars to samples where the tempo is 120bpm, the time signature is 4/4
         and the sample rate is 44,100 samples per second: {}",
         Bars(4).samples(bpm, time_sig, SAMPLE_HZ))

Usage

Add time_calc to your cargo dependencies like this:

[dependencies.time_calc]
git = "https://github.com/RustAudio/time_calc.git"

See the example for a better demo.