testing for a range?
Is there any object which can check for a range of inputs, i am thinking something to test whether a decremeting number has gone below a threshhold, the equivalent in basic to what i want would be "IF x<0 then BANG", i did try Select <1 but it doesn't work.
Have a look at the patch below, you could also look at the [if] and [split] objects.
----------begin_max5_patcher---------- 487.3ocyV10aBBCEF9Z3WQSulsPKeoK6l86XwrvGcZWfhQJYtY7+9nsfLcJT Uj4MzzCsk22yS6orwz.FkulT.AOAdEXXrwzvPFRDvntuALKbcbZXgbXvnRNO mAsTuZYHOdAkM+sUjXtZYPS7ez1BfblHZv1MOAypmCqLixRIb45gZClWxOLp JD+qkD0ZCiBYyg6VIZhTR4Qe7.xAJhs0zT7vRSyvHeVM4FyvIqkd.VPRAHMr HR1332sEw0AeOmwYgYRq.eYEMLEdTyi6z7V.XaBPrjEzukC.gqjweyKtWRdo eH6FnfbvnBY7XB4ZKh7t+gL51.YL5+.x1CHjiWT8YHc3Q0I4oRu4ooC0kwNm x6B9RY7llyfzA2DP2TwdT4r+.hYd9bRhFbt9vrm6vB5dOLueRneL6Nf4lmA1 8lW7U03vO5Mj03N4dhybS+kc0dYVDYUuN204VbxG2kyuf8C6cumbdvTJ6veb SZRQ78SKE4kqhaDfJeZAZMZBofSYgbZUIh1wT8eC+dPKnIID46aTWFMYYdkc p0vTOwdmIpqLa6.lcTzoqROPEmPpNmmTuVMgzQS3QUSA5HIzkPTjbCI.44uq 2UpUARQ8oU6QM8oytL+6Nf5NpJRmhFAiphvZnnqozPUmsl+.eI1bhA -----------end_max5_patcher-----------
Hi there I looked at your example and studied the [< ] operator but it doesn't seem to be working. Check this example:
I clicked the 1 first and then the 60 and the button lit up… is this backward maths or something?? I believe i’m setting 1 as the comparision "ie is smaller than 1" however the button still bangs when i pass 60 as the test number?! WTF!
from the help/reference of [< ] :
"outputs a 1 if the number is less than the comparison-number or 0 if it is greater or equal"
from the help/reference of [button] :
"Button takes any message at its inlet and outputs a bang."
So whatever the result of the comparison, the button receives something (0 or 1) and blinks. That’s why you have to use [sel 1] as shown in the patch lh posted.
Ok thanks for that, i only thought the button went off if it was a 1 signal, which seems to me to make more sense. I’m about ready to give up on maxmsp as a programming language though, as like really early languages, it stops on a problem with a very general "stack overflow" error, without giving the faintest clue where the problem is. The following example:
----------begin_max5_patcher---------- 1293.3oc2Zs0aaaCE9YWf9ePPOt4JPxCuVrWB1SEXXc.q8oggAeQwUC1RA1x XYqX+22gjVIJIMdzJTltEFwR5XJoC+324Jyme8qljOu41xc4YuM62xlL4ynj INYVIS5DLIeyraWrd1N2.yqK+ql4+Y9zC+Va4ssN4WemnEMqa15enjBiRxUz o3YjCeQKHY+d2Xa12ttrs8uuozeC4WutYF9.ua.W2T2VOai6myuZa0r028dp V5DhZyanp792vtp+wcCTF9BOHud+lpZ7c4lErNo2LqcwmppW8GaKWz5UAvvc pIGrG.VgXZFizWowGkWucOKpS5+95WYOhGl9hgxuONPYU8..RYLARGBRc27n BjHoAeT4+OjpoY4ymUu5zwDwogIzihIZKXnbeKbKhGCRXmKtE.JlPXoURil. F2YJhPqGEVFKdrLlxghbIerYYaJ2sa1pxmhormm4c5PC8NoyWMrknWNj5Ilf hdOjR0mSOfe2k.KkGQRpQ5HoDcphorqbcFM1npyc5zAvxY5HFlgo7fpwcPNd 9TmuussoN+3vQOnXf1u8wo6csDdHFvm3hD5PhyMW6GtDrdYjXRw7rJiHYwXn wLFiI8wX.gKqPF.icLlQN4PxWFKo9jzkDklC1yLXx6D4PfwiYrK3NudTMOUI TdcdjqkSDyJPbwaYBVpB6hHvReTxPCZDDFAQrhDDPXJlBPtIf92L3GzZWlf3 FQmJEyxLLzBLjpjpPqMEuPvwOHjIoEhCP1Wk01FOhjsPLDf.AXgBmEmFFO+Q OajR7soiXvRHpoppKbjEqAl1wm.FZ14a3zYsBq2jG0rsfX50FwCNGibZSI.T Efh..cj8euey7xsGGSFpMFDQu0bgKETI4BnARwg3PiGwgSEETBWR4HnfmCDE wn+Jl3PhHwA82H.I2Xrs1lUnERB2LtTnSrd49AtMmdcuLso.yigI4V2FZWrH odbq.dQylMk1U3Gakb0O9gOd0Ok8Ku+We2Gd26+47SLuEU7V3oXPXFiI0XhK BNTvAKMv1VdSgPSjriiMjAiMsMqVstLTuE8m8hAr3SU9FrkpddrorcaSVupA iSh9LHhovhXTW1GZFRDLTLppPOdf0vc.L.6eNRzw+TDtOiJgVv0ogLrcV8xl M3pjJtAKiXpnBsqwAB22Jw2NXTD2IXA001OkbrwnapVztac0x.Rj3Y8ZJyG. Gva6q7shyyHXBY34B3GW95p5m7uQf68Y+gGMw20re6htIU2d2m06MtrbWaU8 r1Jzyw8ixVfQF89Q8opkKKcC3t00MUKuoAwmCZBm.tlJJ8Ms0ukqO5Jv2XHg pWAGL6z+4WJi77xtg68GUblW9xC3DeaUI5XMkjAMkTm5TJJJmsP8.TNQRTtG +ZiEYHJJGKXCvSR2.BoP20xL+VmvT9Vc7vqX98..SN0zYEZEEGVQP.O6TctD GbOLfWex.O2Y2C9ME3Kdf46i.nUO8Jor29G9vK7KTXwU7ttXEq0IahtArNYR iARXjHHMtVHAobjznbrQw7ioLVFNW62WVvW72Cthd3+dEaIuBtfYNHJNSqf7 lmFuJ7f0sDPGBQ23IA1nAqajKz.EoQ2fwIF14KwFZZTMSnNFO+5VPY4CoIZW XEKllfcAsjptbUszXjBAk+hcehRQTgf0sD.bAobood2vJ2kbAmvrLI7Mcnp1 EpmW5Erm2DkDB0Db8YInEDgU7XhReKHqA1KOIIq.7v+wawB+g -----------end_max5_patcher-----------
Is supposed to produce a 1 dimensional "bouncing ball" effect, but does not.
0.08 is the initial gravity value and the red marked objects should be incrementing that gravitational velocity, before sending it on. The turquoise areas test for if it hits the bottom, and should invert the gravity velocity. The pink area is just the actual resulting position on the graph.
Am i doing this right? Is what i’m trying to achieve even remotely possible in maxmsp?
Just answering about the Stack Overflow:
output connected back to the left input of the [+ ] above
Of course, this is a typical example if you want to show student how to get a Stack Overflow.
the stack overflow occurs because of that part :
----------begin_max5_patcher---------- 353.3ocuS1sTCBCDE95vSAStUjgjBDv674vwwI.oswARXfvX0N8cWxBX+wZm Zq0aRHmcY2CeYYsCBmoWIZwtO39jKBs1Ag.Iq.Z7LBWwWkWxagzvJwa5rWwd CgLhUFPd9jxbsxzJ+PXUIT+fQYUWkTUJLPQnaE0clIUxn5fj48ZwfuvyK079 t77X7bcotYHTfeJKNjQ75eJXbg3G7UpxBvb8F9dBaWGp3UP0wO1H4kSQp4l7 kR0hWZD4lgNDFjBEMJwtMi5G44RCrsv9JabbrKdWG6t6FxNo55IW7ERN.YDJ 6Ofb8i.8ev+FNQNJmnmdFyyEmwUKvGECQWFFHyre+ovZDv4uQAnc3Ro5veEg 5Y02GMs5tl7ImO4M2sWdEhViTwMRsZ2jh2KokxhBADeheUxhZc+.ynI9gKpy 1SwmimX+udhcC3THIwNaSRfK2YC2zGbhBagDFjo8zAC.Nab9DL7m.AI -----------end_max5_patcher-----------
where you doing an infinite loop. (BTW a simple [+] will give you an integer, not a float).
You should definitely go through the tutorials if you want to learn max.
|i only thought the button went off if it was a 1 signal, which seems to me to make more sense.|
You really need to spend some time with the tutorials. The behavior of button is completely consistent with the way Max is conceived. If you come to Max with non-Max concepts, you’re going to spend a lot of time tripping over false expectations.
Nothing wrong with noobies using this list/forum, but Max has an extensive and excellent set of Tutorials and Help, and if you don’t use them you’re going to end up wasting a lot of time–yours and other people’s.
Just a word to the wise…
I did start looking at the tutorials actually. And to be honest, i dont think they really are tutorials, by my own expectations… the help files simply present you with the workings of maxmsp… they dont actually task you with building the examples, or modifying them. They do obviously show you the machines and explain them, but i’ve always though that getting you involved along the way and setting you tasks to do was a much better way of learning it.
Does anyone know of any such tutorial guides? As the maxmsp ones feel like more of a reference than a "teach yourself" resource!
Do you mean the tutorials or the help files? The help files explain what each object does and the tutorials explain some of the key concepts of max and how to do certain things in max, msp and jitter. They’re included with the program, you can find them under the help menu and also here online too. You might also want to check out the baz tutorials on youtube. Peter Elsea also has some great tutorials here. They’re all worth a look, the max ones especially. Think of them as required reading!
[if $i1 < 1 then bang]
[if $f1 >= -5. || $f1 < = 7.33 then bang ]
[if $f1>500 then $f1 else out2 bang]
Max has the BEST set of tutorial for a program of this kind.
Trust me, you’ll go nowhere without going through them.
Start learning slowly, seriously & with humility before criticizing every aspect of something you simply do not understand.
And you’ll receive a lot of help from the wonderful people here when needed.
Otherwise, you’ll make a fool of yourself in no time.
just my 0,02
Forums > MaxMSP