98 lines
2.7 KiB
JSON
98 lines
2.7 KiB
JSON
{
|
|
"source": "JSON",
|
|
"data": "BLOCK",
|
|
"version": "0.0.1",
|
|
"type": "filter",
|
|
"language": "javascript",
|
|
"extension": "webaudio",
|
|
"help": "Filter",
|
|
"label": "Filter",
|
|
"color": "50:150:50:150",
|
|
"group": "Sound",
|
|
"codes": {
|
|
"declaration": "\n\n// block_$id$ = $label$\nvar block_$id$ = context.createBiquadFilter();\nvar $port[osc_freq]$ = block_$id$.frequency;\nblock_$id$.type = '$prop[type]$';\nblock_$id$.frequency.value = '$prop[freq]$';\nblock_$id$.gain.value = $prop[gain]$;\nblock_$id$.Q.value = $prop[Q]$;\n\nvar $port[freq]$ = function(value){\n block_$id$.frequency.value = parseFloat(value);\n return true;\n };\n\nvar $port[q]$ = function(value){\n block_$id$.Q.value = parseFloat(value);\n return true;\n };\n\nvar $port[gain]$ = function(value){\n block_$id$.gain.value = parseFloat(value);\n return true;\n };\n\nvar $port[sound_input]$ = block_$id$;\nvar $port[output]$ = block_$id$;\n"
|
|
},
|
|
"properties": [
|
|
{
|
|
"name": "type",
|
|
"label": "Type",
|
|
"type": "Combo",
|
|
"values": [
|
|
"allpass",
|
|
"bandpass",
|
|
"highshelf",
|
|
"highpass",
|
|
"lowpass",
|
|
"lowshelf",
|
|
"notch",
|
|
"peaking"
|
|
],
|
|
"value": "highpass"
|
|
},
|
|
{
|
|
"name": "freq",
|
|
"label": "Frequency",
|
|
"type": "Float",
|
|
"lower": 0,
|
|
"upper": 48000,
|
|
"step": 1,
|
|
"value": 200
|
|
},
|
|
{
|
|
"name": "gain",
|
|
"label": "Gain",
|
|
"type": "Float",
|
|
"lower": 0,
|
|
"upper": 100,
|
|
"step": 0.1,
|
|
"value": 1
|
|
},
|
|
{
|
|
"name": "Q",
|
|
"label": "Q",
|
|
"type": "Float",
|
|
"lower": 0,
|
|
"upper": 48000,
|
|
"step": 1,
|
|
"value": 200
|
|
}
|
|
],
|
|
"ports": [
|
|
{
|
|
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.sound",
|
|
"name": "sound_input",
|
|
"conn_type": "Input",
|
|
"label": "Sound"
|
|
},
|
|
{
|
|
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.sound",
|
|
"label": "Frequency",
|
|
"conn_type": "Input",
|
|
"name": "osc_freq"
|
|
},
|
|
{
|
|
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.float",
|
|
"name": "freq",
|
|
"conn_type": "Input",
|
|
"label": "Frequency"
|
|
},
|
|
{
|
|
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.float",
|
|
"name": "gain",
|
|
"conn_type": "Input",
|
|
"label": "Gain"
|
|
},
|
|
{
|
|
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.float",
|
|
"name": "q",
|
|
"conn_type": "Input",
|
|
"label": "Q"
|
|
},
|
|
{
|
|
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.sound",
|
|
"label": "Sound",
|
|
"conn_type": "Output",
|
|
"name": "output"
|
|
}
|
|
]
|
|
} |