Forums > MaxMSP

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

March 14, 2012 | 4:44 pm

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


March 14, 2012 | 4:45 pm

correction ( with mounted sensors on the trays )


March 14, 2012 | 5:13 pm

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

– Pasted Max Patch, click to expand. –


yp
March 14, 2012 | 7:44 pm

check out [speedlim]


March 14, 2012 | 8:20 pm

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


March 14, 2012 | 11:08 pm

ps

– Pasted Max Patch, click to expand. –

March 14, 2012 | 11:36 pm

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

March 14, 2012 | 11:38 pm

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


March 14, 2012 | 11:57 pm

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.


March 15, 2012 | 12:49 am
– Pasted Max Patch, click to expand. –

Viewing 10 posts - 1 through 10 (of 10 total)