Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Logarithmic function.
#5
Macro Macro848
Code:
Copy      Help
;int midi=0
int midi=127

double p=midi/12.7436031497752
double r=pow(2 p)*20
out r

How to get the 12.7436031497752:
out 127/log2(20000.0/20)

Function log2
Code:
Copy      Help
;/
function^ ^value

;Calculates base 2 logarithm. Ie power to which must be raised 2 to get value.
;For natural logarithm, instead use log. For base 10 - log10.


ret log(value)/log(2)


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)