From be8ecaad1bf19b49602f24fbc5d9bd2605117341 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Thu, 16 Jul 2020 07:36:24 -0400 Subject: [PATCH] Make block/sample inputs/outputs a bit more clear in the script template. --- examples/template.js | 16 ++++++++++------ examples/template.lua | 16 ++++++++++------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/examples/template.js b/examples/template.js index 10ff4b7..8d8b090 100644 --- a/examples/template.js +++ b/examples/template.js @@ -2,15 +2,19 @@ config.frameDivider = 1 config.bufferSize = 32 function process(block) { + // Per-block inputs: + // block.knobs[i] + // block.switches[i] + for (let j = 0; j < block.bufferSize; j++) { - // Inputs + // Per-sample inputs: // block.inputs[i][j] - // block.knobs[i] - // block.switches[i] - // Outputs + // Per-sample outputs: // block.outputs[i][j] - // block.lights[i][color] - // block.switchLights[i][color] } + + // Per-block outputs: + // block.lights[i][color] + // block.switchLights[i][color] } diff --git a/examples/template.lua b/examples/template.lua index 302d33f..39c908a 100644 --- a/examples/template.lua +++ b/examples/template.lua @@ -2,15 +2,19 @@ config.frameDivider = 1 config.bufferSize = 32 function process(block) + -- Per-block inputs: + -- block.knobs[i] + -- block.switches[i] + for j=1,block.bufferSize do - -- Inputs + -- Per-sample inputs: -- block.inputs[i][j] - -- block.knobs[i] - -- block.switches[i] - -- Outputs + -- Per-sample outputs: -- block.outputs[i][j] - -- block.lights[i][color] - -- block.switchLights[i][color] end + + -- Per-block outputs: + -- block.lights[i][color] + -- block.switchLights[i][color] end