how to 'define' a level-range of a mic to operate with input values..?
i’m quite new to max and hope that there’s a solution for my little problem here.
what i want to do:
i would like to ‘use’ the input level of a microphone to trigger certain events.
the idea was to define a level-range to get a bang, if the signal exceeds/underruns a defined value over a certain period of time. so, if the input level is higher than a defined value for – let’s say – 30 seconds, i need a bang. otherwise, if the input level is lower than the value, i need a bang.
what i already tried:
to get some adequate values from the mic, i multiplied the values from the meter with 10000.1 – so i got values somewhere between 0 and 9999 and sent them to a gain-slider (just to have some kind of display). now the idea was to use the ‘speedlim’-command, to get some values over a certain period of time. i defined 5 points (1,3,5,10 and 20 seconds) and combined each of them with an ‘if’ command, in order to send a message, if the incoming value exceeded a defined value [if $i1 > 450 then 1]. the sent messages i used where just ‘1’, ‘2’, ‘3’, and so on because afterwards i wanted to use the ‘match’-command [match 1 2 3 4 5] to synchronize the 5 values, in order to get one last bang if all the values (after 20 seconds) would be high enough.
it seems, that the ‘match’-command here is not the best choice, because it only triggers if the numbers to look for are in the proper order. and, as the first speedlim-command interrogates the values every second, there can not be a proper order from 1-5.
maybe i am thinking too complicated at all. for me it’s important to get this patch working as accurately as possible. the more value-retrievals from the mic, the better. the program should only trigger, if all the values (over a certain period) exceed the defined value.
any suggestions anyone? is there maybe a command which works like ‘match’ but disregards the order of the numbers or something?
I might approach this problem like this (paste into max patch):
----------begin_max5_patcher---------- 1035.3oc4Y1taaBCEF92IWEV76rI7W.YZcR65XZpxg31PGwf.mttN0dsOrMz RWKFmNhGasUBJFWy64wmywe8ykKB1TbCuN.7AvW.KV7ykKVnKRUvh1mWDrmc SZNqVWsfzh864BYvJy6j7aj5xk6p306Jx218lRlLcWl3xyq3oRyWHID89vU. HMTcKReE0bE701+mKptbippp2XJIaqt0K1b06PIcM8EEBofsmqe0mqxX48eS c1s52.QOzJhC6yD4bo1DfcBrQvMVBSlUH5Ix3XstfjD0sv1KOHwllp3frqsB UEd2xkpKqbjfWjWzzHNfoX8M5ywTenDONTJYUMkK4UmyErM45ZD9J.lwtk+n jazoxRXMdBffMLwkACfHzq.QC4jUWrmCtlkefC9HPtiIZ5ZHTKnDi08hDyMH N5Hc4ndwkCazEgDdhb4Fhmr7bCNqAexIdBQz97DQNRdRlVd9mSlMGjxBgMOH XbOKFYOXDEbTwO1BafmBiAQV6twD920XD7u2HimmBfmCffvwMRbbrYvFpMqD NQCpfshkUOdeHDgmNDc1Y.pC7gn4C1NdhmF7fFBOYMYkN8NM2lCpsNjaGSfP c7gclDchYhM2jWyno47q445I.busT6sy5HLxjZWmhHhL.CnGWxA+zMWxR+FH r62w6tQQlb6QXq82SzfVzA6uO8j4SiMvdT6TiPsyDwJPv9Lov.yYJBiLBl5v bl7IIosvyIRhlAjjZFH.gR7KIK4ruw1WdeSJmleF22rc8PvP6HEdhQpYQOdD OT6zo0eqkNqisBmv+SfynQgDJx4nv0yffPB0LFDJ9uTPHxtWVKOcxKK4shSF tcKrbwIKdF3j0oWbnecxjrxlF1jnGfUWT4zFMueqbgD8jxQqsNq7IZR4jg3a c1kBUSY8uF.kjIEkYh6cFcPMyRrtP+IdOtdF4ZjbZgPn01rIeVGfbIeF4sR9 rtkE4R9L7+VaL.+V11z6cXG.POtA.pqu3Nicbq800rDnSzTqG2ncatiykn.c UBxyD+9AWoMPU4OEX0EGpR69JcmYB3QabKuVlIziU1qRM92.3C0YW11sbQ+C NYaVs5rT1N7FOOoxIddIm0yK4nVG8rRO9y6QsA189TurdTGLQOQex0yX7Qc1 B9RON0ek3O8D4hdh8mdHtnmH+oGrK5QIZhezCxU8f8hdV6pbPdQNwtJGOkc1 E4P8lyry9xdJ1B55XWdROgtN1tezSzShhGPNPuJGzXxweij5Rrk+BsnNnlHu 1UM1jvR7pZFiM9KqCwwk23G0j33pa7TFPGWI57IB+0l9yrpcVY407p51lTKj f8rqJpTOFsR+Xlv7ndCUBp3Wm0Ue8InGvpR2kI4oxCUl8f3ljnfkpuycK+Ef .6M7z -----------end_max5_patcher-----------
thanks so much! this helps a lot:)
Forums > MaxMSP