From 85fd604b7fc2400809bd90c53fbbf85be49a7e4e Mon Sep 17 00:00:00 2001 From: breel Date: Tue, 10 Mar 2026 21:33:06 -0600 Subject: [PATCH] channel sample rate confirmed page size --- src/main.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0860fa6..7711ea3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,8 +16,8 @@ fn main() { // Setup the audio output. let params = OutputDeviceParameters { channels_count: 2, - sample_rate: 44100, - channel_sample_count: 4410, + sample_rate: flags.sample_rate, + channel_sample_count: flags.sample_rate / flags.smallest_note, }; // Create the synthesizer. @@ -55,8 +55,14 @@ fn main() { use clap::Parser; #[derive(Parser, Debug, Clone)] struct Flags { - #[arg(short, default_value_t = false)] + #[arg(short, long, default_value_t = false)] debug: bool, + + #[arg(long, default_value_t = 4)] + smallest_note: usize, + + #[arg(long, default_value_t = 44100)] + sample_rate: usize, }