help_3.bin 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. Functions available from code:
  2. abs(value)
  3. = returns the absolute value of 'value'
  4. sin(value)
  5. = returns the sine of the radian angle 'value'
  6. cos(value)
  7. = returns the cosine of the radian angle 'value'
  8. tan(value)
  9. = returns the tangent of the radian angle 'value'
  10. asin(value)
  11. = returns the arcsine (in radians) of 'value'
  12. acos(value)
  13. = returns the arccosine (in radians) of 'value'
  14. atan(value)
  15. = returns the arctangent (in radians) of 'value'
  16. atan2(value,value2)
  17. = returns the arctangent (in radians) of 'value'/'value2'
  18. sqr(value)
  19. = returns the square of 'value'
  20. sqrt(value)
  21. = returns the square root of 'value'
  22. invsqrt(value)
  23. = returns the reciprocal of the square root of 'value' (1/sqrt(value))
  24. (uses a fast approximation, may not always = 1/sqrt(value) :)
  25. pow(value,value2)
  26. = returns 'value' to the power of 'value2'
  27. exp(value)
  28. = returns e to the power of 'value'
  29. log(value)
  30. = returns the log in base e of 'value'
  31. log10(value)
  32. = returns the log in base 10 of 'value'
  33. floor(value)
  34. = returns the largest integer less than or equal to 'value'
  35. ceil(value)
  36. = returns the smallest integer greater than or equal to 'value'
  37. "sign(value)
  38. = returns the sign of 'value' (-1.0 or 1.0, or 0.0 or -0.0 for 0.0 or -0.0)
  39. "min(value,value2)
  40. = returns the smallest of 'value' and 'value2'
  41. "max(var,var2)
  42. = returns the greatest of 'value' and 'value2'
  43. "sigmoid(value,value2)
  44. = returns sigmoid function value of x='value' ('value2'=constraint)
  45. "rand(value)
  46. = returns a random integer between 0 and 'value'
  47. "band(value,value2)
  48. = returns a boolean AND of 'value' and 'value2'
  49. "bor(value,value2)
  50. = returns a boolean OR of 'value' and 'value2'
  51. "bnot(value)
  52. = returns a boolean NOT of 'value'
  53. "if(condition,valtrue,valfalse)
  54. = returns 'valtrue' if 'condition' is nonzero, returns 'valfalse' otherwise.
  55. new in AVS 2.8+: only one of valtrue/valfalse is evaluated, depending on condition
  56. "assign(dest, source)
  57. = if 'dest' is a variable, assigns the value of 'source' to it. returns the value of 'source'.
  58. a little trick: assign(if(v,a,b),1.0); is like if V is true, a=1.0, otherwise b=1.0. :)
  59. "exec2(parm1, parm2)
  60. = evaluates parm1, then parm2, and returns the value of parm2.
  61. "equal(value,value2)
  62. = returns 1.0 if 'value' is equal to 'value2', otherwise returns 0.0
  63. "above(value,value2)
  64. = returns 1.0 if 'value' is greater than 'value2', otherwise returns 0.0
  65. "below(value,value2)
  66. = returns 1.0 if 'value' is less than 'value2', otherwise returns 0.0
  67. "getosc(band,width,channel)
  68. = returns waveform data centered at 'band', (0..1), sampled 'width' (0..1) wide.
  69. 'channel' can be: 0=center, 1=left, 2=right. return value is (-1..1)
  70. "getspec(band,width,channel)
  71. = returns spectrum data centered at 'band', (0..1), sampled 'width' (0..1) wide.
  72. 'channel' can be: 0=center, 1=left, 2=right. return value is (0..1)
  73. gettime(start_time)
  74. = returns time in seconds since start_time (start_time can be 0 for time since boot)
  75. (start_time can be -1.0 for current play time in seconds
  76. (start_time can be -2.0 for current play length in seconds
  77. getkbmouse(which_parm)
  78. = returns information about the location and state of the keyboard or mouse
  79. which_parm = 1: mouse X position (-1..1 is onscreen)
  80. which_parm = 2: mouse Y position (-1..1 is onscreen)
  81. which_parm = 3: mouse left button state (0 up, 1 down)
  82. which_parm = 4: mouse right button state (0 up, 1 down)
  83. which_parm = 5: mouse middle button state (0 up, 1 down)
  84. which_parm > 5: (GetAsyncKeyState(which_parm)&0x8000)?1:0
  85. megabuf(index)
  86. = can be used to get or set an item from the 1 million item temp buffer
  87. to get, use: val=megabuf(index);
  88. to set, use: assign(megabuf(index),val);
  89. gmegabuf(index)
  90. = can be used to get or set an item from the global 1 million item buffer
  91. to get, use: val=gmegabuf(index);
  92. to set, use: assign(gmegabuf(index),val);
  93. loop(count, statement)
  94. = executes <statement> <count> times. count is evaluated once and clamped
  95. to 0..4096. best used with exec2() and exec3() and assign(). Note that
  96. the return value of loop() is undefined and should not be used.