From 3cfebdf982f5c63208ef2274637c51d6f5c30be5 Mon Sep 17 00:00:00 2001 From: Pete Shadbolt Date: Mon, 3 May 2021 19:55:11 -0700 Subject: [PATCH] Nice, nice --- audio.scd | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/audio.scd b/audio.scd index c0447ba..15e0230 100644 --- a/audio.scd +++ b/audio.scd @@ -10,7 +10,7 @@ s.waitForBoot { // Create the synth definition and load it module = SynthDef.new("module", { - arg hue, saturation, value, pan; + arg hue, saturation, value, pan, gain; var oscillator, noise, filter, panner, mixer, frequency, qfactor, noise_level, osc_level; // Calculate some parameters @@ -24,7 +24,7 @@ s.waitForBoot { filter = BPF.ar(noise, frequency, qfactor) * noise_level; oscillator = SinOsc.ar(frequency) * osc_level; mixer = Mix.ar([filter, oscillator]); - panner = LinPan2.ar(mixer, 2*pan - 1, value); + panner = LinPan2.ar(mixer, 2*pan - 1, gain); Out.ar(0, panner); }); module.load(s); @@ -32,17 +32,14 @@ s.waitForBoot { modules = []; - modules.add(Synth.new("module", [\hue, 0.5, \saturation, 0.9, \value, 0.5, \pan, 0.5])); - modules.add(Synth.new("module", [\hue, 0.9, \saturation, 0.9, \value, 0.5, \pan, 0.5])); - - // Make a sound - // modules = []; - // 5.do({ - // arg index; - // var synth; - // synth = Synth.new("module", [\hue, 0.5, \saturation, 0.1, \value, 0.5, \pan, 0.5]); - // modules.add(synth); - // }); + // Create multiple sound generators + modules = []; + 5.do({ + arg index; + var synth; + synth = Synth.new("module", [\hue, 0.5, \saturation, 0.1, \value, 0.5, \pan, 0.5, \gain, 0.2]); + modules.add(synth); + }); // Hook up OSC f = { |msg, time, addr|