[line] and [line~] question
First of all I’m not even sure if [line/~] is the best object for what I’m trying to do.
Here is an analogy of what I would like to do: You have a balloon and you can fill it up with air at a constant rate. Press a button to fill it up to it’s capacity without popping it. Release the button to deflate the balloon at the same constant rate. And you have the ability to press the button on or off midway through filling up the balloon to try and keep it within a range manually.
I have messed around with [line] and [counter] but not able to come up with anything that works or is practical. Any thoughts?
Thanks in advanced.
You probably want line, and likely the float version so [line 0.]. Both line~ and line start where they left off. Here’s a simple example that can get you going.
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 406.3ocuTssaBCCC841uhpn8XGJozVX6s8cLMgBTCDTIoJIvXCw+9ZbuPY.h NzDu3J63Xe7wmz89djopcfgD7Zv6Add6887vPt.d09dj07cyx4FLMhUsXQNP BqNRswlCV6WEPUMHBokD7Q8oxMqExxywaxpCVvsyVJjKlngY1pak7x.ZXP7P mMh1XaKiHC6rZ5pmGSZqhluFrfdBH4Syw1SO11JbU0WWvC99NSXOGx0fwvWz NkVXGhTxSr.FkRu5zebzmqjVYIBwq8lVvyIWhThtEoLNwYShcV13NjhqAFw2 XCXQCnmyUoj+M9vjKx.cOF6VD0Bn44Jts7FEarcUA+MoAKYL9YTbCabIwQ7i QbHgOK61YZibgDBnCtNIEdG5ig2jYhX3amzyd0baAB6xBjnNbBVMbz90OIP. 4heJQYTazyZl35GrAGwTFXrBI2JTxN4jdRNKEYYfr6JKSXbaQD3zKtv5KZR6 AZXOLzv5AZhuSzTs33EEaAsotjHPJ0xqTZmaZH5JjUtXEIZXqnI+Q9tpcv+G vT.ZhA -----------end_max5_patcher-----------
Thanks for the reply. I just figured it out and was going to post my findings.
The only problem with the patch as you posted doesn’t have the "constant rate" im looking for. It will always take one second to go from any value. If I hold the button for .25 seconds and release it, it will take the current value of the slider 1 full second to get back to zero instead of only .25 seconds.
Here is what I got and it seems to work pretty well:
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 664.3ocyWssbaCBD8Y4uBhdr0wi.AVV4s9czISGrEVgVYjGK7T2lI+6EVIeo ooHrsBwOXwnEj4rm8rKKOOJJdd8NQSL5AzWQQQOOJJBLYMD08dT7J9tEU7FX YwJwOqm+83wsSoE6zf46tGgSRRlrehk0Jci72B6jXxjjNypsqjpJgF9uHGMV uUu2JtyZqI8uVKZgW7xpZtYydra90b8hmjpxusQrP2tDxLrYmP3TpcfAuPRl jb3ajE.XMNv8YzSgphuB1l3urQxqhsS7xnQ1GiuNd4yH76HkHUdQHY41mojI LG7QZP3iRtVfHHx0SJj+GoDO17yGYRBAjITmxDRPnEiztXkno47ShvmmhwMw j2lxfmZGxYtHlo4AgX9zsPYERW9CLPycRKYCKsLeqVWqhGfH+btpzsaRy.OK +fC5vMoWhyzTIKDat.mAhQF6q2puF0M3Ro3S7OL8TG7fx5fv5TWlLfxZMZIZ 90mlSbKpG6STu8Xx1pftOhXJNHo7MhJSD.MDkASclLL93nSJB2UIb5LfoRcl XjLrbj8PAdo3eHo20RhdwFT3PBVaZzr2lMXC7gD55xxJwPTMr2NmZSKRS5uV HiMfh+07E+vTaX4GUzsyuwYI8eVGKLsLVIUBS0.CLNGRIcnaZriXxgzelShw yqV.eJ3du5FXv1as+2jUS81MK1C382gAcDAEhFsTw0RSCCGWjMJgvGVzSxhB AL+dZakrXcsIenCDnGeyPm2Xh3AldEvCBlv2V7jsQw94IRXico9hovE6rMcz OlRCJlndHmr2OJjzT9sWo.auPl652COkETdh4iDmd6ovYgUg6WniF7rt9noo e.Em58fkvVIvzNpG7DNrXxmpSfl61RNA39RKXZd4kQ+AlbgSZA -----------end_max5_patcher-----------
Right. I skimmed that part I guess. Seems like you got a good/workable solution.
i would still do it with [line] and not with a counter.
you simply have to calculate the duration yourself in order to get a constant velocity.
Forums > MaxMSP