Feb 1, 2011 at 3:17pm
How do you set up a patch so that there is an object that gives you a percentage of squares that are white or black for a matrix displayed in a jit.pwindow for example
Ideally in a number box that updates as the program runs
Feb 1, 2011 at 5:56pm
look at jit.3m. If it’s just b&w image, the mean value of any color should be representative of the % white vs. black (scale 0-255 to 0. – 100.).
Feb 2, 2011 at 1:45pm
thanks David thats a nice simple solution. Cheers.
If I wanted to develop this further I ahve a question about maths. Awesome I know,
Now that I have a % of ‘life’ (white squares at a given time I want to write a mathematical expression that says something like:
‘if life = <25% tell oscillator, midinote, etc to play note A, (could be c1)
To wirte an instruction/statement/message like this my head says if I put it between the two objects in question it will act as a sort of ‘check’ before produceing the outcome.
is this the case or is it better to have some sort of global message that applies to the patch as a whole? Also im trying to work through some examples with vexpr to try to acheive this – is this the right object to use?
appreciation in advance
Feb 2, 2011 at 7:51pm
[if $f1 < 25. then bang]
– Pasted Max Patch, click to expand. –
Copy all of the following text.Then, in Max, select New From Clipboard.
Check out the if/then help for more syntax, multiple conditions, etc.
You must be logged in to reply to this topic.