mw(1)

NAME
mw - audio sample editor

SYNOPSIS
mw [-e COMMAND] [-f COMMAND-FILE] [SOUND-FILE ...]

DESCRIPTION
mw is an interactive, text-mode audio sample editor. Audio files provided as arguments on the command line can be inspected, edited, mixed and exported. mw can be thought of as a kind of ed(1), except for editing audio sample vectors instead of text files, and with functions tailored to the specifc case of editing sample vectors.

OPTIONS

-e COMMAND, --exec=COMMAND
    Execute COMMAND after loading the sound file arguments onto the stack. Can be used multiple times to run multiple commands.

-f COMMAND-FILE, --file=COMMAND-FILE
    Execute commands from COMMAND-FILE, one line per command.

-h, --help
    Print brief help.

DETAILED DESCRIPTION

  MOTIVATION
mw is an audio sample editor, designed to edit individual, contiguous sounds in a manner similar to BIAS Peak, Audacity or iZotope RX. mw runs fully in text mode on a terminal, and allows viewing and manipulating audio data without recourse to a GUI; this can be useful to users who can't access a GUI in their environment for whatever reason, or as part of a broader text-mode workflow.

  THEORY OF OPERATION
mw accepts filenames as arguments from the command line and pushes these sounds onto an internal stack. Editing functions (such as crop or fadein) target the sound at the top of the stack, while commands that combine sounds or create new sounds as a side-effect (like bounce or split) will either consume sounds from the stack or push new sounds onto the stack.

The stack can be used as a scratch pad to save intermediate versions of a sound being edited, as a storage space for a collection of sounds, or any other purpose, and can be manipulated with dedicated commands such as dup, pop, swap, roll, etc.

Each individual sound on the stack is contained in a frame which also maintains editing context pertinent to the sound, such as the location of the cursor and selection in- and out-points.

COMMANDS AND ACTIONS
The command prompt in mw accepts lines of commands of a form similar to sed.

    [start][,end][[action] arguments]

        The start and end are used to set the beginning and ending times for an action to act upon. When a start or end are read from the command line, they set the in and out edit points on the active sound, which will then be used by a following action. Some actions take additional arguments which follow the action, separated by spaces. Double-quotes can be used for arguments that contain spaces. When start is omitted from a command, the sound in-point is used, and if it is not set, the beginning of the sound is used. When end is omitted from a command, the sound out-point is used, and if it is not set, the end of the sound is used.

        Commands can be followed by a "#" symbol and free comments, this may be useful for people writing scripts.

  EXAMPLES

0,100bloop
    Bloop the first 100 milliseconds of the sound.

100,-100 crop
    Crop the first and last 100 milliseconds off the sound.

0,-1
    Set the selection in- and out- points to the beginning and end of the sound.

,2500
    Set the selection out-point to 2500 miliseconds, do not change the in-point.

mw's command prompt supports GNU readline(3) for line editing and auto-completion; all of the commands listed here will autocomplete with the <Tab> key.

  ACTION LIST

help
    Prints a list of all command keywords mw recognizes, along with a brief description. Keywords that accept arguments are followed by their arguments in [brackets].

show
    Prints a text graphic of the sound presently at the top of the editor stack. This include a waveform bargraph of the sound's amplitiude with respect to time, as well as a text representation of the current cursor, in- and out-points.

stack
    Prints a text graphic of every sound in the editor stack, from top to bottom, and prints out the length of the current editing session, being the length of the longest sound in the stack.

ci  Clears the selection in-point.

co  Clears the selection out-point.

setw [width]
    Sets the current display width: the number of columns mw will use when showing a wavform. If no argument is given, defaults to 80.

dup Duplicates the sound at the top of the stack and pushes the duplicate onto the top.

swap
    Swaps the top two sounds on the stack.

pop Pops the sound at the top of the stack, deleting it.

roll [count]
    Rolls the stack forward, the top sound is placed at the end and the second sound becomes the top sound. The count may be either positive or negative and defaults to "1".

crop
    Crops the sound. Samples prior to the selection in-point and after the selection out-point are deleted. If either of these is not specified, the beginning and end of the sound are the default.

silence
    Inserts silence of length dur milliseconds at the in-point to the out-point, shifting the audio between back.

split
    Splits the sound at the in-point. The current sound is popped off the stack. Two new sounds are pushed onto the stack, the first made of the samples preceding the cursor and the second of samples following the cursor.

append
    Appends the 2nd-highest sound on the stack to the end of the top sound on the stack.

prepend
    Prepends the 2nd-highest sound on the stack to the end of the top sound on the stack. (Reverses a split).

loop [count]
    Loops the selection count times.

normalize [db]
    Normalizes the sound between the in and out points to db decibels. The default is 0.0.

fadein
    Applies a linear fade to the sound, increasing from the beginning of the sound to the in-point.

fadeout
    Applies a linear fade to the sound, decreasing from the out-point to the end of the sound.

play
    Plays the sound.

length
    Prints the length of the sound.

bounce
    Bounces or mixes the top two sounds on the stack together, creating a new sound that is placed on the top of the stack.

bloop
    Silences the samples between the insertion in-point and out-point.

export [name]
    Exports the sound as a wav file. If no name is provided, the default is out.wav.

EXIT STATUS

0   On user quit.

AUTHOR
Jamie Hardt <https://github.com/iluvcapra>

BUGS
mw is (optimistically) beta software and has numerous gaps in implementation and performance. Issue submissions, feature requests, pull requests and other contributions are welcome and should be directed at mw's home page on GitHub:
    https://github.com/iluvcapra/mw

SEE ALSO
ffmpeg(1), pydub<http://pydub.com>