1
0
Fork
You've already forked tuner
0
Instrument tuner. Uses pitch-detection
  • Rust 94%
  • Perl 6%
Find a file
2026年04月14日 19:37:25 +12:00
src Initial commit 2026年04月14日 19:37:25 +12:00
supply-chain Initial commit 2026年04月14日 19:37:25 +12:00
Cargo.lock Initial commit 2026年04月14日 19:37:25 +12:00
Cargo.toml Initial commit 2026年04月14日 19:37:25 +12:00
filename.txt Initial commit 2026年04月14日 19:37:25 +12:00
README.md Initial commit 2026年04月14日 19:37:25 +12:00
test_data.pl Initial commit 2026年04月14日 19:37:25 +12:00
tuner_parameter_data.txt Initial commit 2026年04月14日 19:37:25 +12:00

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 data
  • buffer_size The size of the ring buffer used to store Jack samples
  • max_vol_min: The minimum value of the maximum volume in the sample for there to be an attempt to gage the frequency
  • mean_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;
			}
		};