On Mon, Oct 30, 2017 at 05:37:51PM -0400, Greg London wrote: > > Is there an audio format that lets you take a song and embed command data > to be executed as the song plays? > > And is there a perl module that could read/write such a file. > > I thinking of embedding some high level commands into music that would > then inform some perl code as to how to generate some constrained > randomized DMX data packets to some lighting. > > But I know nothing of audio formats, so I dont even know if its a thing. > And attempts to google fail miserably. >
Any extensible packetized format will have the option for you to write such a thing. So: RIFF is the base format for WAV, and you can add arbitrary chunks. http://soundfile.sapp.org/doc/WaveFormat/ http://search.cpan.org/~brianski/Audio-Wav/Wav.pm could be extended in such a way. But easier than that would be to use MP3 and the ID3v2 format to embed your data. http://search.cpan.org/~ilyaz/MP3-Tag/lib/MP3/Tag.pm reads such tags, but doesn't write them. Neither of these methods is going to be compatible with an off the shelf audio player, so you're going to have to write that. And neither of these methods offers perfect synchronization for the data vs audio. So my recommendation would be to skip the exciting process of developing an integrated format, and instead write a tool that fires off your DMX commands according to a simple editable time series list, while also playing the music via an external player with measured startup times. e.g. for Bach_Cantata.mp3, a file like this: [bach_cantata.mp3] 1200 bc_intro_seq.dmx 37005 bc_alldown.dmx 37500 bc_brightred.dmx I recommend elapsed time in milliseconds because it is the easiest time format for humans to deal with and nudge; I recommend putting the actual DMX data into separate files because you are very likely to want to reuse commands and sequences, not just within a work but across different works. Keeping them named will help your workflow. Good luck! -dsr- _______________________________________________ Boston-pm mailing list [email protected] http://mail.pm.org/mailman/listinfo/boston-pm

