[Sharing is fun] - Gen code

Sharing is fun, and so i am just starting this thread to share gen code among OWL users. Post your own Max compressed code below, if you like.

Here’s a code snipped to generate a pseudo trigger (1) from comparing peak and rms levels of an audio signal.
Good to trigger an envelope for instance, or a change in delay time, or a filter change, however, good to trigger all kinds of things from audio levels. Includes just one control: Threshold.

Same code is shared also here.

*Enjoy and share your own snippets, if you may.


----------begin_max5_patcher----------
2846.3oc4bs0bhiiE94jeEZ7SjzIDKYrA1T8VcW0r0LyCaMW5G6LUJis.b2F
YZYAILSM8u8UxxF7MYKS.BcuODGPWrN56bQeGKK96KuvXRzy3XCv+B7QvEW7
2WdwEIEIJ3hzuegwB2m8BciSZlgWzhEXBy3FYcL7yrjx+ILAScYXfKfQClMC
SASoQK.OPVhc+LXMlFuJF7G+2O.Bwqwgw8ef7.4mh7i.rns8vk.d+O9g+3FP
j3yaXyCHy.7FiATraX3la.OMOvaNffw9whNNAKuc.e7RLwmKXI22+C4SQa5C
9j6FZzR7Cjeq+G5C9EeraLvMbQTLCvaY.EGtALIhRidB6Kk1oADe9XFChHbI
2aiWH+aCGz2STWDc0h39fecN3IbXX+LHf2DrWzJRBN.sRKkrZQzJVHlk.alo
ktzk4IlTORwdLIriFMpu4M.z.wUns7eif8MA+YZmB7SP3nIe51QYCZLaSHNo
XicCX.Ia7fhx9mKuTb4FM0rrnYy32yZkeXZoxhXaVhkBuQfXZ+mML6flISng
C1MIEWqaxMzX68g5t.yvzGwD2Ix4o4wahyuASvzulc+lFQXwA+Uxf.Q8MqEP
Pp.j3fYD2Pia.FSCibyANKh7w46YMfEbnUBXMHAyrcR.KTNvheySvhsBkPVI
brJYd7dZfXjqfqNaKivwz071HDic2jVfTTtwZpqmTarOvL9ItzTIvwRZhqK3
8czxqEyNn.7FMVb0wtBPlCcrOhtTgAqw88yoUV6R2ptpTolVX0XaoFAjdbCj
WGVOBLnI+NXsXQFj4tF6+nKiG+dxJFd2mhSAkTTQLwCWgillUbV44GyvHxLk
fSgVFOOhtyrmMm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81B8+Q6gc59whPP82Da6gmwaHa8DAagD3wDZkaGqkYZxx0gssR5
q.5aef1x1FH4sifGmMl3rE64F5IXN8i3P2M.+dCF.Mu5dPF8uM83e6ABgSpR
Ty8.pevZ9WfbpXj6AhdF+kDBdPNKL9UdieVzZ+9TrqeOxMfjyP4x29fAIhfe
v3JYubWK3Ex66a.a3j6dlb+V1awegx5wq+ZwXwa9FdY7uxafe+mnALbu3ubU
QBduN9x+62d5BPZMXn9AHsb91M.YwmElq3IgcBekeFjae7aCkg6IHadV.xnc
fb0yC5wL3o83bH8.sPZz2tHco87H82sgag2Z9heiqjlrouvUhWyaMPxAGgE3
K9R7VaJzEAXUzvKAy5kxrBl2h2+oxLu01BXeEPTGDPQL5xI1b7EvAcPBsqMW
MiHpu70Ay77UzG2rjCOoRtkSGj7WCyVEJZEVECeMjvgcPBEoGdx8r5hN15bx
uxoqH6YiekBoogvsmZy1wcAaaU9xU4tZNtGXMAY7i0AazNGiaKyVOAxmmGqQ
AQ5i1I+L8TxpIBgNOQn2brfG4FtIOA60mVrpWDQsNUimtiEKbuOVrotP5dpX
Gb.NUr69EvnBQ+cvRcwKyANZ7b0Uwpebwk1aT4zUoXnlBQ4MT4fJDnwZJE1G
SgPSYXTk1UkDyAUvz0NYfZACdTDLqtX.+Zq1rjNQmNzA1AAqC1SovXgebwR5
cwXSxevpJKyo+rUUKe3sfiB4LWJPU9gwR2wIcKkabbbN.iSgb6TEQ6.LNCzX
brOP3Va5GqcqR7hFGSMFmW57Aow7Ad.lOn8xNP5NU5v6IFhRGRuRGLupGFO0
G.uxG5N9H+OW9+zDMFFA
-----------end_max5_patcher-----------

