accept multiple -p=STRING for chord

This commit is contained in:
Bel LaPointe
2026-03-11 15:40:08 -06:00
parent bd0a6007f7
commit 05b49a3777
2 changed files with 6 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ pub struct Flags {
pub sound_font: String, pub sound_font: String,
#[arg(short, long, default_value = "c 2e+")] #[arg(short, long, default_value = "c 2e+")]
pub play: Option<String>, pub play: Vec<String>,
} }
impl Flags { impl Flags {

View File

@@ -7,15 +7,17 @@ mod tone;
fn main() { fn main() {
let flags = flags::Flags::new(); let flags = flags::Flags::new();
if flags.debug {
eprintln!("{:?}", flags);
}
let mut syn_seq = seq::new_syn(syn::Syn::new( let mut syn_seq = seq::new_syn(syn::Syn::new(
flags.debug, flags.debug,
flags.sound_font, flags.sound_font,
flags.sample_rate, flags.sample_rate,
)); ));
syn_seq.append(1, "3c1"); for i in 0..flags.play.len() {
if let Some(play) = flags.play { syn_seq.append(i as i32, flags.play[i].clone());
syn_seq.append(0, play);
} }
play(syn_seq, flags.sample_rate, flags.bpm); play(syn_seq, flags.sample_rate, flags.bpm);