Skip to content
Sauraen edited this page Mar 1, 2021 · 3 revisions

Command-Line Interface API

Please check seq64_console --help for the latest version of this info.

Examples

./seq64_console --abi=zelda --in=path/to/song.com --out=path/to/song.mid --smartloop=false --mutebhv=0x60

./seq64_console abi=1 in=path/to/sfx.mus out=path/to/sfx.com

Argument format info

  • Arguments look like key=value or -key=value or --key=value.
  • int values can be specified as decimal or as hex with the "0x" prefix.
  • bool values can be specified as true/false, 1/0, on/off, yes/no.

Operation info

The operation performed (e.g. mid to com) is determined by the file extensions of the input and output files.

File extensions:

  • MIDI files: .mid, .midi, .rmi
  • Music Macro Language assembly: .mus, .mml, .asm, .s
  • Music Macro Language binary: .com, .aseq, .m64 (grudgingly), .bin, .dat

Return codes

  • 0: OK or warnings
  • 1: error in processing import or export
  • -1: setup issues: invalid arguments, files don't exist, etc.

Arguments

General

Key            Value (default) Operation
h, help, ?                     Displays a help message briefly explaining all these commands.
in, input      Rel path        Specifies input file.
out, output    Rel path        Specifies output file.
abi, game      String          Specifies ABI definition. An ABI XML file is
                               searched for that starts with or contains
                               this string. E.g. "1", "zelda". The ABI XML files
                               are searched for in `../abi/*`, `../../abi/*`, etc.
                               relative to the directory containing the seq64 executable.
dialect        String          Dialect for mus export. This is a string which must contain
                               "community", "canon", or "old", and also must contain 
                               "music" or "sfx". E.g. "community,music" or "sfxcanon".
                               This is ignored if the operation isn't mus export; in
                               particular, dialect is not used for mus import.

MIDI import options

Key            Value (default) Operation
pref           bool (true)     If songname.pref exists as a sibling file next to songname.mid,
                               reads and loads preferences from this file (see below).
smartloop      bool (true)     Add a jump command before the end of the sequence to jump to
                               the start of the second tsec (after the intro) if there are at
                               least two tsecs, otherwise to the beginning of the sequence.
reladdr        bool (false)    Use only commands with relative addresses in the sequence
                               structure. Mandatory for subsequences loaded with the loadseq
                               command (i.e. Hyrule Field).
mutebhv        int (0x20)      Mute Behavior bits (D3 20) as the first command of the seq hdr.
mutescale      int (0x32)      Mute Scale volume multiplier (D5 32) as the second command.
mastervol      int (0x58)      If > 0 and there is no master volume command in the MIDI,
                               add a master volume cmd with this value.

MIDI import optimizer options

Key            Value (default) Operation
usecalls       bool (true)     Use calls for optimization.
callonlylayer  bool (false)    Use calls only on note layers, not channels (for canon compatibility).
useloops       bool (true)     Use loops for optimization.
delta_vel      int (5)         Merge two note commands during optimization if their difference in
                               velocity is less than this value.
delta_gate     int (3)         Merge two note commands during optimization if their difference in
                               gate length is less than this value.
delta_cc       int (1)         Merge two CC commands during optimization if their difference in
                               value is less than this value.
q_volpan_amp   int (2)         Quantize monotonic volume curves by this value.
q_pitch_amp    int (1)         Quantize monotonic pitch curves by this value.
q_other_amp    int (1)         Quantize monotonic CC curves by this value.

MIDI export options

Key            Value (default) Operation
ppqnmultiplier int (4)         Output MIDI PPQN = this times 48
exportformat   str (original)  Can be "original", "gm_ch10", or "gm_multi". Whether and how to
                               convert program numbers to General MIDI. Only "original" is
                               currently supported in SEQ64 V2.0.

.pref file options

See TODO.