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.

77 lines
2.5KB

  1. #ifndef MODULE_TRIGSEQ_HPP
  2. #define MODULE_TRIGSEQ_HPP
  3. #include <string.h>
  4. #include <stdio.h>
  5. //#include "trowaSoft.hpp"
  6. #include "dsp/digital.hpp"
  7. #include "TSSequencerWidgetBase.hpp"
  8. #include "trowaSoftComponents.hpp"
  9. #include "trowaSoftUtilities.hpp"
  10. #include "TSSequencerModuleBase.hpp"
  11. #define trigSeq_GATE_ON_OUTPUT 10.0 // If gate is on, the value to output (port Voltage)
  12. #define trigSeq_GATE_OFF_OUTPUT 0.0 // If gate is off, the value to output (port Voltage)
  13. // Single instance to the trigSeq Models.
  14. // trigSeq (16-step) model
  15. extern Model* modelTrigSeq;
  16. // trigSeq (64-step) model
  17. extern Model* modelTrigSeq64;
  18. //===============================================================================
  19. //-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
  20. // trigSeq Module
  21. // trowaSoft pad / trigger sequencer.
  22. //-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
  23. //===============================================================================
  24. struct trigSeq : TSSequencerModuleBase
  25. {
  26. // Move these back to base
  27. //SchmittTrigger* gateTriggers;
  28. trigSeq(int numSteps, int numRows, int numCols) : TSSequencerModuleBase(numSteps, numRows, numCols, false)
  29. {
  30. gateTriggers = new SchmittTrigger[numSteps]; // maxSteps
  31. selectedOutputValueMode = VALUE_TRIGGER;
  32. lastOutputValueMode = selectedOutputValueMode;
  33. modeStrings[0] = "TRIG";
  34. modeStrings[1] = "RTRG";
  35. modeStrings[2] = "GATE";
  36. return;
  37. }
  38. trigSeq() : trigSeq(TROWA_SEQ_NUM_STEPS, TROWA_SEQ_STEP_NUM_ROWS, TROWA_SEQ_STEP_NUM_ROWS)
  39. {
  40. return;
  41. }
  42. ~trigSeq()
  43. {
  44. delete [] gateTriggers;
  45. gateTriggers = NULL;
  46. return;
  47. }
  48. void step() override;
  49. // Only randomize the current gate/trigger steps.
  50. void randomize() override;
  51. // Get the toggle step value
  52. float getToggleStepValue(int step, float val, int channel, int pattern) override;
  53. // Calculate a representation of all channels for this step
  54. float getPlayingStepValue(int step, int pattern) override;
  55. };
  56. //===============================================================================
  57. //-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
  58. // trigSeq64 Module
  59. // trowaSoft 64-step pad / trigger sequencer.
  60. //-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
  61. //===============================================================================
  62. struct trigSeq64 : trigSeq {
  63. trigSeq64() : trigSeq(N64_NUM_STEPS, N64_NUM_ROWS, N64_NUM_COLS)
  64. {
  65. return;
  66. }
  67. };
  68. #endif