Audio::Cuefile::ParserPlus

On Friday & had a quite eventful day involving a bunch of lucky and happy coincidences, along with an amazing spurt of ultra-productivity!  Although it was an interesting day, that’s not what this post is about.

At one point, I was working on creating a CUE sheet for episode 004 and realized that GoldWave was clobbering all the PERFORMER attributes for every track in the original CUE sheet I imported!  That was definitely no good, and really irritated me at the time.

My current workflow for CUE-ing a mix is as follows:

  1. Export tracks from Traktor to a directory (ie: “~/Music/LyraPhase/004”), then make sure tracks are in order & named in the format: 01 – Artist – Trackname.mp3
  2. Make a tracklist text file:
    ~/Music/LyraPhase/004$ ls -l --color=never > LyraPhase_004.txt
  3. Run my magical script to generate a CUE file with empty INDEX points:
    ~/Music/LyraPhase/004$ tracklist2cue.pl LyraPhase_004.txt
    NOTE: all tracks have initial cutpoints of 00:00:00
    Opening tracklist file: LyraPhase_004.txt
    Writing cue file to: ./LyraPhase_004.cue
  4. Import the blank CUE file into GoldWave, listen, do audio processing stuff, then edit the track INDEX points.
  5. Save the wav & CUE files.
  6. Find out some extra stuff is gone after GoldWave got through with it 🙁

Enter perl:

So since I really like GoldWave otherwise, I decided to go dust off my monk robes & dive into perl again.  The initial goal was to be able to read in the 2 CUE sheets, copy INDEX points from one to the other, and then save it again.  I also have been thinking about other things in the future I may want to do with CUE sheets, so I decided to try to find some perl code to do what I wanted.

After a search, I found a module on CPAN called Audio::Cuefile::Parser which really didn’t do everything I wanted, or fully support the entire CUE file specification as per the documentation here.

After 1.5 days worth of hacking at it, I’ve successfully got 1/2 of the problem solved.  So far my Audio::Cuefile::ParserPlus module will happily read in CUE sheets and print out the track information for you.  The next step is to make a file output method, which should be simple now that the hard part of parsing in things via regex is finished ^_^

Current code snapshot can be found at my GitHub Repository
Happy Hacking  ^_^

– DJ Phasik