Author Archives: mgalvao
Generate random numbers within a specified range
Image
Single stream of grains from a buffer~
Image
Polyphonic granular synthesizer with parameter controls
Image
Sine grain player suitable for use in poly~
Constant-intensity panning subpatch
Image
Single stream of sine grains
Image
TouchOSC data via wireless UDP
Image
You can send messages to Max wirelessly from a mobile device such as iPhone, iPod Touch, iPad, or Android-based smart phone or tablet, using the TouchOSC app. You can read more about the OSC communication protocol that is used by TouchOSC, and you can download Max objects for managing OSC messages as part of the package of useful Max objects distributed freely by CNMAT at UC Berkeley. (You will need the CNMAT Max external object osc-route in order for this example patch to work.)
This patch uses the udpreceive object to receive wireless UDP data from a device transmitting on virtual port 8000. It uses the CNMAT Max external object osc-route to parse the OSC messages coming from TouchOSC. This patch has been set up to work with the TouchOSC default interface “Mix 2”. It will print all the data coming from tabs 1 and 3 in the “Mix 2” TouchOSC interface. The first part of the OSC message indicates the tab number (such as /1), and the next part of the message indicates the interface object that sent the message (such as /fader1), and the last part of the message is the useful data from that object.
This program can receive WiFi data via a local network that you create on your own computer, or via the Internet.
MIDI and audio via ReWire
Image
Max can interface with other applications via ReWire. Max can act as either a ReWire host or a ReWire client. Max can be a client to an open host application just by choosing “ad_rewire” as the MSP audio driver in the DSP Status window. Alternatively, you can use Max as the host (mixer) application by including the rewire~ object in your program. This establishes Max as a mixer (host) application, and a ReWire-capable synth application that you open while Max is a mixer will pipe its audio to MSP via the outlets of the rewire~ object.
This example shows Max in use as a host to the synth program Reason. Max can send formatted MIDI messages to Reason to play notes and control parameters of the Reason devices (see the rewire~ reference page for details), and MSP can further process the synth audio after it comes out of rewire~. Here Max is generating note information, formatting it as MIDI messages and sending those to the rewire~ object to be transmitted to Reason via ReWire. The audio that Reason produces in response will be piped back to Max via ReWire, where it can be used in MSP. (In this case MSP is only being used to control the output volume, but the sound received via ReWire can be treated just like any other MSP audio signal.)
Routing MIDI to other applications
Image
The easiest way to establish MIDI connection between Max and other applications on the same computer is via the “virtual” MIDI ports Max provides. Max creates two virtual input ports and two virtual output ports that can be accessed by other MIDI applications. (You can see those virtual ports listed in Max’s MIDI Setup, by choosing MIDI Setup… from the Options menu.)
This example shows how one can generate MIDI information in Max and send it to another application. Here note information and controller information is being sent to the virtual port “from MaxMSP 1”. Any application that’s set to receive MIDI input from that virtual port will get the data that Max is transmitting. In this case Max is generating a cloud of random notes and is also moving the volume up and down in a sinusoidal fashion every 100 notes.