how get range the range of an object?

Feb 9, 2009 at 3:42pm

how get range the range of an object?

hi,
how could I get the range of an object?
for example the min and max of a float-box I’ve set

thx,
johann

#42204
Feb 9, 2009 at 4:07pm

#150974
Feb 9, 2009 at 4:13pm

As far as i know, not possible once you entered the minimum or maximum into a [flonum]. You can of course make something to store these someplace else. May get annoying when you have a lot of gui elements though:

– Pasted Max Patch, click to expand. –
#150975
Feb 9, 2009 at 4:26pm

big thx,
the bindto solution works fine, unfortunetally in my case I can’t create two pattr for each of my params (would be too much).
Perhaps someone has a simple little javascript, that reports the min and max of certain scripting-named-object?

greats,
johann

#150976
Feb 9, 2009 at 4:39pm

No problem!

lh

– Pasted Max Patch, click to expand. –

// getrange.js

function getrange(objname)
{
myobj = this.patcher.getnamed(objname);
var min = myobj.getattr(“minimum”);
var max = myobj.getattr(“maximum”);
outlet(0, min, max);
}

// EOF

#150977
Feb 9, 2009 at 4:43pm

great, that’s it!
big thx!

#150978
Feb 14, 2009 at 7:57am

#150979

You must be logged in to reply to this topic.