Forums > MaxMSP

problem triggering next-time events with if statement

March 12, 2011 | 3:28 pm

I am using this code to trigger events the algorithm is something like

length – playing position = time for ending
if time for ending < = (length * 0.1) then bang

the code I am using is something like


----------begin_max5_patcher----------
657.3ocyVtsiaBCDF9ZxSgEZuncEKx1Xygp1KZeB16qVUQBlDpHlHvQMsq12
8N1ARHYAEVxgcuAIFeZluw+immmXYOsXinxF8EzOQVVOOwxxXRavp9eK6kwa
lkGWYll8RQUU7bgsy1wThMJi8owx4MFyRLlJl96GHDVi0zBoRFuTXF66kYw4
neTjmzLrb8xLYtPYNFZq0Tk8OyZHXW794VrV0LYRs0UwpYKxjy+UoXlZaLQv
7PWtCx2i6FDEEQCbPb89fH9tXzS0qb6lo96Jw1kYaidROxKSln+3LP1LcsRU
H6jBzNCSxniGL0DOggNHpIdze6OdLYmQESRwefH3Uo6JQN3THRmAK9pmxomF
QbelKsFQr.SJO7jHxYro9dvTVJ5tTB5qeC8o6Ron6wtjOiTKDxtIG1+ifXgq
AEPt.efYT9oQ23PVeUR7ntcxF96Ka.EmFJji.z0qZROWoTnonzNAj2X.D4hI
6hBcCAlnkarvcUagrIenRuz7hX0EEVknGyernpSbQGCtvWr6SsvE0eGtXWM4
VODRrYUooF0CvWZmfB+QnnDKjp4UjumCJfdigTIr8BTtPNWsnCDwouuJusDx
Kv2kneviB8GDN.B8pG6Ly0NOSdbKglSUa+PzUUrtbVy1s6ALz9yLQToxjwpL
nqnVyR2fPqYsHKIQHaqtVlkrpHSppcidRkC0qzomS6TFWmLbmBVfAxLfxTFb
wLBVNIfcnsyz0MhuA562NfZZmc.oY13HpOc+yGPcxnCsc199fH5QQ3Umn3gc
G06F6UdGjA6yqvus77EwqvCxqdCrBtXD55U+hLHi8.8KS25RiNemsajllON0
CGBinn55QXFz9E7j.m0dfaS8zyoHO7yKS9+Tma7A
-----------end_max5_patcher-----------

how do I set the if object to trigger the bang only one time?

thanks in advance
tiago morgado


March 12, 2011 | 3:58 pm

It can be done with [onebang].


March 12, 2011 | 4:43 pm

thanks once again broc



MIB
March 12, 2011 | 6:33 pm

you can also simplify it a bit and incorporate the if statement into your expr. same thing, just one less object.

– Pasted Max Patch, click to expand. –

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