You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
610B

  1. // Simplest possible script using all variables
  2. // by Andrew Belt
  3. function process(block) {
  4. // Loop through each column
  5. for (let i = 0; i < 6; i++) {
  6. // Get input
  7. let x = block.inputs[i][0]
  8. // Get gain knob
  9. let gain = block.knobs[i]
  10. // Apply gain to input
  11. let y = x * gain
  12. // Set gain light (red = 0)
  13. block.lights[i][0] = gain
  14. // Check mute switch
  15. if (block.switches[i]) {
  16. // Mute output
  17. y = 0
  18. // Enable mute light (red = 0)
  19. block.switchLights[i][0] = 1
  20. }
  21. else {
  22. // Disable mute light
  23. block.switchLights[i][0] = 0
  24. }
  25. // Set output
  26. block.outputs[i][0] = y
  27. }
  28. }