computerscare-vcv-modules

computerscare modules for VCV Rack
Log | Files | Refs

commit 6644509c5977dd6c7788a2fd3ed30dcef713c8c3
parent 001f7737e4f4a4582def3abdc03c85297414442d
Author: Adam M <aemalone@gmail.com>
Date:   Sun, 27 Dec 2020 17:20:08 -0600

select mode via right click on horse, visual tweaks remove shadows

Diffstat:
Mres/ComputerscareGolyPeneratorPanel.svg | 30++++++++++++++++++++++++++----
Mres/ComputerscareHorseADoodleDooPanel.svg | 64++++++++++++++++++++++++++++++++++++++++------------------------
Msrc/Computerscare.hpp | 11+++++++++++
Msrc/ComputerscareGolyPenerator.cpp | 14++++++++------
Msrc/ComputerscareHorseADoodleDoo.cpp | 119+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------
Msrc/ComputerscarePolyModule.hpp | 2++
Msrc/MenuParams.hpp | 2+-
7 files changed, 190 insertions(+), 52 deletions(-)

diff --git a/res/ComputerscareGolyPeneratorPanel.svg b/res/ComputerscareGolyPeneratorPanel.svg @@ -24,11 +24,11 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="11.313709" - inkscape:cx="30.33601" - inkscape:cy="360.7768" + inkscape:zoom="5.6568545" + inkscape:cx="72.70835" + inkscape:cy="327.29794" inkscape:document-units="mm" - inkscape:current-layer="g1669" + inkscape:current-layer="text924" showgrid="false" units="px" inkscape:snap-bbox="true" @@ -492,5 +492,27 @@ style="stroke-width:0.070568" id="path1101" /> </g> + <g + aria-label="mode" + id="text924" + style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583" + transform="matrix(0.20905579,0,0,0.2642855,1.1160675,206.12643)"> + <path + d="M 8.8881349,285.60608 H 7.9166211 v -4.36511 q 0,-0.49417 -0.036173,-0.95401 -0.031006,-0.45985 -0.1395259,-0.73439 -0.1188555,-0.29513 -0.3410634,-0.44611 -0.222208,-0.151 -0.6407857,-0.151 -0.4082426,0 -0.8164851,0.27453 -0.4082425,0.26767 -0.816485,0.68635 0.015503,0.15785 0.025838,0.37062 0.010335,0.2059 0.010335,0.4118 v 4.90732 H 4.1907622 v -4.36511 q 0,-0.5079 -0.036173,-0.96088 -0.031006,-0.45985 -0.139526,-0.73439 -0.1188554,-0.29511 -0.3410633,-0.43924 -0.222208,-0.151 -0.6407857,-0.151 -0.3979073,0 -0.8009822,0.26081 -0.3979073,0.26081 -0.7958145,0.66575 v 5.72406 H 0.46490325 v -7.66641 H 1.4364171 v 0.85107 q 0.4547511,-0.50103 0.9043347,-0.78243 0.4547511,-0.2814 0.9663462,-0.2814 0.5891094,0 0.9973519,0.32944 0.4134102,0.32945 0.6149476,0.91283 0.5891095,-0.65888 1.0748664,-0.94715 0.4857569,-0.29512 1.038693,-0.29512 0.9508433,0 1.4004268,0.7687 0.4547512,0.76183 0.4547512,2.13451 z" + style="stroke-width:0.30492" + id="path926" /> + <path + d="m 15.678397,280.72029 q 0,1.41077 -0.723468,2.22725 -0.723468,0.81649 -1.93786,0.81649 -1.224728,0 -1.948195,-0.81649 -0.7183,-0.81648 -0.7183,-2.22725 0,-1.41076 0.7183,-2.22724 0.723467,-0.82166 1.948195,-0.82166 1.214392,0 1.93786,0.82166 0.723468,0.81648 0.723468,2.22724 z m -1.00252,0 q 0,-1.12137 -0.439248,-1.66397 -0.439248,-0.54777 -1.21956,-0.54777 -0.790647,0 -1.229895,0.54777 -0.434081,0.5426 -0.434081,1.66397 0,1.0852 0.439248,1.64848 0.439249,0.5581 1.224728,0.5581 0.775144,0 1.214392,-0.55294 0.444416,-0.5581 0.444416,-1.65364 z" + style="stroke-width:0.264583" + id="path928" /> + <path + d="m 21.360137,285.78669 -0.966678,-0.0766 0.07617,-0.6016 q -0.462068,0.32693 -0.939947,0.49162 -0.477878,0.16469 -1.007495,0.12273 -1.028379,-0.0815 -1.53486,-0.92141 -0.501339,-0.83951 -0.323598,-2.24325 0.09245,-0.73015 0.370394,-1.28461 0.283084,-0.55404 0.688659,-0.92701 0.399129,-0.36308 0.887943,-0.53209 0.493956,-0.1686 0.99272,-0.12909 0.452487,0.0359 0.789764,0.16126 0.337932,0.12024 0.698182,0.35134 l 0.315113,-2.48868 0.966677,0.0766 z m -0.787636,-1.49061 0.41733,-3.29596 q -0.368649,-0.20579 -0.668698,-0.29708 -0.300048,-0.0913 -0.665123,-0.12023 -0.81242,-0.0644 -1.336523,0.46539 -0.524104,0.52976 -0.655618,1.56842 -0.129562,1.02324 0.152378,1.5857 0.28259,0.55732 1.053875,0.61843 0.411352,0.0326 0.855775,-0.11398 0.445073,-0.1517 0.846608,-0.41072 z" + style="stroke-width:0.264583" + id="path930" /> + <path + d="m 28.612966,282.82073 h -4.252957 q 0,0.53226 0.160197,0.93017 0.160196,0.39274 0.439248,0.64595 0.268717,0.24805 0.635618,0.37207 0.372069,0.12403 0.816485,0.12403 0.58911,0 1.183387,-0.23255 0.599444,-0.23771 0.852658,-0.46508 h 0.05168 v 1.05936 q -0.490924,0.20671 -1.002519,0.34623 -0.511595,0.13953 -1.074867,0.13953 -1.4366,0 -2.24275,-0.77515 -0.806149,-0.78031 -0.806149,-2.21174 0,-1.41593 0.769976,-2.24792 0.775144,-0.83199 2.036045,-0.83199 1.167884,0 1.798334,0.68213 0.635618,0.68213 0.635618,1.93786 z m -0.945676,-0.74414 q -0.0052,-0.76481 -0.387572,-1.18339 -0.377236,-0.41857 -1.15238,-0.41857 -0.780312,0 -1.245398,0.45991 -0.459919,0.45992 -0.521931,1.14205 z" + style="stroke-width:0.264583" + id="path932" /> + </g> </g> </svg> diff --git a/res/ComputerscareHorseADoodleDooPanel.svg b/res/ComputerscareHorseADoodleDooPanel.svg @@ -1,6 +1,4 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" @@ -14,7 +12,7 @@ viewBox="0 0 23.8125 100.54167" version="1.1" id="svg8" - inkscape:version="0.92.2 5c3e80d, 2017-08-06" + inkscape:version="1.0.1 (c497b03c, 2020-09-10)" sodipodi:docname="ComputerscareHorseADoodleDooPanel.svg" style="enable-background:new"> <defs @@ -27,7 +25,7 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="4.0000003" - inkscape:cx="77.131894" + inkscape:cx="17.256898" inkscape:cy="212.5269" inkscape:document-units="mm" inkscape:current-layer="g1669" @@ -38,13 +36,14 @@ inkscape:bbox-nodes="true" inkscape:snap-bbox-edge-midpoints="true" inkscape:window-width="1440" - inkscape:window-height="856" + inkscape:window-height="855" inkscape:window-x="0" - inkscape:window-y="0" + inkscape:window-y="23" inkscape:window-maximized="0" inkscape:snap-global="false" showguides="false" - inkscape:lockguides="false" /> + inkscape:lockguides="false" + inkscape:document-rotation="0" /> <metadata id="metadata5"> <rdf:RDF> @@ -70,7 +69,7 @@ inkscape:connector-curvature="0" /> <text xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583" x="8.2147436" y="295.57718" id="text1490" @@ -79,22 +78,22 @@ id="tspan1488" x="8.2147436" y="295.57718" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222223px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;stroke-width:0.26458332">computerscare</tspan></text> + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;stroke-width:0.264583">computerscare</tspan></text> <text transform="rotate(-5.9989835)" id="text1494" y="288.0314" x="-28.710276" - style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583" xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222223px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;stroke-width:0.26458332" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;stroke-width:0.264583" y="288.0314" x="-28.710276" id="tspan1492" sodipodi:role="line">trg</tspan></text> <text xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583" x="20.711658" y="288.87244" id="text1498" @@ -103,15 +102,15 @@ id="tspan1496" x="20.711658" y="288.87244" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222223px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;stroke-width:0.26458332">in</tspan></text> + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;stroke-width:0.264583">in</tspan></text> <text transform="rotate(0.49746114)" id="text1521" y="289.16214" x="20.314623" - style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583" xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;stroke-width:0.26458332" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;stroke-width:0.264583" y="289.16214" x="20.314623" id="tspan1519" @@ -121,9 +120,9 @@ id="text1645" y="204.61243" x="-10.296249" - style="font-style:normal;font-weight:normal;font-size:10.74719143px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26867977" + style="font-style:normal;font-weight:normal;font-size:10.7472px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26868" xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.01535606px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;stroke-width:0.26867977" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.01536px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;stroke-width:0.26868" y="204.61243" x="-10.296249" id="tspan1643" @@ -144,6 +143,28 @@ d="m 0.11070997,216.17839 0.19028788,79.88502 14.84245615,-0.18709 0.570864,-98.78055 -15.41332015,0.18709 z" id="path1130" inkscape:connector-curvature="0" /> + <g + aria-label="mode" + transform="matrix(0.92443226,0,0,1.081745,0.39687497,-0.13229166)" + id="text1836" + style="font-style:normal;font-weight:normal;font-size:2.83949px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.0709873"> + <path + d="m 9.4818938,240.52894 -0.2393317,0.0412 -0.2196779,-0.9308 q -0.024863,-0.10535 -0.056932,-0.2019 -0.030778,-0.0967 -0.071328,-0.15066 -0.044133,-0.0579 -0.106461,-0.0806 -0.062329,-0.0227 -0.1654454,-0.005 -0.1005702,0.0173 -0.1873057,0.0933 -0.087106,0.0744 -0.1666023,0.18101 0.011758,0.033 0.025009,0.0779 0.012903,0.0435 0.023268,0.0874 l 0.2469655,1.04643 -0.2393128,0.0412 -0.2196779,-0.93081 q -0.025559,-0.1083 -0.057275,-0.20335 -0.03078,-0.0967 -0.071332,-0.15068 -0.044133,-0.0579 -0.106115,-0.0791 -0.062329,-0.0227 -0.1654454,-0.005 -0.098024,0.0169 -0.1842037,0.0896 -0.084907,0.0725 -0.1625443,0.17576 l 0.2880671,1.22058 -0.2393223,0.0412 -0.3858701,-1.63499 0.2393317,-0.0413 0.04283,0.18147 q 0.086815,-0.12613 0.1834065,-0.20523 0.097869,-0.0793 0.2239001,-0.10103 0.1451266,-0.025 0.2622846,0.0279 0.118431,0.0527 0.1974309,0.16854 0.1119672,-0.16551 0.2171275,-0.2476 0.1048132,-0.0836 0.2410286,-0.10704 0.2342394,-0.0404 0.383678,0.10445 0.1503668,0.14314 0.21945,0.43586 z" + style="stroke-width:0.0712934" + id="path1838" /> + <path + d="m 11.126373,239.95104 q 0,0.3785 -0.194106,0.59756 -0.194106,0.21907 -0.519926,0.21907 -0.328594,0 -0.5226994,-0.21907 -0.1927193,-0.21906 -0.1927193,-0.59756 0,-0.37851 0.1927193,-0.59757 0.1941054,-0.22045 0.5226994,-0.22045 0.32582,0 0.519926,0.22045 0.194106,0.21906 0.194106,0.59757 z m -0.268976,0 q 0,-0.30087 -0.117849,-0.44645 -0.11785,-0.14696 -0.327207,-0.14696 -0.21213,0 -0.32998,0.14696 -0.1164635,0.14558 -0.1164635,0.44645 0,0.29115 0.1178495,0.44228 0.11785,0.14974 0.328594,0.14974 0.20797,0 0.32582,-0.14835 0.119236,-0.14974 0.119236,-0.44367 z" + style="stroke-width:0.0709873" + id="path1840" /> + <path + d="m 12.787363,240.71872 h -0.260656 v -0.18476 q -0.112304,0.11047 -0.234313,0.17211 -0.12201,0.0616 -0.264816,0.0616 -0.277294,0 -0.440897,-0.24319 -0.162217,-0.24318 -0.162217,-0.67427 0,-0.22424 0.05546,-0.39952 0.05685,-0.17529 0.152512,-0.29845 0.09428,-0.12001 0.219062,-0.18318 0.126169,-0.0632 0.260657,-0.0632 0.122009,0 0.216289,0.03 0.09428,0.0285 0.198265,0.09 v -0.76429 h 0.260656 z m -0.260656,-0.43426 v -1.01221 q -0.105372,-0.0537 -0.18856,-0.0743 -0.08319,-0.0205 -0.181627,-0.0205 -0.219063,0 -0.341072,0.1737 -0.122009,0.1737 -0.122009,0.49268 0,0.31425 0.09428,0.47847 0.09428,0.16265 0.30225,0.16265 0.110918,0 0.224608,-0.0552 0.113691,-0.0568 0.21213,-0.14527 z" + style="stroke-width:0.0757586" + id="path1842" /> + <path + d="m 14.596706,239.4882 h -1.141064 q 0,0.1428 0.04298,0.24956 0.04298,0.10537 0.11785,0.17331 0.0721,0.0666 0.170536,0.0998 0.09983,0.0333 0.219062,0.0333 0.158058,0 0.317502,-0.0624 0.16083,-0.0638 0.228767,-0.12478 h 0.01387 v 0.28423 q -0.131714,0.0554 -0.268975,0.0929 -0.13726,0.0374 -0.288386,0.0374 -0.385438,0 -0.601728,-0.20797 -0.216289,-0.20935 -0.216289,-0.59341 0,-0.37989 0.206584,-0.60311 0.207971,-0.22322 0.546269,-0.22322 0.313342,0 0.482492,0.18301 0.170535,0.18302 0.170535,0.51993 z m -0.253723,-0.19965 q -0.0014,-0.2052 -0.103986,-0.3175 -0.101212,-0.11231 -0.309182,-0.11231 -0.209357,0 -0.33414,0.1234 -0.123395,0.12339 -0.140033,0.30641 z" + style="stroke-width:0.0709873" + id="path1844" /> + </g> <rect style="fill:#fcfcfc;fill-opacity:1;stroke:#666666;stroke-width:0.21803042;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" id="rect4821" @@ -598,15 +619,10 @@ </g> <text xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583" x="-12.722029" y="251.53745" - id="text958"><tspan - sodipodi:role="line" - id="tspan956" - x="-12.722029" - y="260.90121" - style="stroke-width:0.26458332" /></text> + id="text958" /> <g aria-label="density" transform="scale(0.98633055,1.0138589)" diff --git a/src/Computerscare.hpp b/src/Computerscare.hpp @@ -376,15 +376,26 @@ struct SmallKnob : RoundKnob { }; struct ScrambleKnob : RoundKnob { ScrambleKnob() { + shadow->opacity = 0.f; setSvg(APP->window->loadSvg(asset::plugin(pluginInstance, "res/computerscare-scramble-knob.svg"))); } }; struct ScrambleSnapKnob : RoundKnob { ScrambleSnapKnob() { snap=true; + shadow->opacity = 0.f; setSvg(APP->window->loadSvg(asset::plugin(pluginInstance, "res/computerscare-scramble-knob.svg"))); } }; +struct ScrambleSnapKnobNoRandom : RoundKnob { + ScrambleSnapKnobNoRandom() { + snap=true; + shadow->opacity = 0.f; + setSvg(APP->window->loadSvg(asset::plugin(pluginInstance, "res/computerscare-scramble-knob.svg"))); + } + void randomize() override { return; } +}; + struct SmallSnapKnob : RoundBlackSnapKnob { //bool visible = true; diff --git a/src/ComputerscareGolyPenerator.cpp b/src/ComputerscareGolyPenerator.cpp @@ -13,7 +13,9 @@ struct ComputerscareGolyPenerator; */ const std::string GolyPeneratorAvailableAlgorithmsArr[5] = {"Linear", "Sigmoid","Hump","Sinusoid","Pseudo-Random"}; -struct EnumParamQuantity : ParamQuantity { + +//template <const std::string& options> +struct GolyAlgoParamQuantity : ParamQuantity { std::string getDisplayValueString() override { int val = getValue(); return GolyPeneratorAvailableAlgorithmsArr[val]; @@ -54,7 +56,7 @@ struct ComputerscareGolyPenerator : ComputerscarePolyModule { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); - configParam<EnumParamQuantity>(ALGORITHM , 0.f, 4.f, 0.f, "Algorithm"); + configParam<GolyAlgoParamQuantity>(ALGORITHM , 0.f, 4.f, 0.f, "Algorithm"); configParam(IN_OFFSET, -1.f, 1.f, 0.f, "Channel Center"); configParam(IN_SCALE, -2.f, 2.f, 1.f, "Channel Spread"); @@ -141,7 +143,7 @@ struct AlgorithmChildMenu : MenuItem { Menu *createChildMenu() override { Menu *menu = new Menu; - menu->addChild(construct<MenuLabel>(&MenuLabel::text, "Farties")); + menu->addChild(construct<MenuLabel>(&MenuLabel::text, "Select an Algorithm... NOW")); for (unsigned int i = 0; i < penerator->availableAlgorithms.size(); i++) { setAlgoItem *menuItem = new setAlgoItem(i); @@ -215,7 +217,7 @@ struct ComputerscareGolyPeneratorWidget : ModuleWidget { float xx; float yy; - addLabeledKnob<ScrambleSnapKnob>("Algo", 4, 336, module, ComputerscareGolyPenerator::ALGORITHM, 0, 0, true); + addLabeledKnob<ScrambleSnapKnob>("Algo", 4, 324, module, ComputerscareGolyPenerator::ALGORITHM, 0, 0, true); addLabeledKnob<SmoothKnob>("center", 28, 80, module, ComputerscareGolyPenerator::IN_OFFSET, 0, 0); addLabeledKnob<SmallKnob>("spread", 5, 86, module, ComputerscareGolyPenerator::IN_SCALE, 0, 0); addLabeledKnob<SmallKnob>("scale", 33, 290, module, ComputerscareGolyPenerator::OUT_SCALE, 0, 0); @@ -223,10 +225,10 @@ struct ComputerscareGolyPeneratorWidget : ModuleWidget { //addLabeledKnob("ch out",5,90,module,ComputerscareGolyPenerator::POLY_CHANNELS,-2,0); - channelWidget = new PolyOutputChannelsWidget(Vec(8, 312), module, ComputerscareGolyPenerator::POLY_CHANNELS); + channelWidget = new PolyOutputChannelsWidget(Vec(28, 309), module, ComputerscareGolyPenerator::POLY_CHANNELS); addChild(channelWidget); - addOutput(createOutput<PointingUpPentagonPort>(Vec(28, 328), module, ComputerscareGolyPenerator::POLY_OUTPUT)); + addOutput(createOutput<InPort>(Vec(28, 329), module, ComputerscareGolyPenerator::POLY_OUTPUT)); } void appendContextMenu(Menu* menu) override { diff --git a/src/ComputerscareHorseADoodleDoo.cpp b/src/ComputerscareHorseADoodleDoo.cpp @@ -4,6 +4,15 @@ struct ComputerscareHorseADoodleDoo; +const std::string HorseAvailableModes[4] = {"Each Channel Independent", "All Channels Triggered by Ch. 1 sequence","Trigger Cascade:\nEach channel is triggered by the previous channel's trigger sequence","EOC Cascade:\nEach channel is triggered by the previous channel's EOC"}; + +struct HorseModeParam : ParamQuantity { + std::string getDisplayValueString() override { + int val = getValue(); + return HorseAvailableModes[val]; + } +}; + struct HorseSequencer { float pattern = 0.f; int numSteps = 8; @@ -128,6 +137,8 @@ struct ComputerscareHorseADoodleDoo : ComputerscarePolyModule { ComputerscareSVGPanel* panelRef; float currentValues[16] = {0.f}; bool atFirstStepPoly[16] = {false}; + int previousStep[16] = { -1}; + bool shouldSetEOCHigh[16]={false}; enum ParamIds { PATTERN_KNOB, PATTERN_TRIM, @@ -209,7 +220,7 @@ struct ComputerscareHorseADoodleDoo : ComputerscarePolyModule { configParam<AutoParamQuantity>(POLY_KNOB, 0.f, 16.f, 0.f, "Polyphony"); - configParam(MODE_KNOB, 1.f, 4.f, 1.f, "Mode"); + configParam<HorseModeParam>(MODE_KNOB, 0.f, 3.f, 0.f, "Mode"); configParam(MANUAL_RESET_BUTTON, 0.f, 1.f, 0.f); configParam(MANUAL_CLOCK_BUTTON, 0.f, 1.f, 0.f); @@ -218,11 +229,14 @@ struct ComputerscareHorseADoodleDoo : ComputerscarePolyModule { for (int i = 0; i < 16; i++) { seq[i] = HorseSequencer(0.f, 8, 0.f, i); + previousStep[i]=-1; } } - + void setMode(int newMode) { + params[MODE_KNOB].setValue(newMode); + } void checkKnobChanges() { @@ -261,21 +275,21 @@ struct ComputerscareHorseADoodleDoo : ComputerscarePolyModule { seq[i].checkAndArm(patternVal, stepsVal, densityVal); } } - void processChannel(int ch, bool clocked, bool reset, bool clockInputHigh, int overrideMode = 1, bool overriddenTriggerHigh = false) { - + void processChannel(int ch, bool clocked, bool reset, bool clockInputHigh, int overrideMode = 0, bool overriddenTriggerHigh = false) { + bool eocHigh = false; if (reset) { seq[ch].armChange(); } if (clocked /*&& !reset*/) { - if (overrideMode == 2) { + if (overrideMode == 1) { seqVal[ch] = seq[ch].tickAndGet(); if (overriddenTriggerHigh) { cvVal[ch] = seq[ch].getCV(); } seqVal[ch] = overriddenTriggerHigh; } - else if (overrideMode == 3 || overrideMode == 4) { + else if (overrideMode == 2 || overrideMode == 3) { if (overriddenTriggerHigh) { seqVal[ch] = seq[ch].tickAndGet(); cvVal[ch] = seq[ch].getCV(); @@ -290,6 +304,9 @@ struct ComputerscareHorseADoodleDoo : ComputerscarePolyModule { atFirstStepPoly[ch] = (seq[ch].currentStep == 0); + shouldSetEOCHigh[ch] = atFirstStepPoly[ch] && previousStep[ch] != 0; + previousStep[ch] = seq[ch].currentStep; + } if (true || inputs[CLOCK_INPUT].isConnected()) { @@ -302,9 +319,9 @@ struct ComputerscareHorseADoodleDoo : ComputerscarePolyModule { } - if (atFirstStepPoly[ch]) { - outputs[EOC_OUTPUT].setVoltage((clockInputHigh && atFirstStepPoly[ch]) ? 10.f : 0.0f, ch); - } + //if (atFirstStepPoly[ch]) { + outputs[EOC_OUTPUT].setVoltage((clockInputHigh && shouldSetEOCHigh[ch]) ? 10.f : 0.0f, ch); + //} } void process(const ProcessArgs &args) override { ComputerscarePolyModule::checkCounter(); @@ -320,13 +337,13 @@ struct ComputerscareHorseADoodleDoo : ComputerscarePolyModule { isHigh[i] = manualClock || clockInputTrigger[i].isHigh(); } - if (mode == 1) { + if (mode == 0) { //each poly channel processes independent trigger and cv for (int i = 0; i < 16; i++) { processChannel(i, currentClock[clockChannels[i] - 1], currentReset[resetChannels[i] - 1], isHigh[clockChannels[i] - 1]); } } - else if (mode == 2) { + else if (mode == 1) { // all poly channels 2-16 CV only changes along with channel 1 trigger // what to do with the triggers for these channels? // force to 1 channel gate output? @@ -335,28 +352,28 @@ struct ComputerscareHorseADoodleDoo : ComputerscarePolyModule { processChannel(i, currentClock[clockChannels[i] - 1], currentReset[resetChannels[i] - 1], isHigh[clockChannels[i] - 1]); } else { - processChannel(i, currentClock[clockChannels[i] - 1], currentReset[resetChannels[i] - 1], isHigh[clockChannels[i] - 1], 2, seqVal[0]); + processChannel(i, currentClock[clockChannels[i] - 1], currentReset[resetChannels[i] - 1], isHigh[clockChannels[i] - 1], mode, seqVal[0]); } } - } else if (mode == 3) { + } else if (mode == 2) { // trigger cascade for (int i = 0; i < 16; i++) { if (i == 0) { processChannel(i, currentClock[clockChannels[i] - 1], currentReset[resetChannels[i] - 1], isHigh[clockChannels[i] - 1]); } else { - processChannel(i, currentClock[clockChannels[i] - 1], currentReset[resetChannels[i] - 1], isHigh[clockChannels[i] - 1], 3, seqVal[i - 1]); + processChannel(i, currentClock[clockChannels[i] - 1], currentReset[resetChannels[i] - 1], isHigh[clockChannels[i] - 1], mode, seqVal[i - 1]); } } } - else if (mode == 4) { + else if (mode == 3) { // eoc cascade: previous channels EOC clocks next channels CV and trigger for (int i = 0; i < 16; i++) { if (i == 0) { processChannel(i, currentClock[clockChannels[i] - 1], currentReset[resetChannels[i] - 1], isHigh[clockChannels[i] - 1]); } else { - processChannel(i, currentClock[clockChannels[i] - 1], currentReset[resetChannels[i] - 1], isHigh[clockChannels[i] - 1], 4, atFirstStepPoly[i - 1]); + processChannel(i, currentClock[clockChannels[i] - 1], currentReset[resetChannels[i] - 1], isHigh[clockChannels[i] - 1], mode, shouldSetEOCHigh[i - 1]); } } } @@ -512,6 +529,61 @@ struct HorseDisplay : TransparentWidget { } } }; +struct setModeItem : MenuItem +{ + ComputerscareHorseADoodleDoo *horse; + int mySetVal; + setModeItem(int setVal) + { + mySetVal = setVal; + } + + void onAction(const event::Action &e) override + { + horse->setMode(mySetVal); + } + void step() override { + rightText = CHECKMARK(horse->params[ComputerscareHorseADoodleDoo::MODE_KNOB].getValue() == mySetVal); + MenuItem::step(); + } +}; + +/*struct SetAllItem : MenuItem { + ComputerscareRolyPouter *pouter; + + Menu *createChildMenu() override { + Menu *menu = new Menu; + for (int i = 1; i < 17; i++) { + ssmi *menuItem = new ssmi(i); + menuItem->text = "Set all to ch. " + std::to_string(i); + menuItem->pouter = pouter; + menu->addChild(menuItem); + } + return menu; + } + +};*/ +struct ModeChildMenu : MenuItem { + ComputerscareHorseADoodleDoo *horse; + + Menu *createChildMenu() override { + Menu *menu = new Menu; + menu->addChild(construct<MenuLabel>(&MenuLabel::text, "How the polyphonic channels are triggered")); + + for (unsigned int i = 0; i < 4; i++) { + setModeItem *menuItem = new setModeItem(i); + //ParamSettingItem *menuItem = new ParamSettingItem(i,ComputerscareGolyPenerator::ALGORITHM); + + menuItem->text = HorseAvailableModes[i]; + menuItem->horse = horse; + menuItem->box.size.y=40; + menu->addChild(menuItem); + } + + return menu; + } + +}; struct ComputerscareHorseADoodleDooWidget : ModuleWidget { ComputerscareHorseADoodleDooWidget(ComputerscareHorseADoodleDoo *module) { @@ -532,7 +604,7 @@ struct ComputerscareHorseADoodleDooWidget : ModuleWidget { addInputBlock("Pattern", 10, 100, module, 0, ComputerscareHorseADoodleDoo::PATTERN_CV, 0, ComputerscareHorseADoodleDoo::PATTERN_SPREAD); addInputBlock("Length", 10, 150, module, 2, ComputerscareHorseADoodleDoo::STEPS_CV, 1, ComputerscareHorseADoodleDoo::STEPS_SPREAD); addInputBlock("Density", 10, 200, module, 4, ComputerscareHorseADoodleDoo::DENSITY_CV, 0, ComputerscareHorseADoodleDoo::DENSITY_SPREAD); - addParam(createParam<MediumDotSnapKnob>(Vec(4, 230), module, ComputerscareHorseADoodleDoo::MODE_KNOB)); + addParam(createParam<ScrambleSnapKnobNoRandom>(Vec(4, 234), module, ComputerscareHorseADoodleDoo::MODE_KNOB)); //addInputBlock("Mode", 0, 250, module, ComputerscareHorseADoodleDoo::MODE_KNOB, 0, 1); @@ -620,6 +692,19 @@ struct ComputerscareHorseADoodleDooWidget : ModuleWidget { //addChild(smallLetterDisplay); } + + void appendContextMenu(Menu* menu) override { + ComputerscareHorseADoodleDoo* horse = dynamic_cast<ComputerscareHorseADoodleDoo*>(this->module); + + menu->addChild(new MenuEntry); + + + ModeChildMenu *modeMenu = new ModeChildMenu(); + modeMenu->text = "Polyphonic Triggering Mode"; + modeMenu->rightText = RIGHT_ARROW; + modeMenu->horse = horse; + menu->addChild(modeMenu); + } PolyOutputChannelsWidget* channelWidget; HorseDisplay* horseDisplay; NumStepsOverKnobDisplay* numStepsKnob; diff --git a/src/ComputerscarePolyModule.hpp b/src/ComputerscarePolyModule.hpp @@ -31,10 +31,12 @@ struct TinyChannelsSnapKnob: RoundBlackSnapKnob { int prevSetting=-1; int paramId=-1; + ComputerscarePolyModule *module; TinyChannelsSnapKnob() { setSvg(APP->window->loadSvg(asset::plugin(pluginInstance, "res/computerscare-channels-empty-knob.svg"))); + shadow->opacity = 0.f; } void randomize() override {return;} void draw(const DrawArgs& args) override { diff --git a/src/MenuParams.hpp b/src/MenuParams.hpp @@ -32,7 +32,7 @@ struct MenuParam : MenuEntry { ParamWidget* speedParam; MenuLabel* johnLabel; MenuLabel* displayString; - float controlRightMargin = 10; + float controlRightMargin = 6; MenuParam(ParamQuantity* param, int type) { if (type == 0) {