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.

48 lines
791B

  1. #include "SubmarineFree.hpp"
  2. struct XF_Correlator {
  3. static const int frameSize = 1024;
  4. float samples_a[frameSize];
  5. float samples_b[frameSize];
  6. int n = 0;
  7. int sp = 0;
  8. float covariance = 0;
  9. float sigma_a = 0;
  10. float sigma_b = 0;
  11. float sigma_a2 = 0;
  12. float sigma_b2 = 0;
  13. int schmitt = 0;
  14. float correlation = 0;
  15. int correlate(float, float);
  16. XF_Correlator() {};
  17. };
  18. struct XF_Controls {
  19. int a;
  20. int ar;
  21. int b;
  22. int br;
  23. int fader;
  24. int cv;
  25. int out;
  26. int outr;
  27. int polar;
  28. int mode;
  29. int light1;
  30. int light2;
  31. int light3;
  32. XF_Correlator *correlator;
  33. };
  34. struct XF_LightKnob : LargeKnob<NarrowKnob<LightKnob>> {
  35. int cv;
  36. int link;
  37. void step() override;
  38. };
  39. struct XF : Module {
  40. XF(int p, int i, int o, int l) : Module(p, i, o, l) {}
  41. void crossFade(XF_Controls *controls);
  42. };