accept multiple -p=STRING for chord
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user