simple phrase detection

Feb 2, 2011 at 3:06pm

simple phrase detection

Hi, I wonder if any of you have done phrase detection?

In a list of on/off patterns (0s and 1s), I would like to divide the list into sublists, if there has been a period of more than 20 0s in a row. How do i do this?

I have made an attempt here:

– Pasted Max Patch, click to expand. –

Thanks a lot for your help!

ana

#54746
Feb 2, 2011 at 4:33pm

Hello ana,

what is [collect] and [show] in your patch ? No such object here ;-)

#197124
Feb 2, 2011 at 4:45pm

How about this:
(when average of last twenty values is 0 (assuming only 0,1 input), you’re good.)
zl stream 20
|
mean
|
== 0
|
change
|
sel 0 1

#197125
Feb 2, 2011 at 5:23pm

Hello ana,

a naive approach to cut the flow after more than 20 zeros ;-)

– Pasted Max Patch, click to expand. –

HTH.

#197126
Feb 2, 2011 at 6:04pm

Hello ana,

this messy one may cut before and after …

– Pasted Max Patch, click to expand. –

For the demo, i set the threshold to 3 zeros …

I’m sure it can be cleaned and optimized, specially the [p beurk] ;-)

#197127
Feb 7, 2011 at 7:57am

Hi and thank you for all this nice help.

Now I’m getting more curious: … what if I want to look at more than just 0s and 1s – for example 0 1 and 2?

I am new to max, and I don’t quite think that I can get around the t b b object …

Please see my question in context:

– Pasted Max Patch, click to expand. –
#197128
Feb 7, 2011 at 9:06am

Ah, got it!

This is how I wanted to solve the problem (see below pasted patch). Thanks for all of your help!

– Pasted Max Patch, click to expand. –
#197129

You must be logged in to reply to this topic.