AJ | Pact | logo
PACT
Prism Fission

Prism Fission

9 September 2017

CreativePact (32 posts)

In this CreativePact, following a couple of months in the creative doldrums, I will be working to complete Prism Exhilarated, a unique media music release by ‑otron.

Prism in Python - pydub

14/09/17
AJ Pact | Prism Fission | Prism in Python - pydub

In a previous post I opened the box slightly on my plans for the audio side of Prism Exhilarated's Python script. Let me crack it just lightly more.

I will be using the pydub module, which specialises in combining audio files. This is exactly what is needed for Prism Exhilarated, which is essentially a matrix of audio files merged together.

Like other Python modules, installation is a breeze through pip. Using AudioSegment objects one can apply various processes to audio files, then play back the results or export them to disk. It's this latter functionality I have my eye on for the future; for now though, just playing back my files is fine.

So today I started the process of integrating pydub into my Python project. The way it will work is thus: the script will assemble the album or track based on the CLI arguments provided, then play it out. If the album is requested, the tracks will be assembled first, and then those results will be compiled into the finished record.

(Note to self: as this is going onto cassette, I'll have to build in a side A/B playback feature.)

Audio fades and other processing can be performed by pydub, so having tracks mixing together on the album is also an option, though I don't think I'll make use of that this time.