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.

35 lines
731B

  1. -- Simplest possible script using all variables, demonstrating buffering
  2. -- by Andrew Belt
  3. config.frameDivider = 1
  4. config.bufferSize = 32
  5. function process(block)
  6. -- Loop through each column
  7. for i=1,6 do
  8. -- Get gain knob
  9. gain = block.knobs[i]
  10. -- Set gain light (red = 1)
  11. block.lights[i][1] = gain
  12. -- Check mute switch
  13. if block.switches[i] then
  14. -- Mute output
  15. gain = 0
  16. -- Enable mute light (red = 1)
  17. block.switchLights[i][1] = 1
  18. else
  19. -- Disable mute light
  20. block.switchLights[i][1] = 0
  21. end
  22. -- Iterate input/output buffer
  23. for j=1,block.bufferSize do
  24. -- Get input
  25. x = block.inputs[i][j]
  26. -- Apply gain to input
  27. y = x * gain
  28. -- Set output
  29. block.outputs[i][j] = y
  30. end
  31. end
  32. end