Wednesday, August 16, 2017

Embedding play time in file

I was thinking the other day that it'd be cool to have a MIDI file program like "XPMIDI" (another fine Mellowood product) display the duration of a MIDI file before playing it. I didn't want to have to scan each file and do a test play to figure it out, and since MMA already does a running total which is fairly accurate it makes sense to add this information to the file when it's created.

The code was very simple: just a single line which adds a text field to the MIDI headers. At this point I'm adding "DURATION xxx" where "xxx" is the play time in seconds.

If there is a more standard way of doing this would someone please let me know! Without comments to the contrary, I'll leave it as it is. Now, I need to figure out what to do with xpmidi!


No comments:

Post a Comment

Truncate

I just found a minor bug in the TRUNCATE code. It didn't accept an integer argument for the Side= option. The underlying code all worked...