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.

341 lines
7.2KB

  1. #include "rack.hpp"
  2. #include "Biquad.h"
  3. #include "VAStateVariableFilter.h"
  4. using namespace rack;
  5. ////////////////////
  6. // module widgets
  7. ////////////////////
  8. RACK_PLUGIN_DECLARE(Autodafe);
  9. #ifndef RACK_PLUGIN_SHARED
  10. #define plugin "Autodafe"
  11. #endif // RACK_PLUGIN_SHARED
  12. namespace rack_plugin_Autodafe {
  13. /////////////////////////////
  14. // CUSTOM KNOBS & GRAPHICS //
  15. /////////////////////////////
  16. struct AutodafeKnobRed : SVGKnob {
  17. AutodafeKnobRed() {
  18. box.size = Vec(20, 20);
  19. minAngle = -0.75*M_PI;
  20. maxAngle = 0.75*M_PI;
  21. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobRed.svg")));
  22. }
  23. };
  24. struct AutodafeKnobRedBig : SVGKnob {
  25. AutodafeKnobRedBig() {
  26. box.size = Vec(35, 35);
  27. minAngle = -0.75*M_PI;
  28. maxAngle = 0.75*M_PI;
  29. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobRedBig.svg")));
  30. }
  31. };
  32. struct AutodafeKnobBlue : SVGKnob {
  33. AutodafeKnobBlue() {
  34. box.size = Vec(20, 20);
  35. minAngle = -0.75*M_PI;
  36. maxAngle = 0.75*M_PI;
  37. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobBlue.svg")));
  38. }
  39. };
  40. struct AutodafeKnobBlueBig : SVGKnob {
  41. AutodafeKnobBlueBig() {
  42. box.size = Vec(35, 35);
  43. minAngle = -0.75*M_PI;
  44. maxAngle = 0.75*M_PI;
  45. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobBlueBig.svg")));
  46. }
  47. };
  48. struct AutodafeKnobGreen : SVGKnob {
  49. AutodafeKnobGreen() {
  50. box.size = Vec(20, 20);
  51. minAngle = -0.75*M_PI;
  52. maxAngle = 0.75*M_PI;
  53. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobGreen.svg")));
  54. }
  55. };
  56. struct AutodafeKnobGreenBig : SVGKnob {
  57. AutodafeKnobGreenBig() {
  58. box.size = Vec(35, 35);
  59. minAngle = -0.75*M_PI;
  60. maxAngle = 0.75*M_PI;
  61. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobGreenBig.svg")));
  62. }
  63. };
  64. struct AutodafeKnobPurple : SVGKnob {
  65. AutodafeKnobPurple() {
  66. box.size = Vec(20, 20);
  67. minAngle = -0.75*M_PI;
  68. maxAngle = 0.75*M_PI;
  69. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobPurple.svg")));
  70. }
  71. };
  72. struct AutodafeKnobPurpleSmall : SVGKnob {
  73. AutodafeKnobPurpleSmall() {
  74. box.size = Vec(15, 15);
  75. minAngle = -0.75*M_PI;
  76. maxAngle = 0.75*M_PI;
  77. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobPurpleSmall.svg")));
  78. }
  79. };
  80. struct AutodafeKnobPurpleBig : SVGKnob {
  81. AutodafeKnobPurpleBig() {
  82. box.size = Vec(35, 35);
  83. minAngle = -0.75*M_PI;
  84. maxAngle = 0.75*M_PI;
  85. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobPurpleBig.svg")));
  86. }
  87. };
  88. struct AutodafeKnobWhite : SVGKnob {
  89. AutodafeKnobWhite() {
  90. box.size = Vec(20, 20);
  91. minAngle = -0.75*M_PI;
  92. maxAngle = 0.75*M_PI;
  93. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobWhite.svg")));
  94. }
  95. };
  96. struct AutodafeKnobWhiteBig : SVGKnob {
  97. AutodafeKnobWhiteBig() {
  98. box.size = Vec(35, 35);
  99. minAngle = -0.75*M_PI;
  100. maxAngle = 0.75*M_PI;
  101. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobWhiteBig.svg")));
  102. }
  103. };
  104. struct AutodafeKnobBrown : SVGKnob {
  105. AutodafeKnobBrown() {
  106. box.size = Vec(20, 20);
  107. minAngle = -0.75*M_PI;
  108. maxAngle = 0.75*M_PI;
  109. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobBrown.svg")));
  110. }
  111. };
  112. struct AutodafeKnobBrownBig : SVGKnob {
  113. AutodafeKnobBrownBig() {
  114. box.size = Vec(35, 35);
  115. minAngle = -0.75*M_PI;
  116. maxAngle = 0.75*M_PI;
  117. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobBrownBig.svg")));
  118. }
  119. };
  120. struct AutodafeKnobBlack : SVGKnob {
  121. AutodafeKnobBlack() {
  122. box.size = Vec(20, 20);
  123. minAngle = -0.75*M_PI;
  124. maxAngle = 0.75*M_PI;
  125. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobBlack.svg")));
  126. }
  127. };
  128. struct AutodafeKnobBlackSmall : SVGKnob {
  129. AutodafeKnobBlackSmall() {
  130. box.size = Vec(15, 15);
  131. minAngle = -0.75*M_PI;
  132. maxAngle = 0.75*M_PI;
  133. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobBlackSmall.svg")));
  134. }
  135. };
  136. struct AutodafeKnobBlackBig : SVGKnob {
  137. AutodafeKnobBlackBig() {
  138. box.size = Vec(35, 35);
  139. minAngle = -0.75*M_PI;
  140. maxAngle = 0.75*M_PI;
  141. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobBlackBig.svg")));
  142. }
  143. };
  144. struct AutodafeKnobOrange : SVGKnob {
  145. AutodafeKnobOrange() {
  146. box.size = Vec(20, 20);
  147. minAngle = -0.75*M_PI;
  148. maxAngle = 0.75*M_PI;
  149. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobOrange.svg")));
  150. }
  151. };
  152. struct AutodafeKnobOrangeBig : SVGKnob {
  153. AutodafeKnobOrangeBig() {
  154. box.size = Vec(35, 35);
  155. minAngle = -0.75*M_PI;
  156. maxAngle = 0.75*M_PI;
  157. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobOrangeBig.svg")));
  158. }
  159. };
  160. struct AutodafeKnobYellow : SVGKnob {
  161. AutodafeKnobYellow() {
  162. box.size = Vec(20, 20);
  163. minAngle = -0.75*M_PI;
  164. maxAngle = 0.75*M_PI;
  165. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobYellow.svg")));
  166. }
  167. };
  168. struct AutodafeKnobYellowBig : SVGKnob {
  169. AutodafeKnobYellowBig() {
  170. box.size = Vec(35, 35);
  171. minAngle = -0.75*M_PI;
  172. maxAngle = 0.75*M_PI;
  173. setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobYellowBig.svg")));
  174. }
  175. };
  176. struct AutodafeButton : SVGSwitch, MomentarySwitch {
  177. AutodafeButton() {
  178. addFrame(SVG::load(assetPlugin(plugin, "res/AutodafeButton.svg")));
  179. //SVG::load("res/AutodafeButton.svg");
  180. box.size = Vec(20,20);
  181. }
  182. };
  183. struct BtnUp : SVGSwitch, MomentarySwitch {
  184. BtnUp() {
  185. addFrame(SVG::load(assetPlugin(plugin, "res/BtnUp.svg")));
  186. sw->wrap();
  187. box.size = sw->box.size;
  188. }
  189. };
  190. struct BtnDwn : SVGSwitch, MomentarySwitch {
  191. BtnDwn() {
  192. addFrame(SVG::load(assetPlugin(plugin, "res/BtnDwn.svg")));
  193. sw->wrap();
  194. box.size = sw->box.size;
  195. }
  196. };
  197. struct BtnTrigSequencer : SVGSwitch, MomentarySwitch {
  198. BtnTrigSequencer() {
  199. addFrame(SVG::load(assetPlugin(plugin, "res/BtnTrigSequencer.svg")));
  200. sw->wrap();
  201. box.size = sw->box.size;
  202. }
  203. };
  204. struct BtnTrigSequencerSmall : SVGSwitch, MomentarySwitch {
  205. BtnTrigSequencerSmall() {
  206. addFrame(SVG::load(assetPlugin(plugin, "res/BtnTrigSequencerSmall.svg")));
  207. sw->wrap();
  208. box.size = sw->box.size;
  209. }
  210. };
  211. struct WhiteKey : SVGSwitch, MomentarySwitch {
  212. WhiteKey() {
  213. addFrame(SVG::load(assetPlugin(plugin, "res/WhiteKey.svg")));
  214. sw->wrap();
  215. box.size = sw->box.size;
  216. }
  217. };
  218. struct BlackKey : SVGSwitch, MomentarySwitch {
  219. BlackKey() {
  220. addFrame(SVG::load(assetPlugin(plugin, "res/BlackKey.svg")));
  221. sw->wrap();
  222. box.size = sw->box.size;
  223. }
  224. };
  225. ///////////////////////////////////
  226. /// WIDGETS ///
  227. ///////////////////////////////////
  228. //// EFFECTS
  229. struct FlangerFxWidget : ModuleWidget{
  230. FlangerFxWidget();
  231. };
  232. struct EchoFxWidget : ModuleWidget{
  233. EchoFxWidget();
  234. };
  235. struct PitchShifterFxWidget : ModuleWidget{
  236. PitchShifterFxWidget();
  237. };
  238. struct CompressorWidget : ModuleWidget{
  239. CompressorWidget();
  240. };
  241. struct KnobDemoWidget : ModuleWidget{
  242. KnobDemoWidget();
  243. };
  244. ///OSCILLATORS
  245. struct WavesModelWidget : ModuleWidget{
  246. WavesModelWidget();
  247. };
  248. struct SquareVCOModelWidget : ModuleWidget{
  249. SquareVCOModelWidget();
  250. };
  251. struct AMVCOModelWidget : ModuleWidget{
  252. AMVCOModelWidget();
  253. };
  254. struct FMVCOModelWidget : ModuleWidget{
  255. FMVCOModelWidget();
  256. };
  257. struct CosineVCOModelWidget : ModuleWidget{
  258. CosineVCOModelWidget();
  259. };
  260. struct OPERATORModelWidget : ModuleWidget{
  261. OPERATORModelWidget();
  262. };
  263. struct DWOVCOModelWidget : ModuleWidget{
  264. DWOVCOModelWidget();
  265. };
  266. struct SamplerModelWidget : ModuleWidget{
  267. SamplerModelWidget();
  268. };
  269. struct DrumSamplerWidget : ModuleWidget{
  270. DrumSamplerWidget();
  271. Menu *createContextMenu() override;
  272. };
  273. } // namespace rack_plugin_Autodafe
  274. using namespace rack_plugin_Autodafe;