accept multiple -p=STRING for chord
This commit is contained in:
@@ -15,7 +15,7 @@ pub struct Flags {
|
||||
pub sound_font: String,
|
||||
|
||||
#[arg(short, long, default_value = "c 2e+")]
|
||||
pub play: Option<String>,
|
||||
pub play: Vec<String>,
|
||||
}
|
||||
|
||||
impl Flags {
|
||||
|
||||
@@ -7,15 +7,17 @@ mod tone;
|
||||
|
||||
fn main() {
|
||||
let flags = flags::Flags::new();
|
||||
if flags.debug {
|
||||
eprintln!("{:?}", flags);
|
||||
}
|
||||
|
||||
let mut syn_seq = seq::new_syn(syn::Syn::new(
|
||||
flags.debug,
|
||||
flags.sound_font,
|
||||
flags.sample_rate,
|
||||
));
|
||||
syn_seq.append(1, "3c1");
|
||||
if let Some(play) = flags.play {
|
||||
syn_seq.append(0, play);
|
||||
for i in 0..flags.play.len() {
|
||||
syn_seq.append(i as i32, flags.play[i].clone());
|
||||
}
|
||||
|
||||
play(syn_seq, flags.sample_rate, flags.bpm);
|
||||
|
||||
Reference in New Issue
Block a user