That's quite some arguments, you can enter them following the path or change the defaults in the script if you use always the same (which i assume).
PATH/A,2ND/K,TEMPDIR/K,SUFFIX/K,OUTFIX/K,AUTH/K,TYP/K/N,Q/S
PATH is obviousely the path to the source file(s) and mandatory, enter source without suffix!
2ND is the label for the left channel file and expected to follow the filename but to precede the suffix, 2ND defaults to "-2"
TEMPDIR is the directory the temporary raw streams will be written to, default is SYS:Trashcan
SUFFIX defaults to .iff (note that the seperator is included)
OUTFIX optional suffix for the out-file, no default resp. out-file equals to source without suffix
AUTH optional AUTHOR field fill in whatever you like - no program ever reads this
TYP not mentioned to be used at all, this defaults to 0x01 for uncompressed
Q quiet, do not print status
NOTE: the maximum length for a single channel stream depends foremost on the amount of free RAM
PATH, IFF filetype is mandatory and also the sufix .iff for the source files, as i already stated i read the header and file length from the existing header, this presupposes that the header of the source files is correct.
Enter the path to the source files without the suffix!
You can specify a different suffix or make a different to the default with the keyword SUFFIX
2ND is the label for the left channel file and it defaults to "-2" but you can specify anything or set anything as default
TEMPDIR is the temporary directory the script will write the temporary raw streams to, make sure you have enough free space on your chosen drive (the amount of free RAM is rather a problem)
If you specify no OUTFIX the script writes the new file to the path without the suffix specified by SUFFIX, this i assumed as default behave probably change this to your needs.
Author the least important thing but i kept at least this it defaults to "YourSoft", the maximum string length for AUTH is 8 anything longer will be simply stripped.
The script writes the filename to the chunk NAME which has a fixed with of 16 characters and will be limited to 16 likewise AUTH to 8.
TYP i only specified for a single reason and it wouldn't have to be a default value. But the dummy header is use has no compression type specified this to keep the dummy header flexible for a different use. Also the chunk CHANNEL is left undefinied in the header but is set in the script this for the exact same reason.
SPECIALITY
The dummy header has a volume of 0xFFFF instead 0x00FF, this because i own at least one IFF player which expects 0xFFFF as maximum volume and will play in silence when the volume is only a word in length, i dunno what is the correct standard the player is else a very correct playing one and reports every tidbit from the IFF header, however 99% of players default to word length for the volume but won't be affected by a double word at this adress. To keep it compatible with
all to me known players i decided for the double word length.
The dummy header is expected to reside in S:
if you like it to be stored somewhere else you will need to change the call for it in script to this location
PATIENCE PLEASE
This script gonna needs a long time if it's a long stereo sample like a whole song, that is caused mostly by JOIN which needs very long to join the parts.
However if you have a set of files to convert it is still more comfortable as to use a program with a GUI.
A script to use BATCHREQUESTER to select a directory or to shift click on a directory to convert a whole directory of files will follow soon. I didn't included this in this script because it would have complicated all and to convert a couple of or a single file this script is handy enough.
OPTION
Use OS3.x and JOIN2STEREO
Load the file to a online converting program
DISADVANTAGE OF BOTH
Get under circumstances non working stereo IFF samples in return, the reason is in the length of the filename which will be written to the header, any method (else as my script) will write the name in correct string length to the header but won't limit the header length to a multiple of four (4) which will lead to wrong files if the filename is even in length or if it otherwise doesn't matches a total filesize which is divideable by four which happens quite often for both methods. To fix this the filename must match an odd number, all in all that is turd, personally i use a script for JOIN2STEREO which has as temporary outfilename simply IFF thus the header size will always match.
Using the above or a similar script and a dummy header of a given length bypasses this issue completely.
To use a dummy header isn't unusual, Audacity uses for IFF 8SVX as well a dummy header of given size (but can't export to stereo) where simply nothing is written to the chunk NAME.
The script and the used CLI proggies:
SUPEREXTRALUXURYVARIANT
get the string length of the filename and author, write the full strings to the header and make the header divedeable by four in length, write the proper string length for both chunks to the header.
But all that isn't needed to play them proper back.
SIDENOTE:
While i worked a lot with eval especailly for the simcity additions i noticed that the OS3.x EVAL leaks of a tid bit the OS1.3 eval offers. While the newer eval allows to calculate with multiple values and operators it leaks of a couple of lformat options such as to indent the output string to a given length (right align) which is very useful if you like to format the output (hence "list-format").