Instrument tuner. Uses pitch-detection
|
|
||
|---|---|---|
| src | Initial commit | |
| supply-chain | Initial commit | |
| Cargo.lock | Initial commit | |
| Cargo.toml | Initial commit | |
| filename.txt | Initial commit | |
| README.md | Initial commit | |
| test_data.pl | Initial commit | |
| tuner_parameter_data.txt | Initial commit | |
Tuner
Part of the Qzn3t collection of musical utilities
Utilises the pitch-detector crate
Usage
The function get_results(&TunerArgs, mpsc::Sender<TunerData>) starts a jack client and an import port qzn3t_tuner:input.
The &TunerArgs parameter controls the paramneters of the pitch_detector
pubstruct TunerArgs{pubinterval: u64,pubbuffer_size: u64,pubmax_vol_min: f32,pubmean_min: f32,// The absolute mean volume must be smaller than this
}interval: The period in milli-seconds between sampling the Jack databuffer_sizeThe size of the ring buffer used to store Jack samplesmax_vol_min: The minimum value of the maximum volume in the sample for there to be an attempt to gage the frequencymean_min: This needs ot be deprecated
Then it sends a stream of TunerData objects down the supplied channel.
let (sender, receiver) = mpsc::channel::<TunerData>();
_ = get_results(args, sender);
loop {
let tuner_data = match receiver.recv() {
Ok(r) => r,
Err(err) => {
eprintln!("DBG tuner: get_results send error: {err}");
break;
}
};