conceptual inertia

mediocrity at its finest

patch 1

without comments

As my exploration of max/msp continues, I think I’ll simply increment the patch count in the post title.

Last time, I had this <sarcasm>awesome</sarcasm> patch:

maxmetroslider1

Now, what I’d like to do is change the range of the slider from its default 0-127. Option click the slider and the .maxhelp has an example.

maxsliderhelp

Now I’m wondering what type of object the “size $1″ button is. So, lets quickly drop into Edit mode and Option click it and quickly jump back out, so as not to disturb things. If you do mess things up, not to worry, it’ll prompt you to save the changes to which you should obviously say no.

Ok, so “size $1″ button is actually a Message object. So, ‘size’ is the message and $1 is a placeholder for an argument, received from the number box. I have a feeling the Message object is going to be quite common and very useful. If you open up the Slider reference doc and scroll down a bit, you can see that ‘size’ is an attribute of the Slider object with a well written description. Size is a float to indicate the number of steps (range) and the default value is 128 or 0-127.

metro1

Even with such a trivial patch, I noticed a couple of UI usability issues. First, when I toggled the bang, the button didn’t flicker because the slider was set to 0. Second, if I want the range 0-500, I have to remember to set the Number box to 501. I wonder if it’s possible to add a +1 object…

plusone

Nice, you can have objects that do basic arithmetic. Another problem is preventing users from selecting a negative number. How do I do that? Wait a minute…the Number box in the Slider .maxhelp has a 30-90 range. How did they do that?If you drop into Edit mode and mouse over the left hand side of the object, a little “i” icon appears.

inspectoricon

Clicking it opens the following window, where the ‘Value’ tab reveals what we’re looking for! Is it me or is this UI fairly intuitive?

numberinspector

I guess the “i” stands for Inspector. I also discovered you can open this window by using a keyboard shortcut (Command-I) or right clicking on the object.

My original goal was to change the slider range and the objects above the slider accomplish that goal in an indirect, clunky way. However, now that I’m aware of the Inspector, I can now simplify things by delete the objects and setting the range directly. I would like the range to go from 250 to 1000 ms.

sliderrange

The ‘Output Minimum’ is 250 and the ‘Range’ is 751. Remember, range indicates the number of steps inclusive. For example, a minimum of 0 with 4 steps would give you what range?

Finally, the patch I initially had in mind:

slidermetropatch

I wonder if I could hook this up to a MIDI slider on my controller? Woah.

First, I’ll need to install the latest M-audio drivers for my midi interface and then configure it using the ‘Audio MIDI Setup’ util that comes with OS X, which is kind of like a patcher window itself:

audiomidisetup

A good post about the ‘Audio MIDI Setup’ util can be found here. As you can see, I’ve added a device for my Radium 49 midi controller. This is optional, but allows  programs to display the controller as “Radium 49″ instead of “MIDISPORT 8×8/s Port 1″.

Back to max/msp. Now, I imagine the first thing I would need to do is configure MIDI.

midisetupmenu

And would you look at that…everything looks to be in order already!

midisetupwindow

And now, if I just start typing “midi” in a new object…

midiin

Intellisense is awesome.

Hmm…the sliders move during testing, but they’re acting a little crazy, why? It’s almost as if their range is very small within the 751 units available. Oh yeah, it’s MIDI…duh. 7 out of 8 bits are used for payload, and 2^7 = 128 or 0-127. If you don’t believe me, type 2^7 into Google. So, I need to revert the range settings to the sliders default values:

sliderangealtered

And voila! The patch works nicely.

midimetro

That was ridiculously easy. Glancing at the midiin object help docs, I can see there’s a lot more to learn and I’ll certainly revisit it. For now, I’m still in the exploration stage – it’s about pushing buttons and trying things out, without fear, to see what happens.

Until next time!

Written by admin

January 3rd, 2009 at 2:36 pm

Posted in max/msp

Leave a Reply

You must be logged in to post a comment.