makeconverter - read data from one pfield-handle or
table-handle and transform it to a different representation,
passing the altered data out through another pfield-handle.
pfield = makeconverter(input_handle, "converter_type")
makeconverter
returns a pfield-handle that will deliver data by applying an
RTcmix data-representation
format conversion routine
as specified by the "convertor_type" string argument.
This will be applied to data coming through
the input-handle variable. The input_handle variable
can be any of the PField-derived variables in RTcmix, such as a
table-handle (see
maketable)
or another pfield-handle (see
makeconnection,
makeLFO or
makerandom).
Many of the arguments for makeconverter may themselves
also be pfield-handles.
- input_handle
-
This is a pfield-handle variable referring to a data stream, possibly
from an external device or interface or an internal PField data-generating
process.
-
- converter_type
-
This string value (i.e. enclosed in "double quotes" in the scorefile)
determines which RTcmix data-format conversion routines
(listed below) will be used to transform the values
coming through the input_handle. The pfield-handle returned
from the makeconverter command will refer to this transformed
data stream.
The string argument for the converter to operate on the input_pfield
data stream can be any of the following:
- "ampdb" - convert amp in decibels to a real amplitude
- "cpsoct" - convert linear octaves to cycles per second
- "octcps" - convert cycles per second to linear octaves
- "octpch" - convert octave.pitch-class to linear octaves
- "cpspch" - convert octave.pitch-class to cycles per second
- "pchoct" - convert linear octaves to octave.pitch-class
- "pchcps" - convert cycles per second to octave.pitch-class
- "pchmidi" - convert MIDI note # to octave.pitch-class
- "octmidi" - convert MIDI note # to linear octaves
- "midipch" - convert octave.pitch-class to MIDI note #
- "boost" - converts an amplitude in decibels to an amplitude
multiplier. It simply returns 10 ** (db/20).
For more information on these conversion types, see the documentation
for the RTcmix
data format converters.
mpfield = makeconnection("midi", 1, 127, 60, 0,
1, "noteonpitch")
octpfield = makeconverter(mpfield, "pchmidi")
mpfield receives MIDI note # data from MIDI NoteOn events, and the
makeconverter command will change them into the octave.pitch-class
(see
pchcps
for a description of octave.pitch-class)
notation format used by many RTcmix Instruments. The octpfield
variable could then be used to control Instrument pitch dynamically.
maketable,
makefilter,
makeLFO,
makerandom,
makefilter,
makemonitor