Skip to main content

Command

Enum Command 

Source
pub enum Command {
    Check {
        input: Input,
        json: bool,
    },
    Fmt {
        input: Input,
        write: bool,
        check: bool,
        width: Option<String>,
        normalize: bool,
    },
    Info {
        input: Input,
        json: bool,
    },
    Render {
        input: Input,
        output: String,
        rate: Option<String>,
        loops: Option<String>,
        eq: Option<String>,
        fade: Option<String>,
        lufs: Option<String>,
        stems: Option<String>,
        report: bool,
        json: bool,
        vgm_gzip: bool,
    },
    Build {
        input: Input,
        output: String,
        json: bool,
        max_size: Option<String>,
        inline: Option<String>,
    },
    Spec,
    Synths {
        json: bool,
    },
    Library {
        library: Option<String>,
        json: bool,
        tones: Vec<String>,
        check: Option<String>,
    },
    Dx7 {
        file: String,
        voice: Option<String>,
        list: bool,
        name: Option<String>,
    },
    Tone {
        category: String,
        file: Option<String>,
        synth: Option<String>,
        output: Option<String>,
        json: bool,
        alias: bool,
        reference: Option<String>,
        ref_from: Option<String>,
        ref_to: Option<String>,
        ref_release: Option<String>,
        ref_note: Option<String>,
    },
    Play {
        input: Input,
        track: Option<String>,
        from: Option<String>,
        looping: bool,
        loops: Option<String>,
        buffer: Option<String>,
        watch: bool,
        watch_interval: Option<String>,
    },
}
Expand description

pikopiko のサブコマンド。

Variants§

§

Check

Check the grammar and print diagnostics

Fields

§input: Input
§json: bool

Print JSON

§

Fmt

Tidy whitespace and wrap long lines (the song’s output never changes)

Fields

§input: Input
§write: bool

Overwrite the file instead of printing

§check: bool

Exit with 1 if the file needs formatting (prints nothing)

§width: Option<String>

Wrap track lines longer than this many characters (0 = never; default 100)

§normalize: bool

Rewrite the abbreviations mp / ep / en (and mpof / epof / enof) in the @ form (@vib, @detune, @arp)

§

Info

Print the track count, duration, note range and more

Fields

§input: Input
§json: bool

Print JSON

§

Render

Write a WAV file (16-bit stereo)

Fields

§input: Input
§output: String

Output file

§rate: Option<String>

Sample rate (8000 to 192000, default 44100)

§loops: Option<String>

Also write N passes back to the loop point (1 to 1000)

§eq: Option<String>

Output EQ applied before writing (famicom, small-speaker, subsonic, lowcut:150, peak:2500:-4, … joined with ,)

§fade: Option<String>

Fade out the last SECS seconds with a cosine curve (0.1 to 60)

§lufs: Option<String>

Gain the whole render to a target integrated loudness in LUFS (-40 to -5; peaks stay under -1 dBFS)

§stems: Option<String>

Also write one WAV per track into DIR (<name>_<track>.wav, through the same master processing)

§report: bool

Print per-section loudness, band and width numbers of the rendered song (sections start at @mark, or every 8 bars)

§json: bool

With –report, print JSON

§vgm_gzip: bool

Compress a .vgm output with gzip (a .vgz name does this by itself)

§

Build

Convert to the event binary and print the size breakdown

Fields

§input: Input
§output: String

Output file

§json: bool

Print JSON

§max_size: Option<String>

Size budget in bytes (16k = 16384)

§inline: Option<String>

Also print the binary as text: hex, base64 or rust (a pub static SONG: [u8; N])

§

Spec

Print the MML grammar specification (for generative AI)

§

Synths

List the synths with their tones, parameters and options

Fields

§json: bool

Print JSON

§

Library

List the tones of the built-in tone libraries (#include “@va/bass”)

Fields

§library: Option<String>

Only this library (@va, @va/bass)

§json: bool

Print JSON

§tones: Vec<String>

Folder of your own tone library (repeatable; also PIKOPIKO_TONES)

§check: Option<String>

Check your own tone library folder (names, errors, descriptions, targets, closeness)

§

Dx7

Convert a Yamaha DX7 patch (SysEx) to a va @15 tone (MML macro lines)

Fields

§file: String

DX7 file (a 32-voice bank .syx, a single-voice dump, or a packed voice; - for standard input is not supported)

§voice: Option<String>

Only this voice (1-based; a bank has 32)

§list: bool

Only list the voice names

§name: Option<String>

Macro name for the converted voice (needs –voice, or a single-voice file)

§

Tone

Play one timbre with the audition phrase of a category and measure it

Fields

§category: String

Category (lead, pluck, pad, chord, bell, keys, vocal, strings, guitar, bass, kick, snare, hat, crash, tom, fx)

§file: Option<String>

File with the timbre (@n %… or a macro line $name = …; - for standard input)

§synth: Option<String>

Synth to play it with (default va)

§output: Option<String>

Also write the audition as a WAV file (MP3 if the name ends in .mp3)

§json: bool

Print JSON

§alias: bool

Also measure aliasing (plays the audition again at 4 times the rate)

§reference: Option<String>

Reference sound (WAV) to compare with

§ref_from: Option<String>

Start of the reference to use (seconds from the head of the file)

§ref_to: Option<String>

End of the reference to use (seconds from the head of the file)

§ref_release: Option<String>

Where the note is released in the reference (seconds from the head of the file)

§ref_note: Option<String>

Fundamental of the reference as a note name (c5, f+4, …)

§

Play

Play it now

Fields

§input: Input
§track: Option<String>

Play only this track

§from: Option<String>

Start position (90, 1:30, 1:30.5, …)

§looping: bool

Loop forever (Ctrl-C to stop)

§loops: Option<String>

Loop N times (1 to 1000)

§buffer: Option<String>

Output buffer size in frames (16 to 16384)

§watch: bool

Reload when the file (or an included file) changes, keeping the position (Ctrl-C to stop)

§watch_interval: Option<String>

How often to check the files with –watch, in milliseconds (50 to 5000, default 250)

Trait Implementations§

Source§

impl Debug for Command

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Command

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Command

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more