Skip to main content

sound_to_patch/cli/
notes.rs

1//! The arguments of `notes`.
2
3use std::path::PathBuf;
4
5use clap::Args;
6
7use super::analyze::parse_bpm;
8use crate::notes::Profile;
9use crate::units::Bpm;
10
11/// Arguments of `notes`.
12#[derive(Debug, Args)]
13pub struct NotesArgs {
14    /// The audio stem: WAV, AIFF, FLAC, MP3, AAC or M4A.
15    pub stem: PathBuf,
16    /// The tempo of the stem in beats per minute, 4 to 1000. It is refined
17    /// from the stem, 2.91 % below to 3.09 % above it, unless --bpm-exact
18    /// is given
19    #[arg(long, value_name = "BPM", value_parser = parse_bpm, allow_negative_numbers = true)]
20    pub bpm: Bpm,
21    /// Use --bpm as it is, without refining it from the stem
22    #[arg(long)]
23    pub bpm_exact: bool,
24    /// Decode with the settings of this kind of stem instead of the
25    /// detected ones
26    #[arg(long, value_enum, value_name = "PROFILE")]
27    pub profile: Option<Profile>,
28    /// The output folder [default: a folder named after the stem, next to
29    /// it]
30    #[arg(short, long, value_name = "DIR")]
31    pub out: Option<PathBuf>,
32    /// Write next to a report that is not this stem's, replace a notes.mid of
33    /// another stem or with no track name, or replace the final notes and
34    /// remove the report that describes them
35    #[arg(long)]
36    pub force: bool,
37}