Im fairly new to max which im loving so far put i think ive hit my first wall..
I have a list of frequencies that is constantly updating(these are peaks that ive detected with ~fiddle), and Im trying to catch a frequency as it dissapears from the list.
The way I was going to do it was monitor my list and constantly compare the new list as it comes in to the list that came before it.
So Im trying to compare 2 lists of frequencies to see which elements of one list do or do not appear in another, which sounds easy enough, but my frequencies are floats that are always slightly different – I want it to realize that 79.0930 is the same as 81.0028.
How would you go about this?
use one of the zl modes – forget which
Yeah thats what I thought, i think its called zl compare. But from my understanding it doesnt work if the values it compares arent exactly the same.
I need a threshold setting, for example if my first number is 8.0 i want it to search for anything close to 8.0, not just esactly 8.0
The other thing that zl compare seems to do is only compare the index 1 in list A with the index 1 in list B. I want to compare index 1 in list A with every element of list B.
I could be misunderstanding the way to process things with zl
see under; round
zl sect does the job; in this example I convert the lists into a streams to round the elements to a required accuracy and then convert back to a list to compare; but you could use vexpr to round the elements which would make it more efficient, if you can figure out how to do rounding with it
edit forget about what I said– round processes lists as stated by jamesson, here:
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 672.3oc0WssiaBCD8YxWgkerJMx1XGf9V+NpppHf2rTA1QfQM6tZ+2qu.Izr wDpBA09BVXl34LmYNim71p.3N4QdCD7Ev2.AAusJHvtkYift2CfUoGyJSarl AyjUUbgBt18ME+nxteUpJ6YdCnV1Jx448e+PMuQadppPJ9QMOS47Egx1fVCB wwlET2Cv269Uh1pBQIWYcItaymjBkHshac2WqKRKgmMW1p5sG06ZChJD6G31 PpwSXl0qIQ1WRF32hb6gK28yOSigC7aSwqV+hwaPlcee0Jyi02IoIjfNd6F7 EcKwAV1hxWDFy4VKusc6nDVzLRXB9uzm4G3KawkNxgWKtI+kwMdj3lhsgJwt vviF2a6Od2Yqd4.2cJP3I6++mRvz3oSIrkgR7IqRyxZqSydQKtp2WH.o5X7r YkEBdlcCssgOXED0UIQiNKfnTOrFdFEPOUJ0XDNGQGYj9ow1hhHayIFZrZhv Du0DZrlpyN.3tTw9kPy7I.4gqWBic20frrRHYCaDtI9FbybxIU7llz87OPJg H5F.EctShmqhvjDWdN71WEMm7YWGGWQF0sDcc9DGsL8e10pTRwnhroekSHYP .RN87pwm+qb5jPymV40RPiAjyQ5cjNIXlK72hGnZ7oWvD+420ybN1mbghHan fPDCPvHPRBfxP2P4DF6tEfsnBGBy50H2vatAt8IbVnQY7wo5zttlGoYUjoSD 3Li93lpwlGh55UOJ4PtOxwZic3iK9+VVXY1+OYrFYacVuG5GzDbFY47FUgvV iMvHiz.fOYzyE44bwvYTpJxOHKDpNP3oUwTwzTfzE39QCIykoSCSKGMYFHdZ ot+03I1hxSjoBoEjlRl.ltfKezXBOEdxLDzBl5tnwiGLcOsBzu79peS3rfDM -----------end_max5_patcher-----------
Wow thanks guys! rounding is the way to go, that example works great.
its so simple I dont know why i was making it so complicated..
Forums > MaxMSP