mosaicode/extensions/javascript/blocks/webaudio/Interface/Increment.json

58 lines
1.7 KiB
JSON

{
"source": "JSON",
"data": "BLOCK",
"version": "0.0.1",
"type": "javascript.arithmetics.inc",
"language": "javascript",
"extension": "webaudio",
"help": "Increment",
"label": "Increment",
"color": "#24C1D3",
"group": "Interface",
"codes": [
{
"name": "declaration",
"code": "\n// block_$id$ = $label$\nvar block_$id$_value = $prop[value]$;\nvar block_$id$_step = $prop[step]$;\nvar $port[float]$ = [];\n\nvar $port[count]$ = function(value){\n block_$id$_value += block_$id$_step;\n for (var i = 0; i < $port[float]$.length ; i++){\n $port[float]$[i](block_$id$_value);\n }\n return true;\n };\n\nvar $port[value]$ = function(value){\n block_$id$_value = value;\n return true;\n };\n\n"
}
],
"properties": [
{
"name": "value",
"label": "Value",
"type": "Float",
"lower": 0,
"upper": 20000,
"step": 1,
"value": 1
},
{
"name": "step",
"label": "Step",
"type": "Float",
"lower": -20000,
"upper": 20000,
"step": 1,
"value": 1
}
],
"ports": [
{
"conn_type": "output",
"name": "float",
"label": "Float",
"type": "javascript.float"
},
{
"conn_type": "input",
"name": "count",
"label": "Count",
"type": "javascript.float"
},
{
"conn_type": "input",
"name": "value",
"label": "Value",
"type": "javascript.float"
}
]
}