Single bang from several numbers HELP NEEDED (probably very simple)

Mar 14, 2012 at 4:44pm

Single bang from several numbers HELP NEEDED (probably very simple)

Hi guys, im new to max msp and i have a patch that reads serial data from my arduinio.

I essentially have a piezo creating what should be 1 number to assign a midi note, but because of he sensitivity i need for my project, sometimes i get about 3-6 numbers printed when i hit the piezo..

I need to create a single bang every time i hit the piezo as this will trigger a (random) object. What is happening is the random object is being triggered really quickly a number of times, now i need to tell max to ‘only bang’ on the first number it receives for each sensor hit. So somehow turning what is essentially more than one bang into a single bang every time the sensor is hit..

The project is to detect water drops hitting trays without mounted sensors and this randomly triggers notes and velocities to create generative music.

Any help would be great, but please bare in mind that im a newbie.

Thanks Guys
Guy Richardson – UCDCMT

#62381
Mar 14, 2012 at 4:45pm

correction ( with mounted sensors on the trays )

#225334
Mar 14, 2012 at 5:13pm

How about passing all bangs through a onebang object, and resetting it after a short wait?

– Pasted Max Patch, click to expand. –
#225335
Mar 14, 2012 at 7:44pm

check out [speedlim]

#225336
Mar 14, 2012 at 8:20pm

Hi
you neglect to say what those numbers are, ie in what range; if they are, for example, 1 – 10, then a simple [> 1] –> [togedge] will suffice. A changing value will generate output for each change, so [onebang] is also applicable here.

Brendan

#225337
Mar 14, 2012 at 11:08pm

ps

– Pasted Max Patch, click to expand. –
#225338
Mar 14, 2012 at 11:36pm

Hi, thanks for your posts guys, I’m new to the forum and max, so forgive me if I don’t make myself clear from time to time.

the data coming through is varied, the harder the piezo is hit, the first number would be like 117 and then 3 would follow just as the patch creates (the one Christopher made). So essentially I need to remove all the extra bangs so no matter how hard or soft the piezo is hit I just get one bang per time. I can upload my patch but its a little messy at the moment. It listens to the serial data coming in from the arduino. I’m sure its simple enough to apply something to the serial data to scale each hit to one bang, but i have read and read all over and I cant seem to work it out. ( I scratch my head on this one) Oh the patch you sent Christopher, it creates a list of bangs just like the patch i have, how do i get this to ‘reduce the bangs lol”

Attachments:
  1. midiserial2.maxpat
#225339
Mar 14, 2012 at 11:38pm

Any help would be ‘banging’, Im as good at comedy as i am with max msp.. not very :/

#225340
Mar 14, 2012 at 11:57pm

I tried the [speedlim] object and it works, however there is about a half second delay now when the sensors are touched. So, were one prevails a failure takes its place. Cheers for the help though YP, much appreciated.

#225341
Mar 15, 2012 at 12:49am
– Pasted Max Patch, click to expand. –
#225342

You must be logged in to reply to this topic.