rtoutput - open a new sound file for writing
rtoutput("file_name" [, "header_type" ] [, "data_format" ])
Parameters inside the [brackets] are optional.
Call rtoutput to open a new sound file for subsequent writing by real-time instruments.
After rtoutput creates a sound file, it prints information about the file, such as the header type and sampling rate (unless the print_off scorefile command has been issued).
AIFF is the default if no header type is given.
NOTE: The sampling rate and number of channels are specified in a call to rtsetparams at the beginning of the script.
"short'' is the default if no data format is given.
If you don't want RTcmix to play while you're writing a file, use set_option to turn off playing before you invoke any instruments, by saying set_option("audio = off").
The case of the header_type and data_format arguments is not significant, nor is their order.
All formats are big-endian, except for "wav,'' which is always little-endian, and "raw,'' which has host byte order.
If you ask for "aiff'' and "float'' (or "normfloat''), you'll get "aifc'' format instead, because AIFF doesn't support floating-point files.
Although most soundfile programs now deal with nearly all soundfile types, older advice in this documentation suggested that if you want to use floating-point files in the Snd editor, choose "normfloat'' format. If you want to use them in MiXViews editor, choose the "next'' header type. Many programs don't read AIFC files, maybe because they assume these are always compressed.
rtsetparams(22050, 2) rtoutput("mysound")writes a stereo, 16-bit linear AIFF file with 22050 sampling rate.
rtsetparams(44100, 1) set_option("audio = off", "clobber = on") rtoutput("myothersound", "wav", "float")writes a mono, 32-bit floating-point WAV file with 44100 sampling rate. RTcmix will write over any existing file with the same name, and will not play audio while writing.
bus_config, rtsetparams, rtoutput, set_option