Forums > MaxMSP

Send bang if between 1-10?

January 24, 2013 | 12:45 pm

Hello. I am creating a a patch that reads a live weather feed and corresponds musically. However I have reached a stopping point. I need to find out how to specify a number range and output a bang to start a sample playing.

For example I want to have a separate sound for temperatures between 1-5. So I need to know how to specify "if 1-5 is present play sound".

I have used regexp already in the patch but I don’t think this is the answer. I also tried Coll but couldn’t use it to complete this task.

Thanks for any help.

January 24, 2013 | 1:12 pm
— Pasted Max Patch, click to expand. —
January 24, 2013 | 1:21 pm

Thanks Karl but my numbers are fed in to a message box and I can’t seem to work it even when I add them to a flonum.

January 24, 2013 | 1:32 pm

Please send a patch where we can see what the format in the message box looks like.

— Pasted Max Patch, click to expand. —
January 24, 2013 | 1:53 pm

Yes Karl i have copied it here. You may not be able to collect the data as I am using an external script to collect it. But you will be able to see the manner in which my data outputs.

— Pasted Max Patch, click to expand. —
January 24, 2013 | 3:50 pm


I think the main problem is that you’re setting message box contents with ‘set’, which will only set the message box, but won’t give you any output. One solution is to put a [route] object instead of your message boxes which will drop the ‘set’ prefix of your messages. I modified your patch to show you what I mean.

— Pasted Max Patch, click to expand. —

Hope this helps,

January 24, 2013 | 4:03 pm

Thank you gents. This has indeed solved my problem. Great work.

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

Forums > MaxMSP