Audio plugin host https://kx.studio/carla
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.

comb.cpp 721B

11 years ago
11 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Comb filter implementation
  2. //
  3. // Written by Jezar at Dreampoint, June 2000
  4. // http://www.dreampoint.co.uk
  5. // This code is public domain
  6. #include "comb.hpp"
  7. comb::comb()
  8. {
  9. feedback = 0.0f;
  10. filterstore = 0.0f;
  11. damp1 = 0.0f;
  12. damp2 = 0.0f;
  13. buffer = 0;
  14. bufsize = 0;
  15. bufidx = 0;
  16. }
  17. void comb::setbuffer(float *buf, int size)
  18. {
  19. buffer = buf;
  20. bufsize = size;
  21. }
  22. void comb::mute()
  23. {
  24. for (int i=0; i<bufsize; i++)
  25. buffer[i]=0;
  26. }
  27. void comb::setdamp(float val)
  28. {
  29. damp1 = val;
  30. damp2 = 1-val;
  31. }
  32. float comb::getdamp()
  33. {
  34. return damp1;
  35. }
  36. void comb::setfeedback(float val)
  37. {
  38. feedback = val;
  39. }
  40. float comb::getfeedback()
  41. {
  42. return feedback;
  43. }
  44. // ends