I quickly threw together a shell script to handle the renumbering of a wavetable SysEx file with some minimal error checking, using
xxd(1) as in my
previous note. Still,
use at your own risk. Instead of just copying it in a code block here, I put a copy on github. It may move, at some point. But, here's
pro3-wavetable-renumber.sh. The only commands it uses are
bash(1),
xxd(1), and
cp(1). Since git doesn't preserve file bits, you may need to make the shell script executable, first.
It can be called as:
[note: the :; at the beginning of the line is simply the shell command-line prompt.]:; ./pro3-wavetable-renumber.sh 64 oldfilename newfilename.syx
to make
newfilename.syx a copy of
oldfilename.syx with just the wavetable slot number changed to 64. The script will do the following:
- Make sure the wavetable-number argument is a number from 33 to 64.
- Test that newfilename.syx does not exist. It'll try not to overwrite a file. But, as always, make backups.
- Verify that oldfilename.syx is a Pro 3 wavetable SysEx file.
- Right now, the script is making an assumption that could be incorrect, as I'm not yet certain of some of the values in the header portion; they've been the same, so far. If the script starts failing, I can make that test less strict.
- It also checks the size and final byte.
- If the wavetable-number argument is the same as in oldfilename.syx, the script will exit and newfilename.syx will not be created.
No guarantees that the script won't cause problems. It's possible I forgot to check something or made an error along the way. Use at your own risk. But, it might help some of you.
If one has a binary editor, as I mentioned in that earlier note, one can edit the value in the 8th byte (position 7 when starting from 0) to change the wavetable slot. If you do so, just remember that the slot number also starts from 0, so subtract one, e.g., use a value of 63 (0x3f) for slot 64. The script above will do that.
[ Got distracted with a Howard Jones concert and an online gathering with friends, otherwise I'd have posted earlier. ]