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.

29 lines
597B

  1. #pragma once
  2. #include <cstdint>
  3. #define MAX_SLOTS 32
  4. #define BJORK_ERROR_TOO_MANY 1;
  5. namespace SynthDevKit {
  6. class Bjorklund {
  7. public:
  8. Bjorklund (uint8_t);
  9. void update (uint8_t, uint8_t);
  10. uint8_t stepValue ( );
  11. void reset ( );
  12. private:
  13. uint8_t steps[MAX_SLOTS];
  14. uint8_t currentStep;
  15. uint8_t numSteps;
  16. uint8_t numSlots;
  17. uint8_t _level;
  18. uint8_t _remainders[MAX_SLOTS * 2];
  19. uint8_t _divisor;
  20. uint8_t _step;
  21. uint8_t _count[MAX_SLOTS * 2];
  22. void computeResults ( );
  23. void buildString (int8_t);
  24. };
  25. }