Send bang if between 1-10?

Gnome's icon

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.

Karl Kliem's icon
Max Patch
Copy patch and select New From Clipboard in Max.
Gnome's icon

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.

Karl Kliem's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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

Gnome's icon

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.

Max Patch
Copy patch and select New From Clipboard in Max.

$Adam's icon

Hi,

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.

Max Patch
Copy patch and select New From Clipboard in Max.

Hope this helps,
Ádám

Gnome's icon

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