Extra "ports" of juce-based plugins using the distrho build system
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
883B

  1. --[[
  2. name: Badass Distortion
  3. description: The one from the website
  4. author: osar.fr
  5. --]]
  6. require "include/protoplug"
  7. local cbFilter = require "include/pac/cookbook filters"
  8. local power
  9. local function dist (x)
  10. if x<0 then return -1*math.pow (-1*x,power) end
  11. return math.pow (x,power)
  12. end
  13. stereoFx.init ()
  14. function stereoFx.Channel:init ()
  15. -- create per-channel fields (filters)
  16. self.low = cbFilter {type = "lp"; f = 100; gain = 0; Q = 0.3}
  17. self.high = cbFilter {type = "hp"; f = 50; gain = 0; Q = 0.3}
  18. end
  19. function stereoFx.Channel:processBlock (samples, smax)
  20. for i = 0, smax do
  21. local s = dist (self.high.process (samples[i]))
  22. samples[i] = s + self.low.process (samples[i])*2
  23. end
  24. end
  25. params = plugin.manageParams {
  26. {
  27. name = "Power";
  28. min = 1;
  29. max = 0.01;
  30. changed = function (val) power = val end;
  31. };
  32. }