now with minimum and maximum
This commit is contained in:
parent
4a7cbd79ab
commit
2cb60340d0
@ -19,8 +19,14 @@
|
|||||||
{{?p.direction == "input"}}lv2:InputPort{{??}}lv2:OutputPort{{?}} ;
|
{{?p.direction == "input"}}lv2:InputPort{{??}}lv2:OutputPort{{?}} ;
|
||||||
lv2:name "{{=p.name}}" ;
|
lv2:name "{{=p.name}}" ;
|
||||||
lv2:symbol "{{=p.symbol}}" ;
|
lv2:symbol "{{=p.symbol}}" ;
|
||||||
{{?p.defaultValue}}
|
{{?"defaultValue" in p}}
|
||||||
lv2:default {{=p.defaultValue.toExponential()}} ;
|
lv2:default {{=p.defaultValue.toExponential()}} ;
|
||||||
|
{{?}}
|
||||||
|
{{?"minimum" in p}}
|
||||||
|
lv2:minimum {{=p.minimum.toExponential()}} ;
|
||||||
|
{{?}}
|
||||||
|
{{?"maximum" in p}}
|
||||||
|
lv2:maximum {{=p.maximum.toExponential()}} ;
|
||||||
{{?}}
|
{{?}}
|
||||||
lv2:index {{=i}}
|
lv2:index {{=i}}
|
||||||
{{?i < it.tibia.lv2.ports.length - 1}}
|
{{?i < it.tibia.lv2.ports.length - 1}}
|
||||||
|
@ -41,7 +41,13 @@ module.exports = function (data, api) {
|
|||||||
|
|
||||||
for (var i = 0; i < data.product.parameters.length; i++) {
|
for (var i = 0; i < data.product.parameters.length; i++) {
|
||||||
var p = data.product.parameters[i];
|
var p = data.product.parameters[i];
|
||||||
var e = { type: "control", direction: p.direction, name: p.name, defaultValue: p.defaultValue };
|
var e = { type: "control", direction: p.direction, name: p.name };
|
||||||
|
if ("defaultValue" in p)
|
||||||
|
e.defaultValue = p.defaultValue;
|
||||||
|
if ("minimum" in p)
|
||||||
|
e.minimum = p.minimum;
|
||||||
|
if ("maximum" in p)
|
||||||
|
e.maximum = p.maximum;
|
||||||
e.symbol = getSymbol(p.shortName);
|
e.symbol = getSymbol(p.shortName);
|
||||||
data.tibia.lv2.ports.push(e);
|
data.tibia.lv2.ports.push(e);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"lv2": {
|
"lv2": {
|
||||||
"prefixes": {
|
"prefixes": {
|
||||||
"example": "https://www.example.com/"
|
"example": "http://www.example.com/"
|
||||||
},
|
},
|
||||||
"uri": "@example:tibia_test",
|
"uri": "@example:tibia_test",
|
||||||
"project": "@example:project",
|
"project": "@example:project",
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#include <math.h>
|
||||||
|
|
||||||
typedef struct plugin {
|
typedef struct plugin {
|
||||||
float gain;
|
float gain;
|
||||||
char bypass;
|
char bypass;
|
||||||
@ -29,7 +31,7 @@ void plugin_set_parameter(plugin *instance, size_t index, float value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void plugin_process(plugin *instance, const float **inputs, float **outputs, size_t n_samples) {
|
void plugin_process(plugin *instance, const float **inputs, float **outputs, size_t n_samples) {
|
||||||
for (size_t i = 0; i < n_samples; i++) {
|
const float g = instance->bypass ? 1.f : powf(10.f, 0.05f * instance->gain);
|
||||||
outputs[0][i] = instance->bypass ? inputs[0][i] : instance->gain * inputs[0][i];
|
for (size_t i = 0; i < n_samples; i++)
|
||||||
}
|
outputs[0][i] = g * inputs[0][i];
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,9 @@
|
|||||||
"steps": 0,
|
"steps": 0,
|
||||||
"direction": "input",
|
"direction": "input",
|
||||||
"isBypass": false,
|
"isBypass": false,
|
||||||
"defaultValue": 1.0
|
"defaultValue": 0.0,
|
||||||
|
"minimum": -60.0,
|
||||||
|
"maximum": 12.0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Bypass",
|
"name": "Bypass",
|
||||||
@ -39,7 +41,9 @@
|
|||||||
"steps": 1,
|
"steps": 1,
|
||||||
"direction": "input",
|
"direction": "input",
|
||||||
"isBypass": true,
|
"isBypass": true,
|
||||||
"defaultValue": 0.0
|
"defaultValue": 0.0,
|
||||||
|
"minimum": 0,
|
||||||
|
"maximum": 1
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user