// title: Frequency modulated pulse // author: nathanielvirgo // description: // The standard Pulse UGen doesn't sound very good when its pitch is modulated at audio frequencies. This example shows how to produce a band-limited pulse wave that can be modulated at audio rate, producing a better approximation to the kind of FM effects that an analogue modular synth can produce. // // Requires sc3-plugins. // code: ( // Pulse doesn't respond well to being frequency modulated - loads of weird low freq noise { Pulse.ar(SinOsc.ar(XLine.kr(1,8000,20)).range(1,2000))*0.2 !2}.play ) ( // LFPulse doesn't sound like an analogue synth due to loads of aliasing { LFPulse.ar(SinOsc.ar(XLine.kr(1,8000,20)).range(1,2000))-0.5*0.4 !2}.play ) ( // But you can also produce a good approximation of a pulse wave by clipping a // high-amplitude sine wave. Clipper8 (from sc3-plugins) allows you to do this // in a band-limited way. This sounds much more like a frequency modulated analogue // oscillator. { Clipper8.ar(SinOsc.ar(SinOsc.ar(XLine.kr(1,8000,20)).range(0,2000), 0, 10), -0.2, 0.2) !2}.play // note: there are two SinOscs - the inner one is the modulator and the outer one is // clipped to make the pulse wave ) ( // with PWM too { Clipper8.ar(SinOsc.ar(SinOsc.ar(XLine.kr(1,8000,20)).range(50,1000), 0, 10)+LFTri.ar(8,mul:9.9), -0.2, 0.2) !2}.play )