bash script to remove silent PCM files

When you have a lot of input channels coming into your DAW, arming channels individually for recording can be a real pain. It’s much easier to just arm them all and remove any wave files for channels that didn’t record anything useful. Well, it is if you have some automated way to go through and remove them.

I’ve made a simple bash script to deal with this. It depends on sox. Its options are:

  • -d debug mode: actions are listed but not carried out
  • -v verbose mode: actions are carried out and listed
  • -l list mode: files that will be deleted are listed, surrounded by single quotes. This allows the list to sent to xargs for example, to open in an audio editor to double check if there’s anything worth keeping.
  • -t THRESHOLD set the threshold below which a PCM file is considered silent
  • INPUT list of files to check for silence

The script also removes any zero-length files.

I would try it a few times with the -d switch to see what would be deleted. The default threshold of 0.0001 will most likely let through some files with just background noise on them, so you might want to increase it. I often use 0.0005 which almost certainly wouldn’t delete anything useful.

Using the -d switch also shows the size of the file that would be deleted.

You can run it with the -l switch and xargs to find out how much space you’re saving:

$ silentpcmrm -l *aif | xargs du -hcs
93M    Anode POST 0001 [2020-04-26 122446].aif
96M    Anode PRE 0004 [2020-04-26 122446].aif
96M    Clap POST 0001 [2020-04-26 122446].aif
96M    Clap PRE 0004 [2020-04-26 122446].aif
192M    D-20 POST 0001 [2020-04-26 122446].aif
190M    D-20 PRE 0005 [2020-04-26 122446].aif
96M    DK-80 POST 0001 [2020-04-26 122446].aif
96M    DK-80 PRE 0003 [2020-04-26 122446].aif
96M    Microbrute POST 0001 [2020-04-26 122446].aif
96M    Microbrute PRE 0004 [2020-04-26 122446].aif
96M    Minilogue POST 0001 [2020-04-26 122446].aif
192M    Patchblock POST 0001 [2020-04-26 122446].aif
96M    Snare POST 0001 [2020-04-26 122446].aif
96M    Snare PRE 0004 [2020-04-26 122446].aif
96M    Volca Bass POST 0001 [2020-04-26 122446].aif
93M    Volca FM POST 0001 [2020-04-26 122446].aif
96M    Volca FM PRE 0003 [2020-04-26 122446].aif
185M    Zoom B3n PRE 0001 [2020-04-26 122446].aif
2.0G    total

I use this for my setup which is 48 channels coming into Ableton Live, so selecting 10 or 12 channels to arm is super fiddly, especially when you don’t have the computer as a central part of the workflow – it’s more like a 48-track tape machine in the corner. It’s very easy to accidentally not arm one of the tracks you later need – I record each instrument both PRE and POST so that I have all the effects and live fader/muting messing. If for some reason you come back to mix the track and find that there was too much delay (what?!) or you muted the channel too early, the PRE version lets you fix it. Or you can use the POST channels as a guide to how you later use the PRE channels to mix from the untouched source.

The script is provided as-is, and how you use it is up to you, and at your own risk. Back up files before running anything that can and will delete them!

Update: file has moved to GitHub repo

AES50 stagebox for lines

Is it just me or would it be really useful (and cheaper) to have an AES50 stagebox dedicated to line inputs? When you keep collecting synths – which just continues to get easier and easier – you end up with an input requirement that’s hard to fulfil. Stageboxes like the SD16 are cool, but do I really need more mic preamps? Can you imagine how many more inputs you could fit on a box if it was all quarter inch?

Viber keyboard [grrr]

ಠ_ಠ why doesn’t Viber on macOS follow the OS rules on keyboard navigation? If you do an Alt-Right jump, it goes to the start of the following word, not the end of the current. It’s a small thing, but don’t mess with my muscle memory, dudes!

node / npm version mismatch

I recently kept running into issues with Node.js > 9 (Node.js 9.3.0 to be precise) and it not liking the latest version of npm (5.4, 5.5)

It turns out the simplest approach isn’t to downgrade Node.js or any of that stuff. With Node.js 9 there’s a patched version of npm. All I had to do was move the symlink npm that’s in /usr/local/bin and relink to /usr/bin/npm.

This is Debian Jessie; ymmv.

New-old music workflow

Here’s an idea to inject a bit of what’s missing from the recent tracks that I made in the 80s and early 90s tracks…

Some of this is specific to Ableton Live but it doesn’t have to be.

First, start the track as usual, which in this case means use Push in more or less the “standard” way: get a bassline going, duplicate scene, add hi-hats, duplicate scene, add kick + snare, duplicate scene, add strings… and so on.

Then mess around with it finding good combinations of scenes and clips so it starts to sound like a song. Get an idea of how it should play out. Add “performance” effects here – stuff that’s not really targeted at mixing: delays, sweeps, whatever.

Start recording the session to arrangement mode, and run through the performance that’s been developing. Make it longer deliberately so sections can be cut out easily (if you like – maybe there’s no need?)

Possibly add some mixing type effects to the tracks in arrangement mode.

Record each MIDI track in the arrangement to an adjacent audio track, not necessarily with the effects in place.

Now it gets weird: record each stereo wave track to cassette around the 0dB mark, then immediately record it back in from cassette to another stereo wave track. If you have a 4-track, do two tracks at a time; with an 8-track, do four.

Once these newly “degraded” tracks are in you’ll probably have to do some lining up, but that’s another of the naturalistic effects we’re after. You might (will) end up with some micro-phasing artefacts which may or may not be interesting.

Now you can mix down with a combination of pristine stereo and cassette stereo tracks, even giving us the possibility of sliding from one to the other. How about making a track fade continuously from cassette to pristine as the track goes (or the reverse?) How about widening the stereo of the cassette track and narrowing the stereo of the digital? And so on and so forth…