mosaicode/extensions/javascript/blocks/webaudio/Conversion/Char 2 Float.json

49 lines
1.4 KiB
JSON

{
"source": "JSON",
"data": "BLOCK",
"version": "0.0.1",
"type": "javascript.conversion.char2float",
"language": "javascript",
"extension": "webaudio",
"help": "Char to Float",
"label": "Char 2 Float",
"color": "#200200",
"group": "Conversion",
"codes": [
{
"name": "declaration",
"code": "\n// block_$id$ = Char 2 Float\nvar $port[float_output]$ = [];\nvar $port[char_input]$ = function(value){\n if (value != '$prop[char]$')\n return true;\n for (var i = 0; i < $port[float_output]$.length ; i++){\n $port[float_output]$[i]($prop[float]$);\n }\n return true;\n };\n"
}
],
"properties": [
{
"name": "float",
"label": "Output float",
"type": "Float",
"lower": 0,
"upper": 20000,
"step": 1,
"value": 60
},
{
"name": "char",
"label": "Input Char",
"type": "String",
"value": "a"
}
],
"ports": [
{
"conn_type": "input",
"name": "char_input",
"label": "Char Input",
"type": "javascript.char"
},
{
"conn_type": "output",
"name": "float_output",
"label": "Float Output",
"type": "javascript.float"
}
]
}