Send bang if between 1-10?

Jan 24, 2013 at 12:45pm

Send bang if between 1-10?

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.

#66204
Jan 24, 2013 at 1:12pm
– Pasted Max Patch, click to expand. –
#238314
Jan 24, 2013 at 1:21pm

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.

#238315
Jan 24, 2013 at 1:32pm

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

– Pasted Max Patch, click to expand. –
#238316
Jan 24, 2013 at 1:53pm

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. –
#238317
Jan 24, 2013 at 3:50pm

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.

– Pasted Max Patch, click to expand. –

Hope this helps,
Ádám

#238318
Jan 24, 2013 at 4:03pm

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

#238319

You must be logged in to reply to this topic.