Thursday, March 27, 2008

Max/MSP Virtual Controller

Just a brief and simple instruction on how to create a simple virtual midi controller in Max/MSP. You can download the trial of Max/MSP here.

First off we need to let our controller know what port to send midi on. We do this by creating a loadbang object connected to a message box with the number one inside. Now, make a midiinfo object and connect that to a umenu object. This will create a drop down menu for us when we start our patch.

Create a pictctrl object connected to a number box with zero inside. Now, make another object containing *127 and connect that to another object box with zero. What this does is send a value of 127 when the button is on and zero when off. Now, connect that to a ctlout object including the number of the CC you want to send on. In this case it's 60. Now just connect the umenu object we made before to the ctlout object.

Now we need to add an image to the button. Option click on your pictctrl for more info on formatting for pictctrl and pictslider. Right click on your pictctrl object and select get info.

Select "open" on the bottom of the window and select your image file. I have included a sample image for a button here.

Next, we'll cover making sliders and x/y pads. To make a x/y pad we'll be making a pictslider object. It is essentially exactly the same as the button only you'll need to add one more ctlout so you have one for x and one for y.

To make a slider you will just need to get info on the pictslider object and uncheck "move horozontally". For x/y and sliders you need to use two image files. One for the knob and one for the background. Add the images just like the button. Here are some example images you can use: slider knob image, slider background, x/y knob image, x/y background.

1 comments:

Brando said...

This is what I am looking to do in order to control some hardware. I'm very new to max, however. Would the build be the same within Max4Live?