audio-clock 0.2.0

Propagate a musical clock from a real-time audio callback to other threads
Documentation
  • Coverage
  • 0%
    0 out of 8 items documented0 out of 7 items with examples
  • Size
  • Source code size: 5.91 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.51 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • padenot/audio-clock
    1 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • padenot

audio-clock

Propagate a musical clock from a real-time audio thread to other threads:

let tempo = 132.2;
let sample_rate = 44100;
let (mut updater, consumer) = audio_clock(tempo, sample_rate);

// ... somehow send updater to the real-time audio thread.

// From an audio callback, increment the clock,
// from the real-time audio thread
updater.increment(frame_count);


// Somewhere else, use the clock:
println!("frame processed: ", consumer.raw_frames(), 128);
println!("beat count: ", consumer.beat());
println!("beat duration in seconds: ", consumer.beat_duration());

let other_consumer = consumer.clone();
// Send other_consumer to some other thread.

Licence