How to programatically retrieve values?

Jul 28, 2013 at 4:51pm

How to programatically retrieve values?

Hello Folks;

I’m new to Max/MSP and have a question: If I store a value in a pattr object, how do I programatically retrieve that value? My initial attempt:

#pattr _numMidiValue (initialized to 60)
#if $i1 == get_numMidiValue then…

Unfortunately, the ‘get_numMidiValue’ call is not getting evaluated. How does one programatically retrieve such values in Max? I’ve attached my test patch for your examination.

Thank you,
Squimbelly

#257398
Jul 29, 2013 at 12:17am

No patch was attached…

Use “copy compress” from the edit menu in Max and paste into your post.

#257415
Jul 31, 2013 at 6:07pm

Hello Metamax;

Ugh – somehow my .maxpat did not make it to the forum. But thank you for the tip on “Copy Compressed”!

Here’s the example patch:

<code>

– Pasted Max Patch, click to expand. –

</code>

Thank you again,
S.T.

#257739
Jul 31, 2013 at 9:51pm

Check out the reference on pattr (ctrl/right click the object and select reference).

You can bind pattr to other objects either with @bindto as an attribute or by linking the middle outlet of pattr to the object.

Once you have pattr bound to a number box, it’s just a matter of comparing two numbers. [sel] outputs a bang when values match. [zl reg] stores a value and waits for a bang to output.

Like mashed potatoes and gravy.

– Pasted Max Patch, click to expand. –
#257745
Aug 5, 2013 at 7:23pm

Thank you very much Metamax – I’ve just learned alot!

S.T.

#258137

You must be logged in to reply to this topic.