|
@@ -15,17 +15,17 @@ s.waitForBoot { |
|
|
var oscillator, noise, filter, panner, mixer, frequency, qfactor, lagtime, output, amplitude; |
|
|
var oscillator, noise, filter, panner, mixer, frequency, qfactor, lagtime, output, amplitude; |
|
|
|
|
|
|
|
|
// Dynamic time of the module |
|
|
// Dynamic time of the module |
|
|
lagtime = 100 / (2**octave); |
|
|
|
|
|
|
|
|
lagtime = 100 / (2**(octave/8)); |
|
|
|
|
|
|
|
|
// Oscillator/filter frequency |
|
|
// Oscillator/filter frequency |
|
|
frequency = (notefreq * (0.9 + (hue*0.2))) * (2**(octave-2)); |
|
|
|
|
|
|
|
|
frequency = (notefreq * (0.9 + (hue*0.2))) * (2**(octave/4-2)); |
|
|
//frequency = (130 + (hue * 130)) * (2 ** octave); |
|
|
//frequency = (130 + (hue * 130)) * (2 ** octave); |
|
|
//frequency = 130 * Scale.major.ratios[(hue * 12).asInteger]; |
|
|
//frequency = 130 * Scale.major.ratios[(hue * 12).asInteger]; |
|
|
//frequency = (130 * frequency) * (2**octave); |
|
|
//frequency = (130 * frequency) * (2**octave); |
|
|
frequency = Lag.kr(frequency, lagtime/10); |
|
|
frequency = Lag.kr(frequency, lagtime/10); |
|
|
|
|
|
|
|
|
// Filtered saw oscillator |
|
|
// Filtered saw oscillator |
|
|
oscillator = Mix.ar([SawDPW.ar(frequency), SawDPW.ar(frequency/2+value*(1-saturation)*50)]); |
|
|
|
|
|
|
|
|
oscillator = Mix.ar([SawDPW.ar(frequency), SawDPW.ar(frequency/2+value*(1-saturation)*100)]); |
|
|
filter = DFM1.ar(oscillator, frequency, saturation/2, 1.0, 0.0, 0.0006); |
|
|
filter = DFM1.ar(oscillator, frequency, saturation/2, 1.0, 0.0, 0.0006); |
|
|
|
|
|
|
|
|
// Noise |
|
|
// Noise |
|
@@ -34,7 +34,7 @@ s.waitForBoot { |
|
|
noise = BPF.ar(noise, frequency, qfactor); |
|
|
noise = BPF.ar(noise, frequency, qfactor); |
|
|
|
|
|
|
|
|
// Mix noise and saw |
|
|
// Mix noise and saw |
|
|
mixer = Mix.ar([filter * saturation.sqrt(), 1 * noise*(1-saturation)]); |
|
|
|
|
|
|
|
|
mixer = Mix.ar([filter * saturation.sqrt(), 2 * noise*(1-saturation)]); |
|
|
|
|
|
|
|
|
// Apply pan |
|
|
// Apply pan |
|
|
panner = LinPan2.ar(mixer, pan); |
|
|
panner = LinPan2.ar(mixer, pan); |
|
@@ -47,7 +47,7 @@ s.waitForBoot { |
|
|
output = Compander.ar(output, output, 0.5, 0.3, 0.3, 0.1, lagtime); |
|
|
output = Compander.ar(output, output, 0.5, 0.3, 0.3, 0.1, lagtime); |
|
|
|
|
|
|
|
|
// Crank everything down |
|
|
// Crank everything down |
|
|
output = output * 0.9; |
|
|
|
|
|
|
|
|
output = output * 0.2; |
|
|
|
|
|
|
|
|
Out.ar(0, output); |
|
|
Out.ar(0, output); |
|
|
}); |
|
|
}); |
|
@@ -63,7 +63,7 @@ s.waitForBoot { |
|
|
octave = (2 - (index / 4).floor); |
|
|
octave = (2 - (index / 4).floor); |
|
|
"Module %: Pan %, octave %\n".postf(index, pan.round(1e-1), octave.round(1e-1)); |
|
|
"Module %: Pan %, octave %\n".postf(index, pan.round(1e-1), octave.round(1e-1)); |
|
|
Synth.new(\module, |
|
|
Synth.new(\module, |
|
|
[\hue, 0.5, \saturation, 0.1, \value, 0.5, \pan, pan, \gain, 0.9, \octave, octave, \notefreq, Scale.major.degreeToFreq(index, 48.midicps, octave)] |
|
|
|
|
|
|
|
|
[\hue, 0.5, \saturation, 0.1, \value, 0.5, \pan, pan, \gain, 0.9, \octave, octave, \notefreq, Scale.minor.degreeToFreq(index, 48.midicps, octave)] |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
); |
|
|
); |
|
|