Browse Source

Muxlicer: tap tempo now in context menu

* removed alt-drag (won't be Rack 2 compatible)
* cleaned up clock div
* made COM_8_IN_1_OUT default
* added reset grace period
tags/v2.1.0
hemmer 3 years ago
parent
commit
17b9fbd589
2 changed files with 152 additions and 86 deletions
  1. +74
    -64
      res/Muxlicer.svg
  2. +78
    -22
      src/Muxlicer.cpp

+ 74
- 64
res/Muxlicer.svg View File

@@ -68,9 +68,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4"
inkscape:cx="199.2469"
inkscape:cy="196.57393"
inkscape:zoom="3.959798"
inkscape:cx="135.50855"
inkscape:cy="65.391117"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
@@ -1365,6 +1365,77 @@
style="display:inline;fill:none;stroke:#ffffff;stroke-width:0.33399057px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;enable-background:new"
d="m 39.016225,193.94652 a 7.3426011,7.3441482 0 0 1 0.0046,7.33713"
id="path8000" />
<g
aria-label="SPEED DIV/MULT"
transform="matrix(0.28220585,0,0,0.2822386,0.0176388,168.20084)"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:condensed;line-height:0%;font-family:Miso;-inkscape-font-specification:'Miso Bold Condensed';text-align:center;letter-spacing:-0.05999652px;word-spacing:0px;text-anchor:middle;display:inline;fill:#ffffff;fill-opacity:1;stroke:none"
id="text8002">
<path
inkscape:connector-curvature="0"
d="m 107.80266,132.53334 c -0.20249,0.15749 -0.44997,0.21374 -0.69746,0.16874 -0.24748,-0.0562 -0.44997,-0.20248 -0.57371,-0.41622 -0.15749,-0.25874 -0.48373,-0.34873 -0.74246,-0.20249 -0.25874,0.14624 -0.34873,0.48372 -0.19124,0.74246 0.26998,0.47247 0.74246,0.8212 1.29368,0.93369 0.55121,0.10125 1.11368,-0.0225 1.56365,-0.35998 0.43873,-0.33748 0.71996,-0.8437 0.76496,-1.40617 0.045,-0.55121 -0.15749,-1.10243 -0.55122,-1.50741 l -1.78864,-1.84489 c -0.16874,-0.16874 -0.24749,-0.39373 -0.22499,-0.61871 0.0113,-0.23624 0.12374,-0.44998 0.31498,-0.58497 0.19124,-0.14624 0.41623,-0.20249 0.65246,-0.15749 0.22499,0.0562 0.41623,0.19124 0.53997,0.39373 0.14624,0.25873 0.47247,0.34873 0.73121,0.20248 0.25873,-0.15749 0.34873,-0.48372 0.20249,-0.74245 -0.26999,-0.47248 -0.73121,-0.79871 -1.25993,-0.9112 -0.52872,-0.10124 -1.09119,0.0225 -1.51866,0.34873 -0.42748,0.32623 -0.69746,0.8212 -0.74246,1.36117 -0.045,0.53997 0.14624,1.07994 0.52872,1.46242 l 1.7999,1.84489 c 0.16874,0.17999 0.25873,0.42747 0.23623,0.67496 -0.0225,0.24748 -0.13499,0.47247 -0.33748,0.61871 z"
style="font-size:11.24934673px;line-height:76.99999809%"
id="path41119" />
<path
inkscape:connector-curvature="0"
d="m 110.03542,126.77368 v 6.47962 c 0,0.30373 0.23624,0.53997 0.53997,0.53997 0.29249,0 0.53997,-0.23624 0.53997,-0.53997 v -2.60985 h 0.80995 c 1.04619,0 1.88989,-0.8437 1.88989,-1.88989 v -0.62996 c 0,-1.04619 -0.8437,-1.88989 -1.88989,-1.88989 h -1.34992 c -0.30373,0 -0.53997,0.24748 -0.53997,0.53997 z m 2.69985,1.34992 v 0.62996 c 0,0.44998 -0.35998,0.80996 -0.80996,0.80996 h -0.80995 v -2.24987 h 0.80995 c 0.44998,0 0.80996,0.35998 0.80996,0.80995 z"
style="font-size:11.24934673px;line-height:76.99999809%"
id="path41121" />
<path
inkscape:connector-curvature="0"
d="m 114.47956,126.77368 v 6.43462 c 0,0.30374 0.24749,0.53997 0.53997,0.53997 h 2.24987 c 0.30373,0 0.53997,-0.23623 0.53997,-0.53997 0,-0.29248 -0.23624,-0.53996 -0.53997,-0.53996 h -1.7099 v -2.24987 h 1.48491 c 0.30373,0 0.53997,-0.23624 0.53997,-0.53997 0,-0.29249 -0.23624,-0.53997 -0.53997,-0.53997 h -1.48491 v -2.02488 h 1.7099 c 0.30373,0 0.53997,-0.23624 0.53997,-0.53997 0,-0.29249 -0.23624,-0.53997 -0.53997,-0.53997 h -2.24987 c -0.29248,0 -0.53997,0.24748 -0.53997,0.53997 z"
style="font-size:11.24934673px;line-height:76.99999809%"
id="path41123" />
<path
inkscape:connector-curvature="0"
d="m 118.55018,126.77368 v 6.43462 c 0,0.30374 0.24749,0.53997 0.53997,0.53997 h 2.24987 c 0.30373,0 0.53997,-0.23623 0.53997,-0.53997 0,-0.29248 -0.23624,-0.53996 -0.53997,-0.53996 h -1.7099 v -2.24987 h 1.48491 c 0.30374,0 0.53997,-0.23624 0.53997,-0.53997 0,-0.29249 -0.23623,-0.53997 -0.53997,-0.53997 h -1.48491 v -2.02488 h 1.7099 c 0.30373,0 0.53997,-0.23624 0.53997,-0.53997 0,-0.29249 -0.23624,-0.53997 -0.53997,-0.53997 h -2.24987 c -0.29248,0 -0.53997,0.24748 -0.53997,0.53997 z"
style="font-size:11.24934673px;line-height:76.99999809%"
id="path41125" />
<path
inkscape:connector-curvature="0"
d="m 123.16077,126.23371 c -0.30373,0 -0.53996,0.24748 -0.53996,0.53997 v 6.43462 c 0,0.30374 0.23623,0.53997 0.53996,0.53997 h 1.34993 c 1.04618,0 1.88989,-0.8437 1.88989,-1.88989 v -3.73478 c 0,-1.04619 -0.84371,-1.88989 -1.88989,-1.88989 z m 2.15988,1.88989 v 3.73478 c 0,0.44998 -0.35998,0.80996 -0.80995,0.80996 h -0.80996 v -5.35469 h 0.80996 c 0.44997,0 0.80995,0.35998 0.80995,0.80995 z"
style="font-size:11.24934673px;line-height:76.99999809%"
id="path41127" />
<path
inkscape:connector-curvature="0"
d="m 99.915464,134.89571 c -0.303732,0 -0.539968,0.24748 -0.539968,0.53996 v 6.43463 c 0,0.30373 0.236236,0.53997 0.539968,0.53997 h 1.349926 c 1.04619,0 1.88989,-0.8437 1.88989,-1.88989 v -3.73478 c 0,-1.04619 -0.8437,-1.88989 -1.88989,-1.88989 z m 2.159876,1.88989 v 3.73478 c 0,0.44997 -0.35998,0.80995 -0.80995,0.80995 h -0.80996 v -5.35469 h 0.80996 c 0.44997,0 0.80995,0.35998 0.80995,0.80996 z"
style="font-size:11.24934673px;line-height:76.99999809%"
id="path41129" />
<path
inkscape:connector-curvature="0"
d="m 104.6672,142.45527 c 0.30373,0 0.53997,-0.23624 0.53997,-0.53997 v -6.52462 c 0,-0.29249 -0.23624,-0.53997 -0.53997,-0.53997 -0.29248,0 -0.53997,0.24748 -0.53997,0.53997 v 6.52462 c 0,0.30373 0.24749,0.53997 0.53997,0.53997 z"
style="font-size:11.24934673px;line-height:76.99999809%"
id="path41131" />
<path
inkscape:connector-curvature="0"
d="m 107.72573,142.06154 c 0.0675,0.23624 0.28124,0.39373 0.52872,0.39373 0.23624,0 0.44998,-0.15749 0.51747,-0.39373 l 1.7999,-6.52462 c 0.0787,-0.29248 -0.09,-0.58497 -0.38248,-0.66371 -0.28123,-0.0788 -0.58497,0.09 -0.66371,0.37123 0,0 -0.75371,2.73359 -1.27118,4.64598 -0.52872,-1.91239 -1.28242,-4.64598 -1.28242,-4.64598 -0.0787,-0.28124 -0.38248,-0.44998 -0.66371,-0.37123 -0.29249,0.0787 -0.46123,0.37123 -0.38248,0.66371 z"
style="font-size:11.24934673px;line-height:76.99999809%"
id="path41133" />
<path
inkscape:connector-curvature="0"
d="m 114.57582,134.43448 c -0.28123,-0.10124 -0.59621,0.045 -0.69746,0.32623 l -2.69984,7.42457 c -0.10124,0.28124 0.045,0.58497 0.32623,0.68621 0.28124,0.10125 0.58497,-0.045 0.68621,-0.32623 l 2.69985,-7.42457 c 0.11249,-0.26998 -0.0337,-0.58496 -0.31499,-0.68621 z"
style="font-size:11.24934673px;line-height:76.99999809%"
id="path41135" />
<path
inkscape:connector-curvature="0"
d="m 116.43964,142.45527 c 0.29248,0 0.53997,-0.23624 0.53997,-0.53997 0,0 0,-2.19362 0,-4.10601 0.37123,0.7987 0.76496,1.63115 0.76496,1.63115 0.09,0.19124 0.28123,0.31498 0.49497,0.31498 0.20249,0 0.39372,-0.12374 0.48372,-0.31498 0,0 0.39373,-0.83245 0.7762,-1.63115 0,1.91239 0,4.10601 0,4.10601 0,0.30373 0.23624,0.53997 0.53997,0.53997 0.29249,0 0.53997,-0.23624 0.53997,-0.53997 v -6.52462 c 0,-0.24749 -0.17999,-0.47248 -0.42747,-0.52872 -0.24749,-0.0563 -0.49497,0.0675 -0.60747,0.30373 0,0 -0.78745,1.67615 -1.30492,2.77859 -0.51747,-1.10244 -1.31618,-2.77859 -1.31618,-2.77859 -0.10124,-0.23624 -0.35998,-0.35998 -0.60746,-0.30373 -0.24749,0.0562 -0.41623,0.28123 -0.41623,0.52872 v 6.52462 c 0,0.30373 0.23624,0.53997 0.53997,0.53997 z"
style="font-size:11.24934673px;line-height:76.99999809%"
id="path41137" />
<path
inkscape:connector-curvature="0"
d="m 122.67401,140.56538 v -5.1747 c 0,-0.29249 -0.24749,-0.53997 -0.53997,-0.53997 -0.30374,0 -0.53997,0.24748 -0.53997,0.53997 v 5.1747 c 0,1.04619 0.8437,1.88989 1.88989,1.88989 1.03494,0 1.88989,-0.8437 1.88989,-1.88989 v -5.1747 c 0,-0.29249 -0.24749,-0.53997 -0.53997,-0.53997 -0.30373,0 -0.53997,0.24748 -0.53997,0.53997 v 5.1747 c 0,0.44997 -0.37123,0.80995 -0.80995,0.80995 -0.44998,0 -0.80995,-0.35998 -0.80995,-0.80995 z"
style="font-size:11.24934673px;line-height:76.99999809%"
id="path41139" />
<path
inkscape:connector-curvature="0"
d="m 126.93183,142.41027 h 2.24986 c 0.29249,0 0.53997,-0.23624 0.53997,-0.53997 0,-0.29248 -0.24748,-0.53997 -0.53997,-0.53997 h -1.7099 v -5.93965 c 0,-0.29249 -0.24748,-0.53997 -0.53996,-0.53997 -0.30374,0 -0.53997,0.24748 -0.53997,0.53997 v 6.47962 c 0,0.30373 0.23623,0.53997 0.53997,0.53997 z"
style="font-size:11.24934673px;line-height:76.99999809%"
id="path41141" />
<path
inkscape:connector-curvature="0"
d="m 129.65165,134.89571 c -0.29249,0 -0.53997,0.24748 -0.53997,0.53996 0,0.30374 0.24748,0.53997 0.53997,0.53997 h 0.92244 v 5.93966 c 0,0.30373 0.24749,0.53997 0.53997,0.53997 0.30374,0 0.53997,-0.23624 0.53997,-0.53997 v -5.93966 h 0.92245 c 0.30373,0 0.53997,-0.23623 0.53997,-0.53997 0,-0.29248 -0.23624,-0.53996 -0.53997,-0.53996 z"
style="font-size:11.24934673px;line-height:76.99999809%"
id="path41143" />
</g>
<g
style="display:inline"
id="g8018"
@@ -2124,67 +2195,6 @@
inkscape:export-ydpi="100" />
</g>
</g>
<g
transform="matrix(0.28222222,0,0,0.28222222,0.0176388,168.20084)"
aria-label="[TAP=TEMPO]"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:condensed;font-size:14px;line-height:0%;font-family:Miso;-inkscape-font-specification:'Miso Bold Condensed';text-align:center;letter-spacing:-0.06px;word-spacing:0px;text-anchor:middle;display:inline;fill:#ffffff;fill-opacity:1;stroke:none"
id="text21924">
<path
inkscape:connector-curvature="0"
d="m 93.914712,104.02143 0.02074,-0.81224 c 0.0054,-0.21118 -0.160613,-0.39423 -0.379917,-0.39983 -0.211181,-0.005 -0.394436,0.16874 -0.399829,0.37992 0,0 -0.0054,0.21118 -0.01079,0.42236 -0.633543,-0.0162 -4.532272,-0.11574 -5.165816,-0.13192 0.0054,-0.21118 0.01079,-0.42236 0.01079,-0.42236 0.0054,-0.21118 -0.160613,-0.39423 -0.379916,-0.39983 -0.211181,-0.005 -0.394436,0.16873 -0.399829,0.37992 l -0.02074,0.81223 c -0.0056,0.2193 0.168735,0.39444 0.379917,0.39983 l 5.945561,0.15184 c 0.219304,0.006 0.394229,-0.16062 0.399829,-0.37992 z"
style="font-size:8.125px"
id="path41203" />
<path
inkscape:connector-curvature="0"
d="m 87.955816,101.63027 c -0.02705,0.20951 0.127345,0.40968 0.336856,0.43673 0.21757,0.0281 0.409677,-0.12735 0.436724,-0.33686 l 0.0853,-0.66077 4.254691,0.54928 c 0.21757,0.0281 0.409677,-0.12735 0.436725,-0.33686 0.02809,-0.21757 -0.119287,-0.40863 -0.336857,-0.43672 l -4.254691,-0.54928 0.0853,-0.660762 c 0.02809,-0.21757 -0.119287,-0.408637 -0.336856,-0.436724 -0.209512,-0.02705 -0.408637,0.119286 -0.436724,0.336856 z"
style="font-size:8.125px"
id="path41205" />
<path
inkscape:connector-curvature="0"
d="m 89.135417,96.81127 c -0.175317,-0.0052 -0.325354,0.114187 -0.371919,0.286766 -0.04657,0.172578 0.02304,0.351255 0.177194,0.434925 l 4.211141,2.482729 c 0.18914,0.10994 0.424845,0.0473 0.532671,-0.133988 0.109942,-0.18914 0.04731,-0.424845 -0.13399,-0.532671 0,0 -0.311913,-0.185146 -0.762289,-0.44973 l 0.359818,-1.33356 c 0.522339,-0.0021 0.885051,-0.0052 0.885051,-0.0052 0.210927,-0.002 0.383626,-0.174205 0.383745,-0.392977 -0.002,-0.210928 -0.174204,-0.383626 -0.392976,-0.383746 z m 2.956887,1.673039 c -0.501054,-0.295089 -1.06063,-0.622799 -1.532422,-0.901577 0.547989,-0.0036 1.196461,-0.0054 1.777945,-0.0084 z"
style="font-size:8.125px"
id="path41207" />
<path
inkscape:connector-curvature="0"
d="m 90.029468,94.495624 4.288093,1.874741 c 0.201005,0.08788 0.425691,-1.09e-4 0.51357,-0.201113 0.08462,-0.19356 -1.09e-4,-0.425691 -0.201113,-0.51357 l -1.727149,-0.755103 0.234343,-0.536012 c 0.302692,-0.692349 -0.01155,-1.494801 -0.703895,-1.797494 l -0.416898,-0.182266 c -0.692348,-0.302693 -1.494801,0.01155 -1.797493,0.703894 l -0.390571,0.893353 c -0.08788,0.201005 0.0076,0.428946 0.201113,0.51357 z m 1.674494,-1.396135 0.416898,0.182267 c 0.297785,0.13019 0.43186,0.47257 0.301669,0.770354 l -0.234342,0.536012 -1.488922,-0.650952 0.234343,-0.536012 c 0.13019,-0.297784 0.47257,-0.431859 0.770354,-0.301669 z"
style="font-size:8.125px"
id="path41209" />
<path
inkscape:connector-curvature="0"
d="m 95.277043,90.551711 -1.032283,1.654355 c -0.11183,0.179222 -0.05481,0.425497 0.124415,0.537328 0.186115,0.116132 0.425497,0.05481 0.537327,-0.124415 l 1.032284,-1.654355 c 0.116131,-0.186115 0.0617,-0.421196 -0.124415,-0.537328 -0.179222,-0.11183 -0.421196,-0.0617 -0.537328,0.124415 z m -1.102903,-0.688189 -1.032283,1.654355 c -0.111831,0.179222 -0.05481,0.425497 0.124414,0.537328 0.186115,0.116132 0.425497,0.05481 0.537328,-0.124415 l 1.032283,-1.654355 c 0.116132,-0.186115 0.0617,-0.421196 -0.124414,-0.537328 -0.179222,-0.11183 -0.421196,-0.0617 -0.537328,0.124415 z"
style="font-size:8.125px"
id="path41211" />
<path
inkscape:connector-curvature="0"
d="m 93.653334,87.317147 c -0.13583,0.161793 -0.11386,0.413627 0.04793,0.549457 0.168016,0.141053 0.413627,0.11386 0.549456,-0.04793 l 0.428385,-0.51027 3.285643,2.758379 c 0.168015,0.141053 0.413627,0.113859 0.549456,-0.04793 0.141054,-0.168015 0.120083,-0.408403 -0.04793,-0.549456 l -3.285643,-2.758378 0.428385,-0.510271 c 0.141053,-0.168016 0.120082,-0.408403 -0.04793,-0.549456 -0.161793,-0.135829 -0.408403,-0.120083 -0.549456,0.04793 z"
style="font-size:8.125px"
id="path41213" />
<path
inkscape:connector-curvature="0"
d="m 96.348704,84.863537 3.138321,3.427856 c 0.148137,0.161804 0.395196,0.166948 0.551005,0.0243 l 1.19855,-1.097315 c 0.16181,-0.148138 0.17244,-0.389204 0.0243,-0.551008 -0.14265,-0.155812 -0.3892,-0.172434 -0.55101,-0.0243 l -0.910896,0.83396 -1.097315,-1.198552 0.791044,-0.724227 c 0.161804,-0.148138 0.172434,-0.389204 0.0243,-0.551008 -0.142651,-0.155812 -0.389203,-0.172434 -0.551008,-0.0243 l -0.791043,0.724228 -0.987584,-1.078696 0.910899,-0.833959 c 0.161804,-0.148138 0.172434,-0.389204 0.0243,-0.551008 -0.142651,-0.155812 -0.389204,-0.172435 -0.551008,-0.0243 l -1.198551,1.097315 c -0.155812,0.142651 -0.166948,0.395196 -0.0243,0.551008 z"
style="font-size:8.125px"
id="path41215" />
<path
inkscape:connector-curvature="0"
d="m 102.2473,86.435246 c 0.17633,-0.116329 0.23158,-0.357186 0.11078,-0.540303 0,0 -0.87247,-1.322513 -1.63309,-2.475473 0.54148,0.333882 1.10995,0.679161 1.10995,0.679161 0.13032,0.0795 0.29483,0.07804 0.42369,-0.007 0.12208,-0.08054 0.18816,-0.2312 0.16635,-0.38229 0,0 -0.0937,-0.658474 -0.18079,-1.292127 0.76061,1.15296 1.63308,2.475473 1.63308,2.475473 0.12081,0.183117 0.35719,0.231583 0.54031,0.110779 0.17633,-0.116329 0.23158,-0.357186 0.11078,-0.540303 l -2.59504,-3.933628 c -0.0984,-0.149206 -0.29643,-0.213261 -0.46801,-0.148739 -0.17158,0.06452 -0.27157,0.237557 -0.24543,0.424724 0,0 0.19191,1.32373 0.3184,2.194191 -0.75045,-0.458834 -1.898635,-1.151701 -1.898635,-1.151701 -0.154997,-0.102157 -0.360202,-0.07385 -0.487038,0.05849 -0.126835,0.132343 -0.139083,0.335098 -0.04065,0.484305 l 2.595043,3.933628 c 0.1208,0.183117 0.35718,0.231583 0.5403,0.110779 z"
style="font-size:8.125px"
id="path41217" />
<path
inkscape:connector-curvature="0"
d="m 103.36908,79.826558 1.90169,4.276214 c 0.0891,0.200447 0.31437,0.287018 0.51482,0.197877 0.19302,-0.08584 0.28702,-0.314377 0.19788,-0.514825 l -0.76596,-1.722363 0.53453,-0.237711 c 0.69043,-0.307042 0.99961,-1.111456 0.69257,-1.801886 l -0.18488,-0.415743 c -0.30705,-0.69043 -1.11146,-0.999614 -1.80189,-0.692572 l -0.89088,0.396184 c -0.20045,0.08914 -0.28372,0.321801 -0.19788,0.514825 z m 2.17794,0.09851 0.18489,0.415743 c 0.13206,0.296959 1.4e-4,0.640176 -0.29682,0.772237 l -0.53452,0.23771 -0.66031,-1.484796 0.53453,-0.23771 c 0.29696,-0.132062 0.64017,-1.43e-4 0.77223,0.296816 z"
style="font-size:8.125px"
id="path41219" />
<path
inkscape:connector-curvature="0"
d="m 109.56847,82.875142 c 0.72758,-0.20393 1.14989,-0.955153 0.94596,-1.682739 l -0.74556,-2.659992 c -0.20393,-0.727586 -0.95515,-1.14989 -1.68274,-0.945959 -0.72758,0.20393 -1.14988,0.955153 -0.94595,1.682739 l 0.74555,2.659992 c 0.20393,0.727586 0.95515,1.14989 1.68274,0.945959 z m -1.27183,-4.537634 c 0.31294,-0.08771 0.63347,0.09247 0.72118,0.405411 l 0.74555,2.659993 c 0.0877,0.31294 -0.0925,0.633462 -0.40541,0.721174 -0.31294,0.08771 -0.63346,-0.09247 -0.72118,-0.405411 l -0.74555,-2.659993 c -0.0877,-0.31294 0.0925,-0.633462 0.40541,-0.721174 z"
style="font-size:8.125px"
id="path41221" />
<path
inkscape:connector-curvature="0"
d="m 111.43973,76.240548 -0.80277,0.125325 c -0.21675,0.03384 -0.35776,0.236766 -0.32518,0.445488 0.0338,0.21675 0.22874,0.359015 0.44549,0.325177 0,0 0.20872,-0.03258 0.41744,-0.06517 0.0978,0.626166 0.69931,4.479493 0.79707,5.105658 -0.20872,0.03259 -0.41745,0.06517 -0.41745,0.06517 -0.21675,0.03384 -0.35776,0.236767 -0.32517,0.445489 0.0338,0.216749 0.22874,0.359014 0.44549,0.325176 l 0.80277,-0.125324 c 0.20872,-0.03258 0.35902,-0.228739 0.32518,-0.445489 l -0.91738,-5.876323 c -0.0326,-0.208722 -0.23676,-0.357761 -0.44549,-0.325177 z"
style="font-size:8.125px"
id="path41223" />
</g>
<path
inkscape:export-ydpi="100"
inkscape:export-xdpi="100"


+ 78
- 22
src/Muxlicer.cpp View File

@@ -178,6 +178,14 @@ struct MultDivClock {
}
};

static std::vector<int> getClockOptions() {
return std::vector<int> {-16, -8, -4, -3, -2, 1, 2, 3, 4, 8, 16};
}

std::string getClockOptionString(const int clockOption) {
return (clockOption < 0) ? ("x 1/" + std::to_string(-clockOption)) : ("x " + std::to_string(clockOption));
}

struct Muxlicer : Module {
enum ParamIds {
PLAY_PARAM,
@@ -247,6 +255,7 @@ struct Muxlicer : Module {
uint32_t runIndex; // which step are we on (0 to 7)
uint32_t addressIndex = 0;
bool reset = false;
bool tapped = false;

// used to track the clock (e.g. if external clock is not connected). NOTE: this clock
// is defined _prior_ to any clock division/multiplication logic
@@ -257,24 +266,39 @@ struct Muxlicer : Module {
dsp::SchmittTrigger inputClockTrigger; // to detect incoming clock pulses
dsp::SchmittTrigger mainClockTrigger; // to detect rising edges from the divided/multiplied version of the clock signal
dsp::SchmittTrigger resetTrigger; // to detect the reset signal
dsp::PulseGenerator resetTimer; // leave a grace period before advancing the step
dsp::PulseGenerator endOfCyclePulse; // fire a signal at the end of cycle
dsp::BooleanTrigger tapTempoTrigger; // to only trigger tap tempo when push is first detected

MultDivClock mainClockMultDiv; // to produce a divided/multiplied version of the (internal or external) clock signal
MultDivClock outputClockMultDiv; // to produce a divided/multiplied version of the output clock signal
MultiGateClock multiClock; // to easily produce a divided version of the main clock (where division can be changed at any point)
bool usingExternalClock = false; // is there a clock plugged into clock in (external) or not (internal)

const static int SEQUENCE_LENGTH = 8;
ModeCOMIO modeCOMIO = COM_1_IN_8_OUT; // are we in 1-in-8-out mode, or 8-in-1-out mode
ModeCOMIO modeCOMIO = COM_8_IN_1_OUT; // are we in 1-in-8-out mode, or 8-in-1-out mode
int allInNormalVoltage = 10; // what voltage is normalled into the "All In" input, selectable via context menu
Module* rightModule; // for the expander

struct TapTempoKnobParamQuantity : ParamQuantity {
std::string getDisplayValueString() override {
if (module != nullptr) {
const std::vector<int> clockOptions = getClockOptions();
const int clockOptionIndex = clamp(int(ParamQuantity::getValue()), 0, clockOptions.size());
return getClockOptionString(clockOptions[clockOptionIndex]);
}
else {
return "";
}
}
};

Muxlicer() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
configParam(Muxlicer::PLAY_PARAM, STATE_PLAY_ONCE, STATE_PLAY, STATE_STOPPED, "Play switch");
configParam(Muxlicer::ADDRESS_PARAM, -1.f, 7.f, -1.f, "Address");
configParam(Muxlicer::GATE_MODE_PARAM, -1.f, 8.f, 0.f, "Gate mode");
configParam(Muxlicer::TAP_TEMPO_PARAM, 0.f, 1.f, 0.f, "Tap tempo");
const int numClockOptions = getClockOptions().size();
configParam<TapTempoKnobParamQuantity>(Muxlicer::TAP_TEMPO_PARAM, 0, numClockOptions - 1, numClockOptions / 2, "Main clock mult/div");

for (int i = 0; i < SEQUENCE_LENGTH; ++i) {
configParam(Muxlicer::LEVEL_PARAMS + i, 0.0, 1.0, 1.0, string::f("Slider %d", i));
@@ -291,7 +315,7 @@ struct Muxlicer : Module {

void process(const ProcessArgs& args) override {

const bool usingExternalClock = inputs[CLOCK_INPUT].isConnected();
usingExternalClock = inputs[CLOCK_INPUT].isConnected();

bool externalClockPulseReceived = false;
// a clock pulse does two things: 1) sets the internal clock (based on timing between two pulses), which
@@ -300,10 +324,15 @@ struct Muxlicer : Module {
externalClockPulseReceived = true;
}
// this can also be sent by tap tempo
else if (!usingExternalClock && tapTempoTrigger.process(params[TAP_TEMPO_PARAM].getValue())) {
else if (!usingExternalClock && tapTempoTrigger.process(tapped)) {
externalClockPulseReceived = true;
tapped = false;
}

const std::vector<int> clockOptions = getClockOptions();
const int clockOptionFromDial = clockOptions[int(params[TAP_TEMPO_PARAM].getValue())];
mainClockMultDiv.multDiv = clockOptionFromDial;

if (resetTrigger.process(rescale(inputs[RESET_INPUT].getVoltage(), 0.1f, 2.f, 0.f, 1.f))) {
reset = true;
if (playState == STATE_STOPPED) {
@@ -350,11 +379,13 @@ struct Muxlicer : Module {
if (reset) {
runIndex = 0;
reset = false;
resetTimer.trigger();
}
// see https://vcvrack.com/manual/VoltageStandards#Timing
const bool resetGracePeriodActive = resetTimer.process(args.sampleTime);

if (dividedMultipliedClockPulseReceived) {

if (isSequenceAdvancing) {
if (isSequenceAdvancing && !resetGracePeriodActive) {
runIndex++;
if (runIndex >= 8) {
// both play modes will reset to step 0 and fire an EOC trigger
@@ -432,7 +463,7 @@ struct Muxlicer : Module {
const float stepVolume = params[LEVEL_PARAMS + addressIndex].getValue();
for (int c = 0; c < numActiveEngines; c += 4) {
const float_4 allInValue = inputs[ALL_INPUT].getNormalPolyVoltageSimd<float_4>((float_4) allInNormalVoltage, c);
const float_4 stepValue = inputs[MUX_INPUTS + addressIndex].getNormalPolyVoltageSimd<float_4>(allInValue, c) * stepVolume;
const float_4 stepValue = inputs[MUX_INPUTS + addressIndex].getNormalPolyVoltageSimd<float_4>(allInValue, c) * stepVolume;
outputs[COM_OUTPUT].setVoltageSimd(stepValue, c);
}
outputs[COM_OUTPUT].setChannels(numActiveEngines);
@@ -560,6 +591,7 @@ struct Muxlicer : Module {
};



struct MuxlicerWidget : ModuleWidget {
MuxlicerWidget(Muxlicer* module) {

@@ -574,7 +606,8 @@ struct MuxlicerWidget : ModuleWidget {
addParam(createParam<BefacoSwitchMomentary>(mm2px(Vec(35.72963, 10.008)), module, Muxlicer::PLAY_PARAM));
addParam(createParam<BefacoTinyKnobSnap>(mm2px(Vec(3.84112, 10.90256)), module, Muxlicer::ADDRESS_PARAM));
addParam(createParam<BefacoTinyKnobWhite>(mm2px(Vec(67.83258, 10.86635)), module, Muxlicer::GATE_MODE_PARAM));
addParam(createParam<BefacoButton>(mm2px(Vec(28.12238, 24.62151)), module, Muxlicer::TAP_TEMPO_PARAM));
addParam(createParam<BefacoTinyKnobSnap>(mm2px(Vec(28.12238, 24.62151)), module, Muxlicer::TAP_TEMPO_PARAM));

addParam(createParam<BefacoSlidePot>(mm2px(Vec(2.32728, 40.67102)), module, Muxlicer::LEVEL_PARAMS + 0));
addParam(createParam<BefacoSlidePot>(mm2px(Vec(12.45595, 40.67102)), module, Muxlicer::LEVEL_PARAMS + 1));
addParam(createParam<BefacoSlidePot>(mm2px(Vec(22.58462, 40.67102)), module, Muxlicer::LEVEL_PARAMS + 2));
@@ -622,7 +655,7 @@ struct MuxlicerWidget : ModuleWidget {
addOutput(createOutput<BefacoOutputPort>(mm2px(Vec(71.82537, 109.29256)), module, Muxlicer::MUX_OUTPUTS + 7));
addOutput(createOutput<BefacoOutputPort>(mm2px(Vec(36.3142, 98.07911)), module, Muxlicer::COM_OUTPUT));

updatePortVisibilityForIOMode(Muxlicer::COM_1_IN_8_OUT);
updatePortVisibilityForIOMode(Muxlicer::COM_8_IN_1_OUT);

addChild(createLight<SmallLight<RedLight>>(mm2px(Vec(71.28361, 28.02644)), module, Muxlicer::CLOCK_LIGHT));
addChild(createLight<SmallLight<RedLight>>(mm2px(Vec(3.99336, 81.86801)), module, Muxlicer::GATE_LIGHTS + 0));
@@ -643,8 +676,8 @@ struct MuxlicerWidget : ModuleWidget {
}
else {
// module can be null, e.g. if populating the module browser with screenshots,
// in which case just assume the default (1 in, 8 out)
updatePortVisibilityForIOMode(Muxlicer::COM_1_IN_8_OUT);
// in which case just assume the default (8 in, 1 out)
updatePortVisibilityForIOMode(Muxlicer::COM_8_IN_1_OUT);
}

ModuleWidget::draw(args);
@@ -696,9 +729,7 @@ struct MuxlicerWidget : ModuleWidget {
}
};

static std::vector<int> getClockOptions() {
return std::vector<int> {-16, -8, -4, -3, -2, 1, 2, 3, 4, 8, 16};
}


struct OutputClockScalingItem : MenuItem {
Muxlicer* module;
@@ -714,8 +745,8 @@ struct MuxlicerWidget : ModuleWidget {
Menu* createChildMenu() override {
Menu* menu = new Menu;

for (auto clockOption : getClockOptions()) {
std::string optionString = (clockOption < 0) ? ("x 1/" + std::to_string(-clockOption)) : ("x " + std::to_string(clockOption));
for (int clockOption : getClockOptions()) {
std::string optionString = getClockOptionString(clockOption);
OutputClockScalingChildItem* clockItem = createMenuItem<OutputClockScalingChildItem>(optionString,
CHECKMARK(module->outputClockMultDiv.multDiv == clockOption));
clockItem->clockOutMulDiv = clockOption;
@@ -732,22 +763,28 @@ struct MuxlicerWidget : ModuleWidget {

struct MainClockScalingChildItem : MenuItem {
Muxlicer* module;
int clockOutMulDiv;
int mainClockMulDiv, mainClockMulDivIndex;

void onAction(const event::Action& e) override {
module->mainClockMultDiv.multDiv = clockOutMulDiv;
module->mainClockMultDiv.multDiv = mainClockMulDiv;
module->params[Muxlicer::TAP_TEMPO_PARAM].setValue(mainClockMulDivIndex);
}
};

Menu* createChildMenu() override {
Menu* menu = new Menu;

for (auto clockOption : getClockOptions()) {
std::string optionString = (clockOption < 0) ? ("x 1/" + std::to_string(-clockOption)) : ("x " + std::to_string(clockOption));
int i = 0;
for (int clockOption : getClockOptions()) {
std::string optionString = getClockOptionString(clockOption);
MainClockScalingChildItem* clockItem = createMenuItem<MainClockScalingChildItem>(optionString,
CHECKMARK(module->mainClockMultDiv.multDiv == clockOption));
clockItem->clockOutMulDiv = clockOption;

clockItem->mainClockMulDiv = clockOption;
clockItem->mainClockMulDivIndex = i;
clockItem->module = module;
menu->addChild(clockItem);
++i;
}

return menu;
@@ -761,6 +798,14 @@ struct MuxlicerWidget : ModuleWidget {
}
};

struct TapTempoItem : MenuItem {
Muxlicer* module;
void onAction(const event::Action& e) override {
module->tapped = true;
e.consume(NULL);
}
};

void appendContextMenu(Menu* menu) override {
Muxlicer* module = dynamic_cast<Muxlicer*>(this->module);
assert(module);
@@ -768,6 +813,17 @@ struct MuxlicerWidget : ModuleWidget {
menu->addChild(new MenuSeparator());
menu->addChild(createMenuLabel<MenuLabel>("Clock Multiplication/Division"));

if (module->usingExternalClock) {
menu->addChild(createMenuLabel<MenuLabel>("Using external clock"));

}
else {
TapTempoItem* tapTempoItem = createMenuItem<TapTempoItem>("Tap to set internal tempo...");
tapTempoItem->module = module;
menu->addChild(tapTempoItem);
}


MainClockScalingItem* mainClockScaleItem = createMenuItem<MainClockScalingItem>("Input clock", "▸");
mainClockScaleItem->module = module;
menu->addChild(mainClockScaleItem);


Loading…
Cancel
Save