3_effects_integration.scd 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. (
  2. //PUT HERE THE NUMBER OF POLYPHONY VOICES
  3. var nbVoices = 16;
  4. //PUT HERE THE PATH TO THE JUCE VST3 PLUGIN
  5. var vst3Path = "";
  6. // LFO Synth
  7. ~lfo = Synth(\lfo, [\out, ~lfoBus.index]);
  8. // Synth array for voice allocation
  9. ~synths = Array.fill(nbVoices, {
  10. Synth(\rgbSynth, [\out, ~bus, \lfoBus, ~lfoBus.index], target: ~synthGroup, addAction: \addToTail)
  11. });
  12. // Filter envelope
  13. ~filterEnv = Synth(\filterEnv, [\out, ~filterEnvBus.index]);
  14. // Array to keep in memory active synths (i.e. active notes)
  15. ~activeNotes = Array.fill(nbVoices, { nil });
  16. // Function to modify a parameter for all synths
  17. ~setSynthsParam = { |param, value|
  18. ~synths.do { |synth|
  19. synth.set(param, value);
  20. };
  21. };
  22. ~filter = Synth(\lpf, [
  23. \in, ~bus,
  24. \out, ~fxBus,
  25. \lfoBus, ~lfoBus.index,
  26. \envBus, ~filterEnvBus.index
  27. ], target: ~filterGroup, addAction: \addToTail);
  28. ~vst = Synth(\juceVST, [\in, ~fxBus, \out, 0], addAction: \addToTail);
  29. ~ctl = VSTPluginController(~vst);
  30. // Open the JUCE plugin as a VST3
  31. ~ctl.open(vst3Path, info: true, verbose: true, editor: true);
  32. //~ctl.editor;
  33. "Voice allocation arrays loaded".postln
  34. )
  35. //~setSynthsParam.(\lfoDepth, 0.05);
  36. //~filter.set(\cutoff, 10000, \resonance, 0, \lfoDepth, 2, \envDepth, 0);
  37. //~filterEnv.set(\attack, 0, \decay, 0, \sustain, 0);