smooth_parameters.glsl 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* Settings for smoothing functions and transformations commonly
  2. used to display FFT output.
  3. IMPORTANT: THESE VALUES CAN BE OVERRIDDEN IN MODULE CONFIG
  4. FILES, IF CHANGING VALUES HERE DOES NOT WORK, CHECK
  5. TO MAKE SURE THEY ARE NOT BEING SET ELSEWHERE.
  6. */
  7. /* The type of formula to use for weighting values when smoothing.
  8. Possible values:
  9. - circular heavily rounded points
  10. - sinusoidal rounded at both low and high weighted values
  11. like a sine wave
  12. - linear not rounded at all; linear distance
  13. */
  14. #define ROUND_FORMULA sinusoidal
  15. /* The sampling mode for processing raw FFT input:
  16. - average averages all the inputs in the sample range for
  17. a given point. Produces smooth output, but peaks
  18. are not well represented
  19. - maximum obtains the best value from the closest peak in
  20. the sample range. Very accurate peaks, but
  21. output is jagged and sporadic.
  22. - hybrid uses the results from both `average` and `maximum`
  23. with the weight provided in `SAMPLE_HYBRID_WEIGHT` */
  24. #define SAMPLE_MODE average
  25. /* Weight should be provided in the range (0, 1). Higher values favour
  26. averaged results. `hybrid` mode only. */
  27. #define SAMPLE_HYBRID_WEIGHT 0.65
  28. /* Factor used to scale frequencies. Lower values allows lower
  29. frequencies to occupy more space. */
  30. #define SAMPLE_SCALE 8
  31. /* The frequency range to sample. 1.0 would be the entire FFT output,
  32. and lower values reduce the displayed frequencies in a log-like
  33. scale. */
  34. #define SAMPLE_RANGE 0.9
  35. /* Factor for how to scale higher frequencies. Used in a linear equation
  36. which is multiplied by the result of the fft transformation. */
  37. #request setfftscale 10.2
  38. /* Cutoff for the bass end of the audio data when scaling frequencies.
  39. Higher values cause more of the bass frequencies to be skipped when
  40. scaling. */
  41. #request setfftcutoff 0.3
  42. /* How many frames to queue and run through the average function.
  43. Increasing this value will create latency between the audio and the
  44. animation, but will make for much smoother results. */
  45. #request setavgframes 6
  46. /* Whether to window frames ran through the average function (new & old
  47. frames are weighted less). This massively helps smoothing out
  48. spontaneous values in the animation. */
  49. #request setavgwindow true
  50. /* Gravity step, higher values means faster drops. The step is applied
  51. in a rate independant method like so:
  52. val -= (gravitystep) * (seconds per update) */
  53. #request setgravitystep 4.2
  54. /* Smoothing factor. Larger values mean more smoothing in the output,
  55. however high values can be expensive to compute. Values are in
  56. normalized width: [0.0, 1.0) */
  57. #request setsmoothfactor 0.025
  58. /* Whether to use a separate pass for audio data while smoothing. On
  59. most hardware, this will improve performance, but involves doing a
  60. separate render step for each audio texture and will add some driver
  61. (CPU) overhead. */
  62. #request setsmoothpass true