On Sat, 27 Dec 2003, Umiachi wrote:I'm nowhere near a mac for the next few days, why wouldn't a freq of zero work (i.e. what happened)?actually it looks like it does work. I was using 0.midicps which doesn't equal zero hertz. zero hertz doesn't seem to give any output, as expected.
zero hertz you do not hear but it might have effects on the output, also you waste cpu cycles for silence.
try the attached class (InstrSpawner2)
(
Instr.new(\pulseSynth, {arg fundFreq, int1, int2, pulseWidth,
cutoff;
var p, out;
p = Pulse.ar([fundFreq * int1.midiratio, fundFreq,
fundFreq*int2.midiratio],
pulseWidth, 0.3);
out = LPF.ar(Mix.ar(p), cutoff)
* EnvGen.ar(Env.perc, doneAction:2);
[out, out];
});
)
InstrSpawner2(\pulseSynth, [
Pseq(#[0, 20, 20, \, 120, \, \, 20].midicps, inf),
0.25, -0.25, 0.25, 5000
], 0.5).play;
(it costs some more cycles too - a rest is a valid desire, on the
other hand and it is much cheaper than 0 hertz or 0 amplitude)
here's the code anyway, in case someone wants a drum synthesizer to screwaround with (i think it's based on somebody's helpfile).( Instr.new(\pulseSynth, {arg fundFreq, int1, int2, pulseWidth, cutoff; var p, out; p = Pulse.ar([fundFreq * int1.midiratio, fundFreq, fundFreq*int2.midiratio], pulseWidth, 0.3); out = LPF.ar(Mix.ar(p), cutoff) * EnvGen.ar(Env.perc, doneAction:2); [out, out]; }); ) InstrSpawner(\pulseSynth, [Pseq(#[0, 20, 20, 20, 120, 20, 20, 20].midicps, inf), 0.25, -0.25, 0.25, 5000], 0.5).play; David Loehlindloehlin@xxxxxxxxxxxxAnticlimax radio: whpk 88.5fm chicago fridays eight to ten am http://home.uchicago.edu/~dloehlin _______________________________________________ sc-users mailing list sc-users@xxxxxxxxxxxxxxx http://www.create.ucsb.edu/mailman/listinfo/sc-users
Attachment:
%InstrSpawner2.sc
Description: application/applefile
Attachment:
InstrSpawner2.sc
Description: Binary data
-- .