Scorefile Commands and Functions
RTcmix scorefile commands are used to set up and control the execution
of RTcmix. They also include a number of utility commands for
algorithmic music-creation work using the default Minc
scorefile parser. RTcmix commands generally return values that are Minc type
float, but others return strings or
lists. Descriptions below ending in “(legacy)” indicate older, replaced
commands with newer equivalents described along with the command.
Although these commands are designed to be used within an RTcmix
scorefile, they can also be used as part of an embedded application,
working in conjunction with the RTcmix
object.
Listed by Topic
General
- Minc — overview of the default Minc scorefile parsing language
- len — return the length of the argument
- index — return the index of an item in a list
- print — print values
- makeinstrument - create an instrument handle for CHAIN
- printf — print formatted values
- stringcontains — return true if a string contains a specified substring
- stringify — return a pointer to a string argument (legacy)
- stringtofloat — convert the numerical portion of a string into a float
- type — return the Minc data-type of its argument
- rtoffset — run the score in “fast forward” to a time and then begin playback
- tempo — create a tempo map for a score
System Functions (Affect the overall behavior of RTcmix)
- rtsetparams — set basic audio parameters
(sampling rate, number of channels, etc.)
- load — load an instrument into RTcmix for use
- rtinput — open a soundfile or input device for
reading
- rtoutput — open a soundfile for writing
- set_option — turn on and off various RTcmix
options
- bus_config — configure and connect the inputs
and outputs of RTcmix instruments
- reset — set the control function/envelope update rate
- control_rate — set the control function/envelope
update rate
- include — embed one scorefile within another
- error — generate an RTcmix error
- exit — terminate RTcmix
- f_arg — return a floating-point argument to the CMIX (legacy)
command
- i_arg — return an integer argument to the CMIX (legacy)
command
- n_arg — return the number of arguments to the CMIX (legacy)
command
- s_arg — return a string argument to the CMIX command (legacy)
- print_off — stop printing of RTcmix stats to the
screen
- print_on — allow printing of RTcmix stats to the
screen
- system — execute Terminal or Shell commands from
within RTcmix
- CHANS — return # of channels of current input soundfile
- DUR — return duration of current input soundfile
- LEFT_PEAK — return peak amplitude for left channel of
current input soundfile
- PEAK — report peak amplitude for current input soundfile
- RIGHT_PEAK — return peak amplitude for right channel
of current input soundfile
- SR — return sampling rate of current input soundfile
- filechans — return # of channels of a named
soundfile
- filedc — return the averaged DC level of a named soundfile
- filedur — return duration of a named soundfile
- filepeak — return peak amplitude of a named
soundfile
- filerms — return RMS amplitude of a named
soundfile
- filesr — return sampling rate of a named soundfile
- LPC Datafile Functions
- lpcgetamps — retrieve amplitude values from a named LPC analysis file
- lpcgetpitches — retrieve pitch values from a named LPC analysis file
- PVOC Datafile Functions
- pvinput — open the specified PVOC file and make it the current data file
- pvgetbin — retrieve the complete amplitude and frequency bin values for a given frame in the current PVOC data file
- pvgetbincount — return the number of frequency/amp pairs per bin in the current PVOC data file
- pvgetframerate — return the frame rate for the current PVOC data file
- pvgetframeamps — retrieve the amplitude bin values for a given frame in the current PVOC data file
- pvgetframefreqs — retrieve the frequency bin values for a given frame in the current PVOC data file
Math/Data/Numerical Conversion
- abs — absolute value of argument
- ampdb — convert decibels to amplitude
- dbamp — convert amplitude to decibels
- boost — return amplitude multiplier for stereo
compensation
- ln — return the natural log of the argument
- log — return the log10 of the argument
- pow — raise (exponentiate) one argument by the other
- sqrt — return the square root of the argument
- max — return maximum value of params
- min — return minimum value of params
- mod — return result of modulus operation
- round — return nearest integer to the argument
- trunc — truncate a value to integer portion
- wrap — modulus-like command
- fwrap — return the wrapped float value within a float range
- translen — calculate duration from a transposition
interval (oct.pc)
Pitch-Specification Conversion
- cpslet — convert from text-string note letter
representation to frequency (Hz)
- cpsmidi — convert from MIDI note # to frequency
(Hz)
- cpsoct — convert from linear octaves to Hz
specification
- cpspch — convert from oct.pc to Hz specification
- midipch — convert oct.pc to MIDI note #
- octcps — convert from Hz specification to linear
octaves
- octlet — convert from text-string note letter
representation to linear octaves
- octmidi — convert from MIDI note # to linear
octaves
- octpch — convert from oct.pc to linear octaves
- pchcps — convert from Hz to oct.pc specification
- pchlet — convert from text-string note letter
representation to oct.pc specification
- pchmidi — convert from MIDI note # to oct.pc
- pchoct — convert from linear octaves to oct.pc
Random-Number Commands
- irand — return a random number within a specified
range
- pickrand — return a random choice from a specified
set of numbers
- pickwrand — return a weighted random choice from
a specified set of numbers
- rand — return a random number between -1.0 and 1.0
- random — return a random number between -0.0 and 1.0
- srand — set the initial seed value for the RTcmix
psuedo-random number generator
- trand — return a random integer within a specified
range
- chance — return true or false based on fractional odds
- spray_init — initialize a random number “spray
can”
- get_spray — retrieve a value from a “spray
table”
Envelope/Control (Function tables, Interface connections, PField variables)
- makeconnection — create PField connection to
an interface or device:
- mouse — connect to the mouse position
- midi — connect to MIDI controller
- datafile — open and read data from an existing file
- inlet — connect to a Max or Pd rtcmix~ object inlet
- maketable — create a table using the table-handle
scheme:
- textfile — fill a table with values from a text file
- soundfile — fill a table with samples taken from a sound file
- literal — fill a table with specified values
- datafile — fill a table with values from a binary data file
- curve — fill a table using line segments with adjustable curvature
- expbrk — fill a table using exponential line segments
- line — fill a table using straight line segments
- linebrk — fill a table using a linear break-point function (value/#-of-points/value)
- spline — fill a table using a spline curve
- wave3 — fill a table with 1 cycle of a waveform specified using partial-#/amplitude/phase
- wave — fill a table with 1 cycle of a waveform using harmonic amplitudes
- cheby — fill a table using a Chebyshev polynomial
- random — fill a table using random numbers
- window — fill a table with a Hanning or Hamming window function
- modtable — modify a table given a table-handle:
- concat — concatenate two tables
- draw — insert new values into a table at run-time
- normalize — scale table to fit within a peak value
- reverse — reverse the order of values within a table
- shift — shift the order of values within a table
- add — add to a table-handle table given constant or
another table-handle table
- copytable — copy and optionally resize a table
from a table-handle
- div — divide the values in a table-handle table by a
constant or another table-handle table
- dumptable — print the contents of a table given a
table-handle
- makeLFO — set up a low-frequency oscillator for
PField control use
- makeconverter — use a conversion program to
change PField data format
- makefilter — establish a filter to transform PField variable data:
- clip — limit data to a specified range
- constrain — use pfield data values to select within a table-handle table
- delay — delay data values by a specified amount
- fitrange — expand data to a specified range
- invert — invert (mirror) data around an axis of symmetry
- map — modify data through a transfer-function table
- quantize — round data to nearest integer multiples of a quantum value
- smooth — apply a simple averaging filter to an incoming data stream
- makemonitor — display or record PField control
data
- makerandom — set up a periodic random-number
generator for PField control use
- Table Utilities
- tablelen — return the size of a table from a
table-handle
- tablemax — return the maximum value stored in a table from a table-handle
- tablemean — return the mean (average) of all values stored in a table from a table-handle
- tablemin — return the minimum value stored in a table from a table-handle
- plottable — plot the contents of a table given a
table-handle
- samptable — return a value (specific or
interpolated) from a table given a table-handle
- mul — multiply a table given a table-handle by a
constant or another table-handle table
- sub — subtract values from a table-handle table given a
constant or another table-handle table
There are a few older, disk-based cmix commands that are not documented here (commands like open, input, output, etc.). They have all been superceded by RTcmix commands, and it isn’t guaranteed that they work very well. See the source code if you are Seriously Interested.
Listed in Alphabetical Order