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 - constructing an album

20/09/17
AJ Pact | Prism Fission | Prism in Python - constructing an album

Remember that dreaded TLOD (Thin Line of Death) haunting me at the end of my previous Python session? It plagues me no more. As you can see, I now have an export file with beautiful audio in it.

The answer came to me in the shower, where I reasoned that what was likely happening was the AudioSegment exported was the unaltered blank file used as the basis of the track; basically, the overlay() function wasn't sticking. What could cause this? Wait a minute... Does overlay() return its results rather than work in place?

Yeap. overlay() is a returning function and I wasn't assigning the return to anything. A quick update to the code and everything was rosy.

Building on that in this session, I sorted the album construction function too, and confirmed that not only was it appending all the tracks together into one file, it was also respecting the optional duration property set (or not) on each track.

With that done I looked at applying a pre-roll value to the backing tracks, to allow for unique processes that start before the backing does (Prism Exhilarated's first track, 'Hxxr', does just that). While such a process may seem simple in principle, in practice it creates certain headaches, so I decided to ditch that idea and leave a period of silence at the beginning of such files.

As part of that process I had reorganised the config file slightly, with 'backing_file' becoming 'backing', containing a list of properties. I decided to leave that change in place for any future updates.