Using Perl as the RTcmix Command-Language Interface

Building RTcmix with Perl Support
The default RTcmix application (invoked by the CMIX command) uses the included scorefile language Minc. However, if you configure the build of RTcmix for Perl support using the --with-perl flag (see the installation guide for information about this), then compiling RTcmix will make a Perl-enabled command (PCMIX) that has a Perl parser as the 'front-end' instead of Minc.

Using Perl/RTcmix
To use Perl with RTcmix, write a Perl script with the following statement at the top:
Then use any Perl statements and any of the function calls you would use in an RTcmix Minc script. Run the script with the command PCMIX (instead of CMIX).

Now, whenever a PCMIX script uses a function name unknown to Perl, Perl will pass the function and its arguments to RTcmix. If it's unknown to RTcmix, then RTcmix will give its usual error message about it and continue processing the script.

This means that any RTcmix functions loaded into a script (with the load command) will work, even if these belong to an instrument not part of the distribution source tree. Some Minc functions have the same names as internal Perl functions. In general, Perl versions take precedence over RTcmix versions, with the following exceptions:

If your script uses these names, you'll get the RTcmix versions. If you want to use the Perl versions, you must use the CORE:: prefix, like this:
If you want to use the other RTcmix functions whose names collide with Perl ones, then you must use the RT:: prefix., like this:
The only such functions that you could possibly care about are print, splice and open. But who wouldn't want to use the Perl print instead of the RTcmix one?

Sample Scorefiles
A simple WAVETABLE Perl script:
Another WAVETABLE Perl script:
Perl script showing the RTcmix ability to chain several instruments together:
FInally, a Perl script invoking a number of simultaneous notes: