Browse Source

Add host cv module

tags/22.02
falkTX 3 years ago
parent
commit
bcfae94f79
11 changed files with 541 additions and 18 deletions
  1. +153
    -0
      plugins/Cardinal/orig/HostCV.svg
  2. +12
    -3
      plugins/Cardinal/plugin.json
  3. +170
    -0
      plugins/Cardinal/res/HostCV.svg
  4. +11
    -11
      plugins/Cardinal/src/Carla.cpp
  5. +172
    -0
      plugins/Cardinal/src/HostCV.cpp
  6. +2
    -1
      plugins/Cardinal/src/plugin.hpp
  7. +4
    -1
      plugins/Cardinal/src/plugincontext.hpp
  8. +1
    -0
      plugins/Makefile
  9. +2
    -1
      plugins/plugins.cpp
  10. +6
    -0
      src/CardinalPlugin.cpp
  11. +8
    -1
      src/PluginContext.hpp

+ 153
- 0
plugins/Cardinal/orig/HostCV.svg View File

@@ -0,0 +1,153 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
width="45.720001mm"
height="128.5mm"
viewBox="0 0 45.720001 128.5"
version="1.1"
id="svg4620"
inkscape:version="1.1.1 (c3084ef, 2021-09-22)"
sodipodi:docname="HostCV.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs4614">
<style
id="style6"
type="text/css">
.str0 {stroke:#565656;stroke-width:0.0966867}
.str1 {stroke:#4F4F4F;stroke-width:0.193345}
.fil0 {fill:none}
.fil2 {fill:#2B2A29}
.fil1 {fill:#6B6B6B}
</style>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.7"
inkscape:cx="62.142857"
inkscape:cy="166.42857"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1228"
inkscape:window-height="667"
inkscape:window-x="52"
inkscape:window-y="25"
inkscape:window-maximized="1"
inkscape:pagecheckerboard="0" />
<metadata
id="metadata4617">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-168.5)">
<g
style="fill-rule:evenodd"
id="g5299"
transform="matrix(6.342689,0,0,6.342689,5.4472535,175.6457)">
<g
transform="translate(-1.6191379e-5,-0.08553947)"
id="Layer_x0020_1"
inkscape:label="Layer 1">
<metadata
id="CorelCorpID_0Corel-Layer" />
<circle
style="fill:none;stroke:#ffffff;stroke-width:0.0966867;stroke-opacity:1"
id="circle10"
r="0.15916"
cy="0.61075097"
cx="0.525226"
class="fil0 str0" />
<circle
style="fill:none;stroke:#ffffff;stroke-width:0.193345;stroke-opacity:1"
id="circle12"
r="0.42853901"
cy="0.61075097"
cx="0.525226"
class="fil0 str1" />
</g>
</g>
<g
aria-label="Cardinal"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:1.25;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
id="text5303"
transform="translate(-0.09449404,0.14174107)">
<path
d="m 17.923601,176.99103 v 0.66043 q -0.31626,-0.29456 -0.675928,-0.44028 -0.356567,-0.14573 -0.759643,-0.14573 -0.79375,0 -1.21543,0.48679 -0.42168,0.48369 -0.42168,1.40146 0,0.91468 0.42168,1.40147 0.42168,0.48369 1.21543,0.48369 0.403076,0 0.759643,-0.14573 0.359668,-0.14572 0.675928,-0.44028 v 0.65422 q -0.328662,0.22325 -0.697632,0.33487 -0.365869,0.11162 -0.775146,0.11162 -1.051099,0 -1.655713,-0.64182 -0.604615,-0.64492 -0.604615,-1.75804 0,-1.11621 0.604615,-1.75803 0.604614,-0.64492 1.655713,-0.64492 0.415478,0 0.781347,0.11162 0.36897,0.10852 0.691431,0.32866 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, 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;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
id="path5305"
inkscape:connector-curvature="0" />
<path
d="m 20.444377,179.51801 q -0.69143,0 -0.958081,0.15813 -0.26665,0.15813 -0.26665,0.5395 0,0.30386 0.198437,0.48369 0.201538,0.17674 0.545703,0.17674 0.47439,0 0.759644,-0.33487 0.288355,-0.33796 0.288355,-0.89606 v -0.12713 z m 1.137915,-0.23564 v 1.98127 h -0.570507 v -0.5271 q -0.195337,0.31626 -0.486792,0.46819 -0.291456,0.14883 -0.713135,0.14883 -0.533301,0 -0.849561,-0.29766 -0.313159,-0.30075 -0.313159,-0.80305 0,-0.58601 0.390674,-0.88367 0.393774,-0.29765 1.172021,-0.29765 h 0.799952 v -0.0558 q 0,-0.39378 -0.26045,-0.60772 -0.257348,-0.21704 -0.725537,-0.21704 -0.297656,0 -0.579809,0.0713 -0.282154,0.0713 -0.542603,0.21394 v -0.52709 q 0.313159,-0.12093 0.607715,-0.17984 0.294556,-0.062 0.573608,-0.062 0.753443,0 1.125513,0.39067 0.37207,0.39068 0.37207,1.18443 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, 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;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
id="path5307"
inkscape:connector-curvature="0" />
<path
d="m 24.769695,178.32429 q -0.09612,-0.0558 -0.21084,-0.0806 -0.111621,-0.0279 -0.248047,-0.0279 -0.483691,0 -0.744141,0.31626 -0.257348,0.31315 -0.257348,0.90227 v 1.82934 H 22.73571 v -3.47265 h 0.573609 v 0.5395 q 0.179834,-0.31626 0.468188,-0.46819 0.288355,-0.15503 0.700733,-0.15503 0.05891,0 0.130224,0.009 0.07131,0.006 0.15813,0.0217 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, 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;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
id="path5309"
inkscape:connector-curvature="0" />
<path
d="m 27.541618,178.31808 v -1.87895 h 0.570508 v 4.82451 h -0.570508 v -0.5209 q -0.179834,0.31006 -0.455786,0.46199 -0.272851,0.14883 -0.657324,0.14883 -0.629419,0 -1.026294,-0.5023 -0.393774,-0.50229 -0.393774,-1.32085 0,-0.81855 0.393774,-1.32085 0.396875,-0.50229 1.026294,-0.50229 0.384473,0 0.657324,0.15193 0.275952,0.14883 0.455786,0.45888 z m -1.944067,1.21233 q 0,0.62942 0.257349,0.98909 0.260449,0.35657 0.713134,0.35657 0.452686,0 0.713135,-0.35657 0.260449,-0.35967 0.260449,-0.98909 0,-0.62942 -0.260449,-0.98598 -0.260449,-0.35967 -0.713135,-0.35967 -0.452685,0 -0.713134,0.35967 -0.257349,0.35656 -0.257349,0.98598 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, 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;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
id="path5311"
inkscape:connector-curvature="0" />
<path
d="m 29.287248,177.79099 h 0.570508 v 3.47265 h -0.570508 z m 0,-1.35186 h 0.570508 v 0.72244 h -0.570508 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, 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;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
id="path5313"
inkscape:connector-curvature="0" />
<path
d="m 33.938127,179.16765 v 2.09599 h -0.570508 v -2.07739 q 0,-0.49299 -0.192236,-0.73794 -0.192236,-0.24495 -0.576709,-0.24495 -0.461987,0 -0.728638,0.29456 -0.26665,0.29455 -0.26665,0.80305 v 1.96267 h -0.573608 v -3.47265 h 0.573608 v 0.5395 q 0.204639,-0.31316 0.480591,-0.46819 0.279053,-0.15503 0.641821,-0.15503 0.598413,0 0.905371,0.37207 0.306958,0.36897 0.306958,1.08831 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, 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;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
id="path5315"
inkscape:connector-curvature="0" />
<path
d="m 36.654241,179.51801 q -0.691431,0 -0.958081,0.15813 -0.26665,0.15813 -0.26665,0.5395 0,0.30386 0.198437,0.48369 0.201538,0.17674 0.545703,0.17674 0.47439,0 0.759644,-0.33487 0.288354,-0.33796 0.288354,-0.89606 v -0.12713 z m 1.137915,-0.23564 v 1.98127 h -0.570508 v -0.5271 q -0.195337,0.31626 -0.486792,0.46819 -0.291455,0.14883 -0.713135,0.14883 -0.5333,0 -0.84956,-0.29766 -0.313159,-0.30075 -0.313159,-0.80305 0,-0.58601 0.390674,-0.88367 0.393774,-0.29765 1.172021,-0.29765 h 0.799951 v -0.0558 q 0,-0.39378 -0.260449,-0.60772 -0.257349,-0.21704 -0.725537,-0.21704 -0.297656,0 -0.57981,0.0713 -0.282153,0.0713 -0.542602,0.21394 v -0.52709 q 0.313159,-0.12093 0.607715,-0.17984 0.294555,-0.062 0.573608,-0.062 0.753442,0 1.125513,0.39067 0.37207,0.39068 0.37207,1.18443 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, 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;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
id="path5317"
inkscape:connector-curvature="0" />
<path
d="m 38.967278,176.43913 h 0.570508 v 4.82451 h -0.570508 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, 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;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
id="path5319"
inkscape:connector-curvature="0" />
</g>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.5833px;line-height:1.25;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#808a8a;fill-opacity:1;stroke:none;stroke-width:0.264583"
x="12.748299"
y="188.65312"
id="text845"><tspan
sodipodi:role="line"
id="tspan843"
x="12.748299"
y="188.65312"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93889px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, 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;fill:#808a8a;fill-opacity:1;stroke-width:0.264583">Host CV</tspan></text>
</g>
</svg>

+ 12
- 3
plugins/Cardinal/plugin.json View File

@@ -13,11 +13,20 @@
"changelogUrl": "",
"modules":
[
{
"slug": "HostCV",
"disabled": false,
"name": "Host CV",
"description": "Exposes host-provided CV ports in a module",
"tags": [
"Utility"
]
},
{
"slug": "HostParameters",
"disabled": false,
"name": "Host Parameters",
"description": "Exposes host-controlled plugin parameters as module",
"description": "Exposes host-controlled plugin parameters in a module",
"tags": [
"Utility"
]
@@ -26,7 +35,7 @@
"slug": "HostTime",
"disabled": false,
"name": "Host Time",
"description": "Exposes host-provided timing information as module",
"description": "Exposes host-provided time/transport information in a module",
"tags": [
"Utility"
]
@@ -53,7 +62,7 @@
"slug": "Ildaeil",
"disabled": false,
"name": "Ildaeil Plugin Host",
"description": "A plugin host within Cardinal for loading any FX",
"description": "A mini plugin host within Cardinal for loading any FX",
"tags": [
"Utility"
]


+ 170
- 0
plugins/Cardinal/res/HostCV.svg View File

@@ -0,0 +1,170 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
width="45.720001mm"
height="128.5mm"
viewBox="0 0 45.720001 128.5"
version="1.1"
id="svg4620"
inkscape:version="1.1.1 (c3084ef, 2021-09-22)"
sodipodi:docname="HostCV.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs4614">
<style
id="style6"
type="text/css">
.str0 {stroke:#565656;stroke-width:0.0966867}
.str1 {stroke:#4F4F4F;stroke-width:0.193345}
.fil0 {fill:none}
.fil2 {fill:#2B2A29}
.fil1 {fill:#6B6B6B}
</style>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.7"
inkscape:cx="62.142857"
inkscape:cy="166.42857"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1228"
inkscape:window-height="667"
inkscape:window-x="52"
inkscape:window-y="25"
inkscape:window-maximized="1"
inkscape:pagecheckerboard="0" />
<metadata
id="metadata4617">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-168.5)">
<g
style="fill-rule:evenodd"
id="g5299"
transform="matrix(6.342689,0,0,6.342689,5.4472535,175.6457)">
<g
transform="translate(-1.6191379e-5,-0.08553947)"
id="Layer_x0020_1"
inkscape:label="Layer 1">
<metadata
id="CorelCorpID_0Corel-Layer" />
<circle
style="fill:none;stroke:#ffffff;stroke-width:0.0966867;stroke-opacity:1"
id="circle10"
r="0.15916"
cy="0.61075097"
cx="0.525226"
class="fil0 str0" />
<circle
style="fill:none;stroke:#ffffff;stroke-width:0.193345;stroke-opacity:1"
id="circle12"
r="0.42853901"
cy="0.61075097"
cx="0.525226"
class="fil0 str1" />
</g>
</g>
<g
aria-label="Cardinal"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:1.25;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
id="text5303"
transform="translate(-0.09449404,0.14174107)">
<path
d="m 17.923601,176.99103 v 0.66043 q -0.31626,-0.29456 -0.675928,-0.44028 -0.356567,-0.14573 -0.759643,-0.14573 -0.79375,0 -1.21543,0.48679 -0.42168,0.48369 -0.42168,1.40146 0,0.91468 0.42168,1.40147 0.42168,0.48369 1.21543,0.48369 0.403076,0 0.759643,-0.14573 0.359668,-0.14572 0.675928,-0.44028 v 0.65422 q -0.328662,0.22325 -0.697632,0.33487 -0.365869,0.11162 -0.775146,0.11162 -1.051099,0 -1.655713,-0.64182 -0.604615,-0.64492 -0.604615,-1.75804 0,-1.11621 0.604615,-1.75803 0.604614,-0.64492 1.655713,-0.64492 0.415478,0 0.781347,0.11162 0.36897,0.10852 0.691431,0.32866 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, 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;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
id="path5305"
inkscape:connector-curvature="0" />
<path
d="m 20.444377,179.51801 q -0.69143,0 -0.958081,0.15813 -0.26665,0.15813 -0.26665,0.5395 0,0.30386 0.198437,0.48369 0.201538,0.17674 0.545703,0.17674 0.47439,0 0.759644,-0.33487 0.288355,-0.33796 0.288355,-0.89606 v -0.12713 z m 1.137915,-0.23564 v 1.98127 h -0.570507 v -0.5271 q -0.195337,0.31626 -0.486792,0.46819 -0.291456,0.14883 -0.713135,0.14883 -0.533301,0 -0.849561,-0.29766 -0.313159,-0.30075 -0.313159,-0.80305 0,-0.58601 0.390674,-0.88367 0.393774,-0.29765 1.172021,-0.29765 h 0.799952 v -0.0558 q 0,-0.39378 -0.26045,-0.60772 -0.257348,-0.21704 -0.725537,-0.21704 -0.297656,0 -0.579809,0.0713 -0.282154,0.0713 -0.542603,0.21394 v -0.52709 q 0.313159,-0.12093 0.607715,-0.17984 0.294556,-0.062 0.573608,-0.062 0.753443,0 1.125513,0.39067 0.37207,0.39068 0.37207,1.18443 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, 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;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
id="path5307"
inkscape:connector-curvature="0" />
<path
d="m 24.769695,178.32429 q -0.09612,-0.0558 -0.21084,-0.0806 -0.111621,-0.0279 -0.248047,-0.0279 -0.483691,0 -0.744141,0.31626 -0.257348,0.31315 -0.257348,0.90227 v 1.82934 H 22.73571 v -3.47265 h 0.573609 v 0.5395 q 0.179834,-0.31626 0.468188,-0.46819 0.288355,-0.15503 0.700733,-0.15503 0.05891,0 0.130224,0.009 0.07131,0.006 0.15813,0.0217 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, 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;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
id="path5309"
inkscape:connector-curvature="0" />
<path
d="m 27.541618,178.31808 v -1.87895 h 0.570508 v 4.82451 h -0.570508 v -0.5209 q -0.179834,0.31006 -0.455786,0.46199 -0.272851,0.14883 -0.657324,0.14883 -0.629419,0 -1.026294,-0.5023 -0.393774,-0.50229 -0.393774,-1.32085 0,-0.81855 0.393774,-1.32085 0.396875,-0.50229 1.026294,-0.50229 0.384473,0 0.657324,0.15193 0.275952,0.14883 0.455786,0.45888 z m -1.944067,1.21233 q 0,0.62942 0.257349,0.98909 0.260449,0.35657 0.713134,0.35657 0.452686,0 0.713135,-0.35657 0.260449,-0.35967 0.260449,-0.98909 0,-0.62942 -0.260449,-0.98598 -0.260449,-0.35967 -0.713135,-0.35967 -0.452685,0 -0.713134,0.35967 -0.257349,0.35656 -0.257349,0.98598 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, 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;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
id="path5311"
inkscape:connector-curvature="0" />
<path
d="m 29.287248,177.79099 h 0.570508 v 3.47265 h -0.570508 z m 0,-1.35186 h 0.570508 v 0.72244 h -0.570508 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, 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;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
id="path5313"
inkscape:connector-curvature="0" />
<path
d="m 33.938127,179.16765 v 2.09599 h -0.570508 v -2.07739 q 0,-0.49299 -0.192236,-0.73794 -0.192236,-0.24495 -0.576709,-0.24495 -0.461987,0 -0.728638,0.29456 -0.26665,0.29455 -0.26665,0.80305 v 1.96267 h -0.573608 v -3.47265 h 0.573608 v 0.5395 q 0.204639,-0.31316 0.480591,-0.46819 0.279053,-0.15503 0.641821,-0.15503 0.598413,0 0.905371,0.37207 0.306958,0.36897 0.306958,1.08831 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, 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;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
id="path5315"
inkscape:connector-curvature="0" />
<path
d="m 36.654241,179.51801 q -0.691431,0 -0.958081,0.15813 -0.26665,0.15813 -0.26665,0.5395 0,0.30386 0.198437,0.48369 0.201538,0.17674 0.545703,0.17674 0.47439,0 0.759644,-0.33487 0.288354,-0.33796 0.288354,-0.89606 v -0.12713 z m 1.137915,-0.23564 v 1.98127 h -0.570508 v -0.5271 q -0.195337,0.31626 -0.486792,0.46819 -0.291455,0.14883 -0.713135,0.14883 -0.5333,0 -0.84956,-0.29766 -0.313159,-0.30075 -0.313159,-0.80305 0,-0.58601 0.390674,-0.88367 0.393774,-0.29765 1.172021,-0.29765 h 0.799951 v -0.0558 q 0,-0.39378 -0.260449,-0.60772 -0.257349,-0.21704 -0.725537,-0.21704 -0.297656,0 -0.57981,0.0713 -0.282153,0.0713 -0.542602,0.21394 v -0.52709 q 0.313159,-0.12093 0.607715,-0.17984 0.294555,-0.062 0.573608,-0.062 0.753442,0 1.125513,0.39067 0.37207,0.39068 0.37207,1.18443 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, 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;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
id="path5317"
inkscape:connector-curvature="0" />
<path
d="m 38.967278,176.43913 h 0.570508 v 4.82451 h -0.570508 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, 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;fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
id="path5319"
inkscape:connector-curvature="0" />
</g>
<g
aria-label="Host CV"
id="text845"
style="font-size:10.5833px;line-height:1.25;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';letter-spacing:0px;word-spacing:0px;fill:#808a8a;stroke-width:0.264583">
<path
d="m 15.977387,188.65312 h -0.47749 v -1.75803 h -1.791795 v 1.75803 h -0.47749 v -3.59082 h 0.47749 v 1.40835 h 1.791795 v -1.40835 h 0.47749 z"
style="font-size:4.93889px"
id="path2358" />
<path
d="m 19.204065,187.30747 q 0,0.65836 -0.33762,1.03938 -0.337619,0.38103 -0.904338,0.38103 -0.571541,0 -0.909161,-0.38103 -0.335207,-0.38102 -0.335207,-1.03938 0,-0.65836 0.335207,-1.03939 0.33762,-0.38344 0.909161,-0.38344 0.566719,0 0.904338,0.38344 0.33762,0.38103 0.33762,1.03939 z m -0.467845,0 q 0,-0.52331 -0.204983,-0.77653 -0.204983,-0.25562 -0.56913,-0.25562 -0.368969,0 -0.573953,0.25562 -0.202571,0.25322 -0.202571,0.77653 0,0.50643 0.204983,0.76929 0.204983,0.26045 0.571541,0.26045 0.361735,0 0.566719,-0.25804 0.207394,-0.26045 0.207394,-0.7717 z"
style="font-size:4.93889px"
id="path2360" />
<path
d="m 21.832673,187.8766 q 0,0.36897 -0.306269,0.6053 -0.303858,0.23633 -0.831991,0.23633 -0.299034,0 -0.549837,-0.0699 -0.248392,-0.0724 -0.417202,-0.15675 v -0.50884 h 0.02412 q 0.21463,0.16157 0.47749,0.25803 0.262861,0.0941 0.504018,0.0941 0.299034,0 0.467844,-0.0965 0.16881,-0.0965 0.16881,-0.30386 0,-0.15916 -0.09164,-0.24115 -0.09164,-0.082 -0.352089,-0.13987 -0.09646,-0.0217 -0.253214,-0.0506 -0.154341,-0.0289 -0.282154,-0.0627 -0.3545,-0.0941 -0.504017,-0.27492 -0.147106,-0.18327 -0.147106,-0.44855 0,-0.16639 0.06752,-0.3135 0.06994,-0.14711 0.209806,-0.26286 0.135048,-0.11334 0.342443,-0.17846 0.209806,-0.0675 0.467844,-0.0675 0.241157,0 0.487137,0.0603 0.248391,0.0579 0.412378,0.14228 v 0.48473 h -0.02412 q -0.173633,-0.12782 -0.422024,-0.21463 -0.248392,-0.0892 -0.487137,-0.0892 -0.248391,0 -0.419613,0.0965 -0.171221,0.0941 -0.171221,0.28215 0,0.1664 0.103698,0.25081 0.101285,0.0844 0.327973,0.13746 0.125401,0.0289 0.279741,0.0579 0.156752,0.0289 0.26045,0.0531 0.315915,0.0724 0.487136,0.24839 0.171222,0.17846 0.171222,0.47267 z"
style="font-size:4.93889px"
id="path2362" />
<path
d="m 23.882505,188.62901 q -0.127813,0.0338 -0.279742,0.0555 -0.149517,0.0217 -0.267684,0.0217 -0.412378,0 -0.627007,-0.22187 -0.21463,-0.22186 -0.21463,-0.71141 v -1.43247 h -0.306269 v -0.38103 h 0.306269 v -0.77411 h 0.453375 v 0.77411 h 0.935688 v 0.38103 h -0.935688 v 1.22749 q 0,0.21221 0.0096,0.33279 0.0096,0.11817 0.06752,0.22187 0.05305,0.0965 0.144694,0.14228 0.09405,0.0434 0.284565,0.0434 0.110932,0 0.23151,-0.0314 0.120579,-0.0338 0.173633,-0.0555 h 0.02412 z"
style="font-size:4.93889px"
id="path2364" />
<path
d="m 28.978147,188.39267 q -0.132636,0.0579 -0.241156,0.10852 -0.106109,0.0506 -0.279742,0.10611 -0.147106,0.0458 -0.320739,0.0772 -0.171221,0.0338 -0.378616,0.0338 -0.390674,0 -0.711412,-0.10852 -0.318327,-0.11093 -0.554661,-0.34485 -0.23151,-0.2291 -0.361735,-0.58119 -0.130224,-0.3545 -0.130224,-0.82234 0,-0.44373 0.125401,-0.79341 0.125402,-0.34968 0.361735,-0.59083 0.229099,-0.23392 0.552249,-0.35691 0.325562,-0.12299 0.721059,-0.12299 0.289388,0 0.576364,0.0699 0.289388,0.0699 0.641477,0.24598 v 0.56672 h -0.03617 q -0.296623,-0.24839 -0.588423,-0.36174 -0.291799,-0.11334 -0.624596,-0.11334 -0.272507,0 -0.491959,0.0892 -0.217041,0.0868 -0.388263,0.27251 -0.166398,0.18086 -0.260449,0.45819 -0.09164,0.27492 -0.09164,0.63666 0,0.37861 0.101286,0.65112 0.103698,0.27251 0.265273,0.44373 0.168809,0.17845 0.393085,0.26527 0.226688,0.0844 0.477491,0.0844 0.344854,0 0.6463,-0.11817 0.301445,-0.11817 0.564306,-0.3545 h 0.03376 z"
style="font-size:4.93889px"
id="path2366" />
<path
d="m 32.489389,185.0623 -1.307069,3.59082 h -0.636654 l -1.30707,-3.59082 h 0.511253 l 1.126202,3.15915 1.126202,-3.15915 z"
style="font-size:4.93889px"
id="path2368" />
</g>
</g>
</svg>

+ 11
- 11
plugins/Cardinal/src/Carla.cpp View File

@@ -424,14 +424,6 @@ struct CarlaModuleWidget : ModuleWidget {
}
}

void drawTextLine(NVGcontext* const vg, const uint offset, const char* const text)
{
const float y = startY + offset * padding;
nvgBeginPath(vg);
nvgFillColor(vg, color::WHITE);
nvgText(vg, middleX, y + 16, text, nullptr);
}

void onContextCreate(const ContextCreateEvent& e) override
{
ModuleWidget::onContextCreate(e);
@@ -456,6 +448,14 @@ struct CarlaModuleWidget : ModuleWidget {
ModuleWidget::onContextDestroy(e);
}

void drawTextLine(NVGcontext* const vg, const uint offset, const char* const text)
{
const float y = startY + offset * padding;
nvgBeginPath(vg);
nvgFillColor(vg, color::WHITE);
nvgText(vg, middleX, y + 16, text, nullptr);
}

void draw(const DrawArgs& args) override
{
nvgBeginPath(args.vg);
@@ -511,18 +511,18 @@ struct CarlaModuleWidget : ModuleWidget {
[=]() {showUI();}
));

menu->addChild(createCheckMenuItem("Bipolar Inputs", "",
menu->addChild(createCheckMenuItem("Bipolar CV Inputs", "",
[=]() {return module->params[CarlaModule::BIPOLAR_INPUTS].getValue() > 0.1f;},
[=]() {module->params[CarlaModule::BIPOLAR_INPUTS].setValue(1.0f - module->params[CarlaModule::BIPOLAR_INPUTS].getValue());}
));

menu->addChild(createCheckMenuItem("Bipolar Outputs", "",
menu->addChild(createCheckMenuItem("Bipolar CV Outputs", "",
[=]() {return module->params[CarlaModule::BIPOLAR_OUTPUTS].getValue() > 0.1f;},
[=]() {module->params[CarlaModule::BIPOLAR_OUTPUTS].setValue(1.0f - module->params[CarlaModule::BIPOLAR_OUTPUTS].getValue());}
));
}

void onDoubleClick(const DoubleClickEvent& e)
void onDoubleClick(const DoubleClickEvent& e) override
{
e.consume(this);
showUI();


+ 172
- 0
plugins/Cardinal/src/HostCV.cpp View File

@@ -0,0 +1,172 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the LICENSE file.
*/

#include "plugincontext.hpp"

// -----------------------------------------------------------------------------------------------------------

USE_NAMESPACE_DISTRHO;

struct HostCV : Module {
enum ParamIds {
BIPOLAR_INPUTS,
BIPOLAR_OUTPUTS,
NUM_PARAMS
};
enum InputIds {
NUM_INPUTS = 10
};
enum OutputIds {
NUM_OUTPUTS = 10
};
enum LightIds {
NUM_LIGHTS
};

HostCV()
{
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
configParam<SwitchQuantity>(BIPOLAR_INPUTS, 0.f, 1.f, 1.f, "Bipolar Inputs")->randomizeEnabled = false;
configParam<SwitchQuantity>(BIPOLAR_OUTPUTS, 0.f, 1.f, 1.f, "Bipolar Outputs")->randomizeEnabled = false;

CardinalPluginContext* const pcontext = reinterpret_cast<CardinalPluginContext*>(APP);

if (pcontext == nullptr)
throw rack::Exception("Plugin context is null.");

if (pcontext->loadedHostCV)
throw rack::Exception("Another instance of a Host CV module is already loaded, only one can be used at a time.");

pcontext->loadedHostCV = true;
}

~HostCV() override
{
CardinalPluginContext* const pcontext = reinterpret_cast<CardinalPluginContext*>(APP);
DISTRHO_SAFE_ASSERT_RETURN(pcontext != nullptr,);

pcontext->loadedHostCV = false;
}

void process(const ProcessArgs&) override
{
if (CardinalPluginContext* const pcontext = reinterpret_cast<CardinalPluginContext*>(APP))
{
const float** dataIns = pcontext->dataIns;
float** dataOuts = pcontext->dataOuts;

if (dataIns == nullptr || dataOuts == nullptr)
return;

const uint32_t dataFrame = pcontext->dataFrame++;
const float inputOffset = params[BIPOLAR_INPUTS].getValue() > 0.1f ? 5.0f : 0.0f;
const float outputOffset = params[BIPOLAR_OUTPUTS].getValue() > 0.1f ? 5.0f : 0.0f;

for (int i=0; i<10; ++i)
{
outputs[i].setVoltage(dataIns[i+2][dataFrame] - inputOffset);
dataOuts[i+2][dataFrame] = inputs[i].getVoltage() + outputOffset;
}
}
}
};

struct HostCVWidget : ModuleWidget {
static constexpr const float startX_In = 14.0f;
static constexpr const float startX_Out = 96.0f;
static constexpr const float startY = 74.0f;
static constexpr const float padding = 29.0f;
static constexpr const float middleX = startX_In + (startX_Out - startX_In) * 0.5f + padding * 0.25f;

HostCVWidget(HostCV* const module)
{
setModule(module);
setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/HostCV.svg")));

addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, 0)));
addChild(createWidget<ScrewBlack>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0)));
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
addChild(createWidget<ScrewBlack>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));

for (uint i=0; i<HostCV::NUM_INPUTS; ++i)
addInput(createInput<PJ301MPort>(Vec(startX_In, startY + padding * i), module, i));

for (uint i=0; i<HostCV::NUM_OUTPUTS; ++i)
addOutput(createOutput<PJ301MPort>(Vec(startX_Out, startY + padding * i), module, i));
}

void drawTextLine(NVGcontext* const vg, const uint offset, const char* const text)
{
const float y = startY + offset * padding;
nvgBeginPath(vg);
nvgFillColor(vg, color::WHITE);
nvgText(vg, middleX, y + 16, text, nullptr);
}

void draw(const DrawArgs& args) override
{
nvgBeginPath(args.vg);
nvgRect(args.vg, 0, 0, box.size.x, box.size.y);
nvgFillPaint(args.vg, nvgLinearGradient(args.vg, 0, 0, 0, box.size.y,
nvgRGB(0x18, 0x19, 0x19), nvgRGB(0x21, 0x22, 0x22)));
nvgFill(args.vg);

nvgFontFaceId(args.vg, 0);
nvgFontSize(args.vg, 11);
nvgTextAlign(args.vg, NVG_ALIGN_CENTER);
// nvgTextBounds(vg, 0, 0, text, nullptr, nullptr);

nvgBeginPath(args.vg);
nvgRoundedRect(args.vg, startX_Out - 4.0f, startY - 2.0f, padding, padding * HostCV::NUM_INPUTS, 4);
nvgFillColor(args.vg, nvgRGB(0xd0, 0xd0, 0xd0));
nvgFill(args.vg);

drawTextLine(args.vg, 0, "CV 1");
drawTextLine(args.vg, 1, "CV 2");
drawTextLine(args.vg, 2, "CV 3");
drawTextLine(args.vg, 3, "CV 4");
drawTextLine(args.vg, 4, "CV 5");
drawTextLine(args.vg, 5, "CV 6");
drawTextLine(args.vg, 6, "CV 7");
drawTextLine(args.vg, 7, "CV 8");
drawTextLine(args.vg, 8, "CV 9");
drawTextLine(args.vg, 9, "CV 10");

ModuleWidget::draw(args);
}

void appendContextMenu(ui::Menu* const menu) override
{
menu->addChild(new ui::MenuSeparator);

menu->addChild(createCheckMenuItem("Bipolar Inputs", "",
[=]() {return module->params[HostCV::BIPOLAR_INPUTS].getValue() > 0.1f;},
[=]() {module->params[HostCV::BIPOLAR_INPUTS].setValue(1.0f - module->params[HostCV::BIPOLAR_INPUTS].getValue());}
));

menu->addChild(createCheckMenuItem("Bipolar Outputs", "",
[=]() {return module->params[HostCV::BIPOLAR_OUTPUTS].getValue() > 0.1f;},
[=]() {module->params[HostCV::BIPOLAR_OUTPUTS].setValue(1.0f - module->params[HostCV::BIPOLAR_OUTPUTS].getValue());}
));
}
};

// --------------------------------------------------------------------------------------------------------------------

Model* modelHostCV = createModel<HostCV, HostCVWidget>("HostCV");

// --------------------------------------------------------------------------------------------------------------------

+ 2
- 1
plugins/Cardinal/src/plugin.hpp View File

@@ -29,6 +29,7 @@ extern Plugin* pluginInstance;

extern Model* modelCarla;
extern Model* modelGlBars;
extern Model* modelIldaeil;
extern Model* modelHostCV;
extern Model* modelHostParameters;
extern Model* modelHostTime;
extern Model* modelIldaeil;

+ 4
- 1
plugins/Cardinal/src/plugincontext.hpp View File

@@ -33,12 +33,15 @@ struct CardinalPluginContext : rack::Context {
uint32_t bufferSize;
double sampleRate;
float parameters[kModuleParameters];
bool playing, reset, bbtValid;
bool playing, reset, bbtValid, loadedHostCV;
int32_t bar, beat, beatsPerBar, beatType;
uint64_t frame;
double barStartTick, beatsPerMinute;
double tick, tickClock, ticksPerBeat, ticksPerClock, ticksPerFrame;
uintptr_t nativeWindowId;
uint32_t dataFrame;
const float** dataIns;
float** dataOuts;
Plugin* const plugin;
CardinalPluginContext(Plugin* const p);
};


+ 1
- 0
plugins/Makefile View File

@@ -179,6 +179,7 @@ PLUGIN_FILES = plugins.cpp

PLUGIN_FILES += Cardinal/src/Carla.cpp
PLUGIN_FILES += Cardinal/src/glBars.cpp
PLUGIN_FILES += Cardinal/src/HostCV.cpp
PLUGIN_FILES += Cardinal/src/HostParameters.cpp
PLUGIN_FILES += Cardinal/src/HostTime.cpp
PLUGIN_FILES += Cardinal/src/Ildaeil.cpp


+ 2
- 1
plugins/plugins.cpp View File

@@ -407,9 +407,10 @@ static void initStatic__Cardinal()
{
p->addModel(modelCarla);
p->addModel(modelGlBars);
p->addModel(modelIldaeil);
p->addModel(modelHostCV);
p->addModel(modelHostParameters);
p->addModel(modelHostTime);
p->addModel(modelIldaeil);
}
}



+ 6
- 0
src/CardinalPlugin.cpp View File

@@ -875,6 +875,12 @@ protected:
#endif
}
#if DISTRHO_PLUGIN_NUM_OUTPUTS != 2
context->dataFrame = 0;
context->dataIns = inputs;
context->dataOuts = outputs;
#endif
context->engine->stepBlock(frames);
if (fCurrentAudioDevice != nullptr)


+ 8
- 1
src/PluginContext.hpp View File

@@ -40,12 +40,15 @@ struct CardinalPluginContext : rack::Context {
uint32_t bufferSize;
double sampleRate;
float parameters[kModuleParameters];
bool playing, reset, bbtValid;
bool playing, reset, bbtValid, loadedHostCV;
int32_t bar, beat, beatsPerBar, beatType;
uint64_t frame;
double barStartTick, beatsPerMinute;
double tick, tickClock, ticksPerBeat, ticksPerClock, ticksPerFrame;
uintptr_t nativeWindowId;
uint32_t dataFrame;
const float** dataIns;
float** dataOuts;
Plugin* const plugin;

CardinalPluginContext(Plugin* const p)
@@ -54,6 +57,7 @@ struct CardinalPluginContext : rack::Context {
playing(false),
reset(false),
bbtValid(false),
loadedHostCV(false),
bar(1),
beat(1),
beatsPerBar(4),
@@ -67,6 +71,9 @@ struct CardinalPluginContext : rack::Context {
ticksPerClock(0.0),
ticksPerFrame(0.0),
nativeWindowId(0),
dataFrame(0),
dataIns(nullptr),
dataOuts(nullptr),
plugin(p)
{
std::memset(parameters, 0, sizeof(parameters));


Loading…
Cancel
Save