NAME dtas-splitfx - split audio and apply effects to all tracks SYNOPSIS dtas-splitfx SPLITFX_FILE.yml [OPTIONS] [TARGETS] [ARGS...] DESCRIPTION dtas-splitfx reads as YAML file and can apply effects (including resampling/dither), split, tag, and encode files in parallel. dtas-splitfx is intended for splitting recordings from vinyl and live concerts into separate files. dtas-splitfx is inspired by cuesheets for CD audio and the make(1) build tool. dtas-splitfx primarily uses sox(1), but it is possible to define targets to use ecasound(1), too. OPTIONS -j, --jobs [JOBS] Number of jobs to run in parallel. If no number is specified, all jobs are run in parallel. Default: number of CPUS (dtas 0.20.0+), previous versions of dtas defaulted to 1. -n, --dry-run Print, but do not run the commands to be executed -s, --quiet, --silent Silent operation, commands are not printed as executed -D, --no-dither Disable automatic setting of the DITHERFX env. This also passes the option to sox(1) via SOX_OPTS. -E, --err-suffix SUFFIX Write the contents of "stderr". This is useful for capturing the per-track output of the sox(1) "stats" effect when combined with parallel "--jobs". -O, --outdir OUTDIR Set output directory instead of current directory. User-created targets must allow a placeholder for the (by default, an empty string) $OUTDIR environment variable in the output command. -C, --compression FACTOR Set the compression factor passed to sox(1). See soxformat(7) for more information on how it works across different formats. -r, --rate RATE Override the output sample rate in the specified TARGET -b, --bits BITS Override the output bit depth in the specified TARGET -t, --trim POSITION Passes a POSITION argument to the sox "trim" effect to allow limiting output to only process a portion of the original. This bypasses the "tracks" section and of the YAML file and outputs the result as a single file with the TRACKNUMBER of "000". For ease-of-typing, commas in this command-line argument are automatically expanded to spaces when passed to sox. This switch may not be combined with "--filter" -f, --filter [FIELD=]VALUE Only process tracks matching a given comment FIELD and VALUE. If no "=" is exists, then all comment fields are matched against the specified VALUE. This switch may not be combined with "--trim" -p, --sox-pipe Used in place of an output target to specify outputting audio data in the native "sox" format to another sox(1) or play(1) command. This moves printing of output to stderr and disables parallel job invocation. FILE FORMAT infile - string, the pathname of the original audio file env - hash of environment variables to set for all commands env: FX: gain 3 stats comments - hash of common tags for all audio (e.g. ARTIST, ALBUM, YEAR) comments: ARTIST: John Smith ALBUM: Hello World YEAR: 2013 track_start - integer, number to start the track count at default: 1 cdda_align - boolean, enforce sector alignment for audio CDs default: false track_zpad - boolean or integer Zero-pad the TRACKNUMBER in metadata and filenames. If an integer, this creates a fixed padding even if the padding is not necessary. If true, this only pads as needed for the highest-numbered track. Default: true tracks - array, see "TRACKS" section targets - hash, see "TARGETS" section command - override the default sox invocation This command may be used to specify an alternate command to process each track. Default: sox "$INFILE" $COMMENTS $OUTFMT $OUTDST $TRIMFX $FX $RATEFX $DITHERFX TRACKS Tracks may be defined by a start time, with the stop time defined automatically by the start of the next track, stop time, or a skip segment. t TIME TITLE [fade_in/fade_out=FADE_ARGS] [.FIELD=VALUE] [env.X=Y] The start of a new track at TIME with TITLE. An optional "fade_in" and "fade_out" may be specified for any tracks. Per-track comments may be specified in the form of ".FIELD=VALUE". Using per-track ".ARTIST=FOO" allows proper tagging of multi-artist compilations. Per-track environment variables may be specified in the form of "env.K=V" where "K" is the environment variable name and "V" is its value. Per-track environment variables do not affect playback of YAML files via dtas-player(1) nor use of the "--trim" command-line option. However, per-track environment variables do affect any tracks written to the filesystem, including those using the "--filter" switch. These environment variables are intended to affect the specified "command" or default sox(1) invocation. skip TIME - skip a segment starting at TIME "skip" segments are useful for skipping long gaps between tracks (such as flipping vinyl or intermission at concerts) stop TIME - stop the last track This should be the last directive in the "tracks" array. An example of the tracks array for a 4 track EP follows: tracks: - t 0:21 "This is the first track of an EP" fade_in='t 1' - t 7:11.6 "Second track of side A of an EP" - skip 9:18 # this is where I flip the record, comments are allowed - t 9:41 "3rd track of an EP" - t 13:36.5 "Final track of the EP" fade_out='t 1' - stop 18:11 FADES dtas-splitfx automatically sets up fade-in/fade-out effects for sox(1) based on track times. These are to be used in "t" (track) directives in the "tracks" array: fade_in="[TYPE] LENGTH" fade_out="[TYPE] LENGTH" TYPE is optional, but LENGTH is required. See sox(1) for a description of the fade type. ENVIRONMENT dtas-splitfx sets several default environment variables for commands to use in targets: INFILE - this matches the "infile" directive in the YAML file INDIR - the directory INFILE belongs to, without trailing slash INBASE - the basename of INFILE TBEG - the integer sample offset where the sox(1) trim effect starts TLEN - the integer sample count representing the length of the trim TRIMFX - essential Supplies the necessary sox(1) trim effect to each track. In other words, this is: "trim ${TBEG}s ${TLEN}s" COMMENTS - expands to --comment-file=PATH for sox(1) OUTDIR - placeholder for --outdir, defaults to an empty string SUFFIX - the suffix of the output format without "." (e.g. "flac", "ogg") TRACKNUMBER - the track number, useful for comments and filenames RATEFX - rate effect and arguments for sox(1) resampling DITHERFX - dither effect and arguments for sox(1) dithering FX - any user-specified sox effects which encompases the entire file. (e.g. "highpass 35 gain 3 stats") TARGETS The default targets will split audio and avoid applying any effects. They are named after common audio formats supported by sox(1): flac ogg mp3 sox If not specified, "flac" is the default target. Additional targets supported by default. flac-cdda This encodes the audio to "flac" format while being easily decompressible to a format suitable for being burned to audio CD. Custom targets may easily be defined to apply effects and gain. For example, the following "flac24" target raises the volume of the left channel by 9.5dB and the right one by 8.5dB to compensate for channel imbalance in a live concert recording from the audience: targets: flac24: command: sox -M "|sox $INFILE -c1 -p $TRIMFX remix 1v1 gain 9.5" "|sox $INFILE -c1 -p $TRIMFX remix 2v1 gain 8.5" $COMMENTS $OUTFMT ${OUTDIR}bandYYYY-MM-DD.FOO.t0"$TRACKNUMBER.$SUFFIX" $RATEFX $DITHERFX stats format: type: flac bits: 24 rate: 48000 COPYRIGHT Copyright all contributors License: GPL-3.0+ SEE ALSO sox(1), ecasound(1), flac(1), dtas-player(1)