Audio clip end to trigger a bang/ event/

deb deb's icon

hello everyone!! I'm a max newbie here ! I have a doubt with regards my project I want the end of my audioclip to trigger certain events but I cannot seem to figure out how to retrieve a bang/ toggle or even a 0 -1 from an audiofile. I've been struggling with this for the past two days and would appreciate any suggestions. P.S - im using groove~ to play my clip

Wil's icon

hi new b DEB DEB!
right click on groove~ to open help file.

go to the third tab -> sync
you can find the information you are looking for.

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



deb deb's icon

Thank you for your prompt response,

It works Now!!! Thank you so much !!! <3 <3 <3

deb deb's icon

I changed the value to 1 but the edge still wont bang! :/

Wil's icon

Put some scopes and number~
You can see that delta~ is detecting the amount of change between each signal value as it changes.
So while it is ramping up, the value is near 0. then when it changes from 1 to 0 the value is -1.

with change~ it is detecting change in direction. So if the change is continuously up there is no change. Then when it sees the change in direction, it out puts that there was a change in direction.

Then you can see what happens with the rect~ .

Maybe some more knowledgeable folks will chime in and deeper explain my examples. Because truthfully ive been using edge detection without fully understanding.

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


Sébastien Gay's icon

Groove's right output is a phasor that goes from 0 to 1 and reaches 1 at the end of the loop/clip. The edge~ object in the example below sees 0 throughout the clip reading (groove's output signal values are >=0 but strictly < 1), but issues a bang through its left outlet at the very end, when the groove's output signal value suddenly reaches 1 : the ==~ 1 object consequently flips between 0 and 1, which edge~ flags as a 0 to non-zero transition.

deb deb's icon

Thank you everyone !!! this was very helpful!
Also i was wondering if this could be done with mc.groove~ as well?

Sébastien Gay's icon

Yes it works with mc.groove~ as well.
Example :

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