I’m having a problem which I’m sure there is an easy solution to, but is completely eluding me.
I am receiving information from a switch (connected by an Arduino etc… this aspect works well and is definitely not at fault). This is then feeding a counter, which is displaying an animation in Jitter (which is basically a nice graphic version of what the count output is).
I need to design some sort of process whereby when I get several inputs within a short space of time, it spaces them out so they are 2000ms apart. An example of what I am aiming for would be: 4 bangs go into the counter within a period of 1500ms (this is just a random time which would cause a problem, the choice of 1500ms is not particularly significant, other than it exposes the flaws of my system). The first bang would be output as ‘1’ immediately, the second bang (‘2′) after 2000ms, the 3rd (3’) after 4000ms, the fourth (‘4’) 6000ms etc.
I’ve tried a number of solutions, and they seem very complicated (in a badly written sort of a way), and do not work – or only work when certain conditions are met (eg. if I have 3 inputs within the time frame it works, but if I have 2 or 4 it doesn’t).
This must be quite a common problem, so I was wondering if anybody had encountered anything like this before?
----------begin_max5_patcher---------- 647.3oc0WEsjZCBE843WQl7rqCWHRLcZeneGc5zIlP2kcR.GCN01c1+8FfDW MaUA0gt9RPtfv4dtWNb4kIQIKkaYsIweJ9awQQuLIJxXRaHpueTRSw1x5hVy zRDreIW9bxT6PJ1VkwbEqNFiPngAVUnJehKd7GqYkJ65S.zLzzXrsYdloS2u i+d++QrogKpYJyFg6MxqLqe2d9.gLr5+TJThhFlYnutlWTm71ZH2nFVDn2p0 j52qXVnjrrP7XxtMVubs7+XFDvyPZquNYh9yTGokkaTJo3DdOdgwg64.zocd 38NOldYt3E3KGIDqhe.bH7RlaZV3uGldyBubg5lFcOJirL9jY7VtHip+RR8m Q7NgGexrgoAkY3NjrPMDDAOatuTC5dkZJJK2z3.0jSzMozSm0PdO0.42amiZ 6t7vAoERJXZndeyAb6OHEBd4yeI1gKTIfQqsW20KZAeOp3Bm+VVahBn2aO0U .3dUWQJX5czE5APFsEp+kfA2dY2+akhgyvWXsXe.JEyknLw5Y9W2wcWgXML0 Z44d+w.sjYKJC7+8Gg+4Gl4jTyEiejlw+z1OjrZkaVWNrKC5Ywu4hUrVEWTn 3cGP1aRnClzS7pJlYbTukFd0JYWrrGDGIU1ULoKq0MLAACSinf+MlRCOMAmA RD+fDYdttTaXt84Y4zc8tRvl5.8QBJ84RRF8CGhHdRR8gPLBaKELeWuqErtf VbXOQneYy4ENvg8TpKBGi.dPvD3BlBm.K1EEBbXuHZTpxQ3ovJagotfIHr7j SZA9dUjUqhPyMJWY1lC5YKPmjlpmX10qoYnM3ZyAKk0x01+foFRztOvdESN1 aWXUlon80oonQ9TWmWm7W3DkXgN -----------end_max5_patcher-----------
That’s really excellent.
There’s one thing: the output I’m looking for is numerical – eg. it is being triggered by the output of a counter, so it would follow the principle of what you have there, but output numbers. I thought an int object would work, but it would update before all the bangs had been output… Do you have any idea how this would work delaying a numerical input?
Can’t you use this on the bangs going into the counter? Or will that not be satisfactory in this instance?
Oh well – whatever, it’s not too hard:
----------begin_max5_patcher---------- 795.3oc0XtsbaBCDF9Z7SACW6jQRqDf6zdQeN5zoCFqlPGN3ZDScSl7tWXE9 PNXPJPzTeC1R.R+5SZ+0JdbgWv5p8x5.+O4+MeOuGW34gU0UgWeYufhj8o4I 03iETHqqStSFrTeOkbuBqmdnlsIpz6yJu6G6joJcKyhX2RV5KXQ3Ojtqz3aI 9eu+cJaJxJykJrKX8UlsAa3p0+5FZ3gV+mUkpxjBIdqutKKIO3TaT0nNzHz9 Z0Uo96VoVJAAG6ztlpN6A7FzVA1U6SKVzcY4DgQ7.vfCHLhQVz9egsrfecwB 9.r.B4ShEwWWnXnXDf.SBEh+OQQo7Osp6Uj3gb+e2HajiCD9JsoQX2UFwl.E aIB6hDYoanxFYd6PjPFhJLDD.QfTIxZp.vrsPYcR4ct.KJ+anFfD.2WgEOLR nuFIr4yQMqT4Fhr1evUIBJtGaD9CvsGIvrE7fqRV5TzjYvpkPxIiV6PC4ZEM IooMEFflXLDhOhiK7FNtqt1BjpacbMvagC8KZreSn4OPxEb4yew2fcg3TbKZ PXOVXWiVtzgcVzIrPOrJAr10kZcJKfIVKtygopT10w9FjnKcE5xDZeFLz42. d1yjYciRUUNNEfSieKWqD99RVaNCHLXVlwzdC1mAxUWNYER0tpQSeuGKQ3Dt N8L6Re28YuiOSPdV4K+PQ33qq9mCq5plcoG5kC1Z9ric0FYsJqLQk0Ffb1C0 9Lmvv8Ya1HwaS5qoHay1p1oxdMvWE1k4FOVmgKkcrzEViarX4OSHWPr1pVNE OPuNNuWsT8D+jTa7GfXgH3iQrhOBwdl7lUwRMQrslvsIEXrXmpjLRSD6.3bn I5HZhMllRqxq1oeALdlb7B8LuwWFTQ3cS1fPnO9u3XoINlBMAytkxfARhAVF 5nIFW+MXgUB8o9NuDUmdR2gkE8kl5HgYBbAmRWlIV9L2FWgc2XwUcm21g9Ou .ACnIGFYrxDMwbpl.ihV4tUSFHI.dW68xzeg9d6DrjCDanSwmINDN1zBLvfv 1IzH8Tn.NKYJrzTiRMw4f6d9YTxTuWC11BOs3evlSdwy -----------end_max5_patcher-----------
Thanks! That’s perfect. It’s an elegant solution. I can understand how it works but I would never have come up with that.
Thank you for your help.
Forums > MaxMSP