log in vexpr

phiol's icon

Hi all,

I'm try to do a log on a list but can figure out how to do it using vexpr log10

so I resorted to jit.op @op log @val 64

Could anyone shed light to how to do with vexpr instead
thanks

phiol

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

kLSDiz's icon

The simplest solution works for me:

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

But if you want to calculate a logarithm to a arbitrary base (jit.op @op log is just a natural logarithm) you can use this formula: log(x)/log(base).
(see https://en.wikipedia.org/wiki/Logarithm#Change_of_base)

phiol's icon

Thanks a lot KLSDIZ

All I need to know (or at least this is what I understand) is that log is a function and so it needs the () as in log()

so vexpr log($f1)/log(64) + 1. or vexpr log($f1)/log($f2) + 1 would give me the dynamic base.

Thanks

phiol's icon

what I actually wanted was a booster in both directions
not even a log.

here it is

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