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.

filter_ladder.h 975B

1234567891011121314151617181920212223242526272829303132333435363738
  1. //-----------------------------------------------------------
  2. // Huovilainen New Moog (HNM) model as per CMJ jun 2006
  3. // Implemented as Teensy Audio Library compatible object
  4. // Richard van Hoesel, Feb. 9 2021
  5. // v.1.01 now includes FC "CV" modulation input
  6. // please retain this header if you use this code.
  7. //-----------------------------------------------------------
  8. // https://forum.pjrc.com/threads/60488?p=269609&viewfull=1#post269609
  9. #ifndef filter_ladder_h_
  10. #define filter_ladder_h_
  11. #include "Arduino.h"
  12. #include "AudioStream.h"
  13. class HNMoog : public AudioStream
  14. {
  15. public:
  16. HNMoog() : AudioStream(2,inputQueueArray) {};
  17. void SetCutoff(float FC);
  18. void SetResonance(float reson);
  19. float LPF(float s, int i);
  20. void compute_coeffs(float fc);
  21. virtual void update(void);
  22. private:
  23. float alpha = 1.0;
  24. float beta[4] = {0};
  25. float z0[4] = {0};
  26. float z1[4] = {0};
  27. float K;
  28. float Fbase = 1000;
  29. float overdrive = 1.0;
  30. audio_block_t *inputQueueArray[2];
  31. };
  32. #endif