You can control MSP using the message box object. Normally, the message box contains an object, and you click on it or replace a variable typed into the message box to send a message via a patch cord to another Max object. However, if the message in a message box begins with a semicolon (;) followed by the word , any message which follows will be sent directly to the Max application itself, just as though there were a receive object named "dsp".
Sending a message to the Max application
-
Add a message box to your Patcher, and type in a semicolon and the
word dsp ( ),
followed by the message you want to send. Your message box can
contain variables (e.g. ).
You don't ned to connect the message box to anything, although you may want to connect something to the inlet of the message box to supply a message argument or trigger it from a loadbang object to configure MSP signal processing parameters when your patcher file is opened.
When you click on the message box or send it a or a value, the message will be sent to the Max application.
Here is listing of the messages you can send to the Max application using this technique:
cpulimit
The word
, followed by a number in the range 0-100, sets a utilization limit for the CPU. Above this limit, MSP will not process audio vectors until the utilization comes back down, causing a click. If the cpu limit is set to either 0 or 100, there will be no limit checking done.inremap
The word
, followed by two numbers that specify a physical device input channel number and a logical input channel number, maps the physical device to the logical input channel.iovs
The word
, followed by a number that is a power of 2, sets the I/O vector size.open
The word
opens the Audio Status window.optimize
The word
, followed by a zero or one, turns Altivec optimization on (1) or off (0).outremap
The word
, followed by two numbers that specify a logical device output channel number and a physical output channel number, maps the logical device to the physical output channel.set
The word ezadc~ or ezdac~ object.
, followed by a zero or one, turns the audio on (1) or off (0). It is equivalent to clicking on asetdriver
The word adstatus driver object. If the word is followed by a symbol that names a valid driver, the new driver is selected by name. An additional symbol argument may be used to specify a "subdriver" (e.g., ASIO drivers use ASIO as the name of the driver and PCI-324 as a subdriver name that specifies a specific device).
, followed by a number, sets a new audio driver based on its index into the currently generated menu of drivers created by thesigvs
The word
, followed by a number that is a power of 2, sets the I/O signal vector size.sr
The word
, followed by a number, sets a new sampling rate in Hertz.start
The word
turns the audio on.status
The word
opens the Audio Status window.stop
The word
turns the audio off.takeover
The word
, followed by a zero or one, turns Scheduler in Audio Interrupt mode off (0) or on (1). It is equivalent to clicking on the 'Audio Interrupt' checkbox in the Audio Status window. 'Overdrive' must be on in order for this change to be reflected.timecode
The word
followed by a zero or one, starts (1) or stops (0) timecode reading by any audio drivers that support the feature (ASIO 2).wclose
The word
closes the Audio Status window.See Also
Name | Description |
---|---|
Technical Notes | Technical Notes |
Scripting | Scripting |