Great stuff, thanks jayrope!

SIMPLE PSEUDO TRIGGER SPEED LIMITING

Adding to yesterdays gen snippet creating a pseudo trigger from a peak versus rms level comparison.

The patch below enables speed limiting on trigger generation. Oftenly, when you create triggers from audio signals you end up having too many triggers per time. Even if your threshold level sits right you might get several quick triggers upon attacks in the audio signal. You mostly only need the first of those.

The following code let’s you do exactly that: Have only the first of some fast triggers pass through and only open the gate again after a time you can specify. This code was to it’s biggest part created by Graham Wakefield from the gen forum.
I only added some control elements and a random trigger generator, so that it gets more obvious, what it does.

This should sit right after the trigger generator and has one control: limit.

*Enjoy.

`
----------begin_max5_patcher----------
2410.3oc6bk0iiiaD9Y2+JHDxSa5sAI08FLIyfDffEHGur.4gcBZHaQayckI
Ejn5iYwN+1COjjkrsjoca41HXdQtMojXUertXUk6e6tYNy4uPJc.+.3mAyl8
a2MaldH0.yp+9LmMIurHKoTeaNK3a1PXBm6MyIHuHzi+SqSD.dVJXCWvK.an
qVK.oEzmHfW4U.Vkn7glGJixHK3UL8ShqGjUsgWIxHB85.qGMOQrXMks5wBx
BggNcgwO3eO.EF8.T9A1W8gq6CPv+s9gnoZRhO+W9dreyhVJdMinG2Y6JRYM
KHRM1ue2cpK2+VwhpBFHklj8.HiVJHr6AOq3CfXMALOqh.xqxJIkf4jL9yWF
TAGDafi.8GtgihJduCnhlwWvyjRGe.TlSHoRzYCUH+z.GGDHbOYwCrFHv9dp
OhzvgW3.3f6DhCLxyx0XOXHGTjvR4aZlXMMMkvzKxAY0lQMCIdMmX3SGmVN5
.n.JzHMnwh.jFQvGFDPAVBB8.cRQMqWy6ybVRyHOQJJo7tbyLmj77NCOqyin
.regqeQg22NDkYFxscnBxSzlm2qczjBISKjbbUggneIpgSTuFdJofUQa28za
c207BavIeiVCzUiSdPszRDbKRI2kWkwW7qjzNPfb2Hmvnr7BRoTTOQTSbsSm
RVlTkIdbImIJoeQSeHI9en4WlrfL3CyR1XXtOUHsmzvdNqJnoblhH5A0pgaV
NoLf1xn55VlQeGrj7C7vRYAIrLvjkRlrpbdRgZmXtQJA2Lofyy5OU6ykQVJp
mNmxX6fhBd9vSVnbgL7zy4xI2L16VOS4iULyrOJ0LEOVl7TezVjjkUqp1+0+
RBitIQPDTyV.F1NIgkHYz0kKJ3YY83WyLOcfYRkBwKHOSSEq0KTWgA4sSyaD
hbZ2kSoqHkh9iIR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