No Description
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.h 557B

1234567891011121314151617181920
  1. #ifndef FILTER_H_
  2. #define FILTER_H_
  3. struct Filter {
  4. // public
  5. float cutoff, resonance;
  6. // private
  7. float resonance_input, stage_1, stage_2, stage_3, stage_4;
  8. float cutoff_calc, resonance_calc;
  9. int last_calc;
  10. float b0, b1, b2, b3, b4; //filter buffers (beware denormals!)
  11. };
  12. void filter_init(struct Filter *filter, float cutoff, float q);
  13. void filter_set_cutoff(struct Filter *filter, float cutoff);
  14. void filter_set_resonance(struct Filter *filter, float resonance);
  15. float filter_sample(struct Filter *filter, float input);
  16. #endif /* FILTER_H_ */