Help with triggering samples based on joystick movement and time
I am stuck on a fairly simple problem as I am new to Max/MSP.
I have a continous analog input, that has two directions, up and down. What I want is to be able to trigger different samples based on how many movements of the joystick in certain directions occur per second. For example, if the range is scaled to -1 (down), 0 (middle) and 1 (top), then if the joystick is moved up once in a second, trigger sample a, if joystick is moved up, back to middle and up again in space of a second trigger sample b, then the same process occurs but with samples c and d for downwards movement.
I’m aware a second may be too short amount of time, but this is just an example time. Also, I can figure out how to implement the analogue input, so if anybody can tell me how to do the rest of the patch i.e. comparing input with time and triggering the samples that would be great.
Thanks in advance for any help,
analogue input? What do you mean?
Looks like your project could be done based on the following objects. Check the related help files and tutorials:
[sfplay~] (with preload) (you could also use buffers etc, but if you’re a beginner, I would advise sfplay~ for a first version)
[dac~] (no kidding!)
sounds like streetfighter 2 turbo power moves.
I think this should give you a point of departure. I hope it helps.
Good luck! Probably there are other ways to dig this out.
----------begin_max5_patcher---------- 1050.3ocyYssaiaCD8Y6uBB0W5B3lJRJJa09Teun+.EKJXjXr4tRjBVzaiyh se6kWjhcxRYKqvnU.IRvioDOyYNblgzec4hn6kOxZh.+F3uAKV70kKVXMYLr n8yKhpnOlWRarCKph0zP2xhV49NE6Qk0NDE2YiWXsHu+S+RBtyn3PEWTxT12 Bp03CRgRPqX1w+G64zxtgWSU463hs+ydVtxgO3l36hWARHquirBfQlqvz6hA e7zTHOn5lCXqUmI0wZl60DE87CXl9F9S1u.pe4Fqea4RykUCjNt+fRIE97bn WOGdA+CSL9GN05lnmudq928Tw1S9X8dVCSnnJtT7hICd1j0cA7wfRAw2JEfi iCIELBmIWVUooquSdq1w1y.T8+RQ4Q.BTI+ByLxFPEstlU.9YHPIAwe.PEce .8AOrBdyEYkaaIQqjAZugRQlavM8RXwgS32Wd.YMS.9jTrs73cT9C9Hfz.lS vQ.INoxZr0++QmSf8TAM++744jK5497uTq+Q13bymu1W7cDncKkK7B1jQB1j L2sM1PR+fE0WvnguUXh5fHtdk3nVFKX+q1G9NwYojVXyM3wcwgaYIB5RikYq TQt1pxAlIO.JydnklGpKoG8JBPgasJZsq9chsxcx0XkAHOtL+b4Bfn0INzPL n4TAv1mpg9kt46m9Kyb8LGoSVnws9OTbVp4obVh98woTuXdzh8Gp9SortuLo v.FcbZ11LoYnYQlzaVuh1DvZKwjeD50IS40eqN7FPyN4gxBfZOM+yfixC600 zO1n34e1GquN7szXkgPR7z0QSOhscbedLIfdb7Ydb61ZFgLqj2nrZjPt.rOM BxGmfBXETW2CYtve1HEAWtBPhqqYB5kE.BHKA8wRv.pbb6H9ckkvI1MJRvua rjuyM.tI3qudirzHbXkb61RlOuibymMPbXNa.WC0WKhmZq6AIu4PdOoTepDn EC0lcSCAdC+oAuLNFaaFec5XKiG7bq8KORtU4Qaq0ARd7NEn8Uy.F98WL+Bz 8PN46zsC5M9CCdxOX6dxuFofuDoXTGqdUNj2wSRxuhIKfYFbjRqtgjMm2xyu BNcT5muCvfmmDtFc1wqu4MVhI.DRSIufs2WmTirHJDZ8Mjq8OLYTA7vEYU6z kg2oAWr2JgAO.if17io3wdpTCJ5ZGidOIhW+qKYAlw9KYpF8VLy6lgtyiCbB aEL8lOE1VUNaPIubP63EELw4cwUwKpkZEYKH5ItMTLkLDLYN2zIDSlVktNOA mVLgFBlhmVLkLjXGZRwzfz33zoESCQOYNlsIDSuZ5lEq6vnYHlFjFmXNEwYH llaq6l1bluZ5lE4mfj4WtfgPSvz4GjPyutBfj4WWAvIt6oAE6l1DACAQvYm. OaRqpLnhuuANR+gus7+QtaLuG -----------end_max5_patcher-----------
Thanks for the responses everyone, both are very useful!
Great patch dcocharro, definately helpful