how to create a named variable in MAX??
Thank you for reading this question.
In several MAX patches, I need the ability to track several variables (eg, X, Y, X, Min, Max, Count1, Count2).
Is there a simple way to create a variable that could later be operated on within the patch?
For example, I have a loop using counter. Inside the loop, I need to determine an end, exist condition that is based on one of two conditions. Either the loop counter or another expression will end the loop. Testing the loop counter is easy, but I don't see a clean way to get an initial state and then perform an incremental operation on another value (ie, the named variable).
Thank you for your help,
Peacesong
have a look at [sel] to test for values and [int], [float] to store values for later use. there are also [value], [pvar] and [pv], all of which store information for later use.
to store a list look at [zl reg]
hope this helps.
this is GREAT help, THANK YOU!!!!
It appears that value and pv do what I was looking for...
Though, a bit confused on using [int] and [float]...
ie, when setting [int] there's no "name" assigned, so it's not clear how to reference it... is it that there's only one [int] per scope, so it's referenced as [int]? Similarly for [float]?
Thanks again!!!
[int] and [float] just store the value, then you can bang it out the left outlet later (out the SAME object!!). you can't reference it like you can with pv or pvar, those have arguments and can therefor be referenced elsewhere...
well dont forget send and receive
peacesong wrote on Sun, 26 April 2009 07:41this is GREAT help, THANK YOU!!!!
It appears that value and pv do what I was looking for...
Though, a bit confused on using [int] and [float]...
ie, when setting [int] there's no "name" assigned, so it's not clear how to reference it... is it that there's only one [int] per scope, so it's referenced as [int]? Similarly for [float]?
Thanks again!!!
you can "reference" to [i] by connecting the other part of your patch to it. this will often involve the use of gates. in most situations where you want to share a variable across the patcher [v] is the way to go.