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
1.5KB

  1. /*
  2. All controllers of the VCV Prototype are accessed using metadata.
  3. */
  4. import("stdfaust.lib");
  5. import("rack.lib");
  6. // Using knobs ([knob:N] metadata with N from 1 to 6). Knob [0..1] range is mapped on [min..max] slider range, taking 'scale' metadata in account
  7. vol1 = hslider("volume1 [knob:1]", 0.1, 0, 1, 0.01);
  8. freq1 = hslider("freq1 [knob:2] [unit:Hz] [scale:lin]", 300, 200, 300, 1);
  9. vol2 = hslider("volume2 [knob:3]", 0.1, 0, 1, 0.01);
  10. freq2 = hslider("freq2 [knob:4] [unit:Hz] ", 300, 200, 300, 1);
  11. // Using switches ([switch:N] metadata with N from 1 to 6)
  12. gate = button("gate [switch:1]") : vbargraph("[switchlight_red:1]", 0, 1);
  13. // Checkbox can be used, the switch button will be white when checked
  14. check = checkbox("check [switch:2]")
  15. : vbargraph("[switchlight_red:2]", 0, 1)
  16. : vbargraph("[switchlight_green:2]", 0, 1)
  17. : vbargraph("[switchlight_blue:2]", 0, 1);
  18. // Using bargraph to control lights ([light_red:N|light_green:N|light_blue:N] metadata with N from 1 to 6, to control 3 colors)
  19. l_red(i) = vbargraph("[light_red:%i]", 0, 1);
  20. l_green(i) = vbargraph("[light_green:%i]", 0, 1);
  21. l_blue(i) = vbargraph("[light_blue:%i]", 0, 1);
  22. // Using bargraph to control switchlights ([switchlight_red:N|switchlight_green:N|switchlight_blue:N] metadata with N from 1 to 6, to control 3 colors)
  23. swl_red(i) = vbargraph("[switchlight_red:%i]", 0, 1);
  24. swl_green(i) = vbargraph("[switchlight_green:%i]", 0, 1);
  25. swl_blue(i) = vbargraph("[switchlight_blue:%i]", 0, 1);
  26. process = os.osc(freq1) * vol1, os.sawtooth(freq2) * vol2 * gate, os.square(freq2) * vol2 * check;