about summary refs log tree commit homepage
path: root/lib/dtas/splitfx.rb
DateCommit message (Collapse)
2024-02-01dtas-splitfx: add --stats/-S switch HEAD master
Similar to the switch in dtas-archive(1), I got tired of having to manually add stats to all the rips I was tracking out.
2022-07-16splitfx: warn on improper encodings for titles
Sometimes I get non-English song titles and copy+paste them from non-UTF8 texts.
2022-02-12splitfx: fix error reporting of failed tracks
Sometimes the command fails on certain tracks, and we need to use the proper track object for error reporting.
2022-02-03splitfx: disallow combining --trim and --filter
They're two different ways of accomplishing roughly the same thing, but --filter can be more flexible given the use of per-track environment variables.
2022-01-24splitfx: add --filter option to limit match to comments
This can allow filtering for tracks with a given comment declared via the ".#{COMMENT}" mechanism or the track title. If no prefix is given (before the '='), then all comment values are matched.
2022-01-24splitfx: support per-track environment variables
This allows setting the `FX' env on a per-track basis, since some recordings may have massive dynamic shifts which aren't desirable for casual listening or broadcast playback.
2022-01-11splitfx: fix track_zpad with integer arg
This is a rarely-needed corner-case, but I just needed to use this feature.
2021-05-25do not shell-quote filenames for environment
This allows dtas-player to play files with wonky filenames when piping ffmpeg (or avconv) to sox. SoX-only code dtas-player paths are not affected since they don't require an extra Bourne shell. All of our internal shell pipelines quote "$INFILE", anyways, so there was never any need to escape for those. This may cause compatibility problems for splitfx users, but splitfx is probably too esoteric to have any users besides myself. And I expect anybody editing audio with dtas-splitfx to pick shell-friendly filenames. dtas-player is far more general, and likely to encounter shell-unfriendly filenames which require quoting.
2020-04-20splitfx: support --err-suffix option
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".
2020-04-20splitfx: reduce syscalls for writing comments file
We can flush when all comments are buffered to avoid a writev(2) syscall on every comment.
2020-02-03doc: update copyrights for 2020
Using the 'update-copyright' script from gnulib[1]: git ls-files | UPDATE_COPYRIGHT_HOLDER='all contributors' \ UPDATE_COPYRIGHT_USE_INTERVALS=2 \ xargs /path/to/gnulib/build-aux/update-copyright [1] https://git.savannah.gnu.org/git/gnulib.git
2016-12-27http -> https, and relocate homepage to https://80x24.org/dtas/
HTTPS allows some level of security(*) and we've actually supported it on 80x24.org for many months, now. So, point new readers to it. Moving away from hostname-based homepages will allow us to save on subjectAltName space (and bandwith) when negotiating an HTTPS connection. We'll also have an .onion mirror for Tor users, soon, too; in case we can't afford to pay ICANN in the future. (assuming TLS libraries don't have any more Heartblead-level bugs in them, CAs aren't compromised, MITM HTTPS stripping proxies don't get in your way, and your certificate bundle isn't compromised).
2016-12-07splitfx: more consistently generate fade_in effects
No reason to generate the command in a different place than fade_out.
2016-01-02copyright updates for 2016
Using the 'update-copyright' script from gnulib[1]: git ls-files | UPDATE_COPYRIGHT_HOLDER='all contributors' \ UPDATE_COPYRIGHT_USE_INTERVALS=2 \ xargs /path/to/gnulib/build-aux/update-copyright [1] git://git.savannah.gnu.org/gnulib.git
2015-12-27splitfx: fixup frozen_string_literal for spawn
This only affected splitfx when it used the command option, and only when calling dtas-splitfx (not when playing splitfx files through the player).
2015-12-25enable "frozen_string_literal: true"
While we're in the area, make a wording change from "GPLv3 or later" to "GPL-3.0+", as the latter is favored by SPDX.org
2015-06-15splitfx: set OUTFMT correctly for subenv if command is set
Oops!
2015-05-24splitfx: allow -p/--sox-pipe option
This allows splitfx YAML files to operate more seamlessly with external commands such as play(1) especially when combined with the -t/--trim option.
2015-05-21splitfx: simplify output display
No point in executing echo and wasting CPU cycles. We'll only waste cycles now during dry-runs
2015-05-20splitfx: documentation for subclasses
2015-05-20splitfx: drop unnecessary variable
We no longer use it since commit 7b47191aa4c88b3daa4c980013f0047cb7ae7f6d ("splitfx: avoid double-truncation with user command")
2015-05-19source/splitfx: allow watching extra external scripts
Since writing nested shell commands inside YAML is subject to all sorts of strange quoting rules, encourage users to rely on external scripts which the YAML file refers to instead. These scripts can be written in any reasonable scripting language capable of executing other commands. This allows transparently monitoring things such as `my-script.rb' in the below example when playing my-splitfx.yml via dtas-player: --------------------- my-splitfx.yml ----------------------- infile: input.flac command: $INDIR/my-script.rb "$INFILE" ... --------------------- my-script.rb -------------------------- #!/usr/bin/ruby require 'shellwords' infile = ARGV.shift ch = %W(sox #{infile} -p).concat((ENV['TRIMFX'] || '').shellsplit) fx = %W(highpass 25 gain 9) l = ch.dup.concat(%W(remix 1v1)).concat(fx).concat(%w(contrast 30)) r = ch.dup.concat(%W(remix 2v1)).concat(fx).concat(%w(contrast 0)) cmd = %W(sox -M |#{l.shelljoin} |#{r.shelljoin}) cmd.concat((ENV['SOXFMT'] || '-p').shellsplit) cmd.concat(%w(- stats)) warn cmd.inspect exec *cmd
2015-05-19splitfx: avoid double-truncation with user command
It's probably harmless as the sub (second) command is usually innocuous as fars a modifying dynamic range, but it makes the command-line output confusing.
2015-05-18splitfx: remove support for encoding opus
Lossy file encoding has too many tunable variables and it is not a good fit for an audio production tool such as dtas-splitfx. This was becoming a maintenance burden for me and is a sign of featuritis.
2015-05-18splitfx: show correct command for output
Oops...
2015-05-17dtas-splitfx: support --trim argument
It can often be useful to expose only part of a track for quick inspection. This lets us do that.
2015-05-10splitfx: fix non-generic, user-specified targets
Regression appeared in the previous commit, oops. commit ab63c7bb1b69423f8c39a60dd00230c560eecfc4 (splitfx: fix lossy output with player command is in use)
2015-05-10splitfx: fix lossy output with player command is in use
We must ensure lossy encodings do not get lossily-encoded twice, only once at the final stage. There is no effect for lossless outputs as lossless is the common case for splitfx users.
2015-05-10splitfx: --bits and --rate for quick-n-dirty generic targets
generic targets (e.g. "wav") is useful for quickly checking if clipping is introduced by dither and resampling, so we'll support changing the sample rate and bits-per-sample from the command-line so users don't need to setup their own targets or wait on FLAC encoding.
2015-05-10splitfx: pass compression factor to sox(1)
This can be useful for speeding up splitfx during development, as sox defaults to maximum compression with FLAC and that is extremely slow.
2015-05-10splitfx: support -O/--outdir switch to control output dir
It is useful to force output to a writable directory if the YAML file is on a read-only mount point or to force the output to a large tmpfs mount point to avoid SSD/HDD wear.
2015-05-10splitfx: fix typo for dither application
We do not need to dither unless we output to 16-bit or less. This bug caused us to unnecessarily apply dither on 24-bit output files. Oops!
2015-04-13cleanup: avoid redundant Array conversion for escapes
We already convert xs arg to be an Array, so avoid bloating our code with redundancy.
2015-04-13escape INFILE and related environment variables
We may expand them, so ensure they're properly escaped, first for use in shell snippets.
2015-01-20doc: describe most classes a bit
Hopefully this makes the code less daunting to newcomers
2015-01-19update copyright years and links to mailing list archives
The documentation part is managed by the new Documentation/update-copyright script. For the future, the rest may be managed by the update-copyright tool in gnulib
2015-01-19avoid aliasing global "spawn" method
This makes debugging, grepping, and following code confusing at times and also unexpected breaks usage of the global "spawn" method.
2015-01-19splitfx: export TBEG and TLEN variables
These are the raw sample counts for the "trim" effect and may be useful for arithmetic in the shell.
2015-01-19splitfx: remove unnecessary assignment
We already assigned fmt before entering the case statement, so make the case statement smaller.
2015-01-03splitfx: remove redundant Hash#merge call
This was unnecessary since we already iterate through the overrides hash and merge "manually" based on command-line arguments (which allows us to represent nested hashes).
2015-01-03dtas-splitfx: use the top-level command used by -player
If somebody is using dtas-player to help edit a file for dtas-splitfx, it is likely they will want to use it when generating the final files (regardless of "target" format).
2015-01-03splitfx: add INDIR and INBASE environment variables
These are intended to act like `$(@D)' and `$(@F)' in GNU make(1) and to ease managing temporary files for some effects (e.g. noiseprof + noisered in sox) for splitfx users.
2014-12-28splitfx: use $FX env consistently in targets, too
While we're at it, document the splitfx manpage and make the example suitable for tests.
2014-12-27player: support playing splitfx YAML files
This allows splitfx users to test CUE breakpoints and run file-specific effects without interrupting their normal flow.
2014-06-06update copyrights and email address for 2014
I'm still normal, and still trolling, but 80x24.org will be epic :)
2013-12-01splitfx: support --no-dither/-D option
splitfx is incapable of knowing in 100% of cases whether dithering should be used (as it has no visibility into sox internals), so support disabling it completely via command-line. This is like the identical sox option, and passed to sox(1), too. This feature is useful for splitting already-mastered 16-bit recordings.
2013-10-10format: common detection code (based on sox)
This reduces duplication for sox-based components, which our audio editing components will rely on. We only use avconv/ffmpeg for odd formats which sox does not play natively, and editing audio in strange/lossy formats is undesirable anyways.
2013-10-02splitfx: default to default DTAS::Format if unspecified
Some users may not use nor care about $OUTFMT at all, so just start them out with a default one based on the original to get started.
2013-09-22splitfx: nodoc the Skip class
This is an internal class, and we don't have a public Ruby API anyways.
2013-09-22splitfx: rename "opus" target to "opusenc"
sox(1) may gain the ability to natively encode to Opus one day without using opusenc(1), so make it more explicit we are relying on opusenc(1).