Copy from Alexandre repository

This commit is contained in:
fls committed 2026-09-17 18:13:02 -03:00
commit 355594d3c8
102 files changed
+5948

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
{
"source": "JSON",
"data": "BLOCK",
"version": "0.0.1",
"type": "bool2float",
"language": "javascript",
"extension": "webaudio",
"help": "Bool to Float",
"label": "Bool 2 Float",
"color": "200:200:25:150",
"group": "Conversion",
"codes": {
"declaration": "\nvar $port[float_output]$ = [];\nvar $port[bool_input]$ = function(value) {\n var ret = value ? 1.0 : 0.0;\n for (var i = 0; i < $port[float_output]$.length ; i++){\n $port[float_output]$[i](ret);\n }\n return true;\n};\n"
},
"properties": [],
"ports": [
{
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.bool",
"label": "Bool Input",
"conn_type": "Input",
"name": "bool_input"
},
{
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.float",
"label": "Float Output",
"conn_type": "Output",
"name": "float_output"
}
]
}
+46
View File
@@ -0,0 +1,46 @@
{
"source": "JSON",
"data": "BLOCK",
"version": "0.0.1",
"type": "char2float",
"language": "javascript",
"extension": "webaudio",
"help": "Char to Float",
"label": "Char 2 Float",
"color": "200:200:25:150",
"group": "Conversion",
"codes": {
"declaration": "\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": [
{
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.char",
"label": "Char Input",
"conn_type": "Input",
"name": "char_input"
},
{
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.float",
"label": "Float Output",
"conn_type": "Output",
"name": "float_output"
}
]
}
+42
View File
@@ -0,0 +1,42 @@
{
"source": "JSON",
"data": "BLOCK",
"version": "0.0.1",
"type": "rgb",
"language": "javascript",
"extension": "webaudio",
"help": "Creates RGB Color",
"label": "RGB",
"color": "50:150:0:150",
"group": "Conversion",
"codes": {
"declaration": "\n// $label$\nvar r$id$ = '00';\nvar g$id$ = '00';\nvar b$id$ = '00';\nvar $port[result]$ = [];\n\nfunction update_backgroud_color$id$(){\n result = '#' + r$id$ + g$id$ + b$id$;\n for (var i = 0; i < $port[result]$.length ; i++){\n $port[result]$[i](result);\n }\n}\n\nvar $port[r]$ = function(value){\n value = Math.round(value);\n r$id$ = value.toString(16);\n if (value < 16)\n r$id$ = '0'+ r$id$;\n update_backgroud_color$id$();\n return true;\n };\n\nvar $port[g]$ = function(value){\n value = Math.round(value);\n g$id$ = value.toString(16);\n if (value < 16)\n g$id$ = '0'+ g$id$;\n update_backgroud_color$id$();\n return true;\n };\n\nvar $port[b]$ = function(value){\n value = Math.round(value);\n b$id$ = value.toString(16);\n if (value < 16)\n b$id$ = '0'+ b$id$;\n update_backgroud_color$id$();\n return true;\n };\n\n"
},
"properties": [],
"ports": [
{
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.float",
"name": "r",
"conn_type": "Input",
"label": "Red"
},
{
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.float",
"name": "g",
"conn_type": "Input",
"label": "Green"
},
{
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.float",
"name": "b",
"conn_type": "Input",
"label": "Blue"
},
{
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.color",
"name": "result",
"conn_type": "Output",
"label": "Color"
}
]
}