keeping slider in position
I’d like a joystick controler to keep its position, and not going back to its initial position. All i managed to do is creating stack overfows. Sounds like a noob question but i’m sure you guys know how to resolve it.
yes exactly (but for this you just need to remove the spring !!!)
but also kind of buttons which actually send 0 to 255 values and then go back to the 0 position. How can I "freeze" it ?
the simplest method would be to store the number in [int] and use a [bang] from [change +] to trigger it; or use [change +], [change -] and a [gate]; these objects output a 1 or -1 when the value is either rising or falling, allowing one to open and close the gate:
----------begin_max5_patcher---------- 682.3ocyXssiaBCD8YVo8e.wqMajGays9gzWpVUQ.WBUDSTvQMsq5+dw1.Is YyhIwAxKXMiGrlywyYrg2d9IGuUUGX0dte18qtNNu03wQ4S5woygi2ljCokI 0p.81vpqSxYdKZmTvNHTSDf6888Jtfmrgo7+E1trDdR+j78aJ3kLgZ4vcdKx TAWs5Gu.vowVsWzELb55WW7a05CvRTmecrheskowjmm6qcysMQjttfm+scrT gdZRj7ccoXrbvGIeBQKQtupdm+77SxwlgEVfcPVhchmHxAC9ZxI59SN9AVhb 7mJxgppb.Zr0Hm5xhL1t2Gpv6.ULcHrNV0.gJgAwWgIRjFf3aBTq1KDU7Q.J xnA0pDdtQ.CSIpAT2ya.Wb1OaR2yKjK3BKUIisWSPYRYDAEp6CRV5eyDzEk5 1pMHflHoNfi0UOgJYAVRN2nT+RUOoqapkYtubETz6Ilht.CQFOCsnsz1fho1 dhsGenalbiESis0Xnk6LBAXq2YTTkmWxLGSAiFSCtSE6qU82+1h4IBlkz8zo R12tmiTsF0cFuSrSqr+SVR1SlEYef9HDPULEPlAUOXcUefpCFdHQudU7JK3m 8sTpkUNw+Az5p86R6Ritay4hNlOYrZQAOQTzb6oiQI+xHW3XTqKxxXp.52D2 TjsspY2pMSHT0o49.RiB74VT.qunOza8Q6ZFCoPSPT7XADDBm.AY81YVTPsY g886srBf.S.j+3Aju99VZMSymaclEPzmhFA8VSGfH+aPCCHqjZDSRsfYI0BL I0nyRpAllZWWEZrZ.S6srRRaTmuvYgOiLpoLZd1qQOtRDipCidbSMLbkZDHN TNPB0WWPZYkrFSLNsmdJEaFmRebOHAO7gboUkU6zuh9u8IefVhI.IjnLO95C gCoilg+BPgkEvC -----------end_max5_patcher-----------
As you can see, the first method is more accurate.
There are individual objects which perform a similar task, such as [peak], [past] and [maximum], but I find it tricky to operate on realtime number stream input in this way; I guess they are designed to handle lists, but look at the helpfiles for these guys too.
I looked again at this and found that the reason for the unreliability of the [gate] method is due to the control flow ordering of Max: from right to left, so one descending number will ‘sneak’ through the gate before it is closed; the solution is to insert a [pipe 1] object before the [gate]‘s RIGHT inlet.
But the [int] method is way simpler
Forums > MaxMSP