\\ some basic templates for envelopes, amplitude and frequency modulations \\ lp, 4/99 \\ simple enveloping ( { var freq = 220, e, e1; e = Env.linen(0.02, 1, 2.1); e1 = Env.perc(0.52, 1.5, 370); Formant.ar(freq, EnvGen.kr(e1) + 500, 50 , EnvGen.kr(e)) }.scope ) \\ spawning time \\ try changing the envelope durations to be a lot longer than spawning! ( var freq, amp = 0.25, e; e = Env.new([0.001,1,0.3,0.8,0.001],[0.2,0.01,0.5,0.02],'exponential'); { Spawn.ar({ SinOsc.ar(800.rand, 0, EnvGen.ar(e) ) }, 1, 2, 15) }.scope; ) \\ very basic, two operator frequency modulation ( { var freqc = 200, freqm = 5, ampc = 0.5, ampm = 0.15; l = LFSaw.ar(freqm, ampm ); s = SinOsc.ar( (l * freqc) + freqc, 0, ampc); s }.scope; ) \\ very basic, two operator frequency modulation, with gui ( var w, s1, s2; w = GUIWindow.new("simple freq mod.", Rect.newBy( 128, 64, 377, 116 )); s1 = SliderView.new( w, Rect.newBy( 24, 28, 128, 20 ), "SliderView", 0, 0, 200, 0.5, 'linear'); s2 = SliderView.new( w, Rect.newBy( 178, 29, 128, 20 ), "SliderView", 0, 0, 1, 0.01, 'linear'); StringView.new( w, Rect.newBy( 26, 57, 128, 20 ), "Mod. freq "); StringView.new( w, Rect.newBy( 181, 61, 128, 20 ), "Mod.amp "); { var freqc = 200, freqm = 2, ampc = 0.5, ampm = 0.05; l = LFSaw.ar( ControlIn.kr(s1), ControlIn.kr(s2) ); s = SinOsc.ar( (l * freqc) + freqc, 0, ampc); s }.scope; w.close; ) \\ very basic, two operator amplitude modulation ( var w, s1, s2; w = GUIWindow.new("simple amp mod.", Rect.newBy( 128, 64, 377, 116 )); s1 = SliderView.new( w, Rect.newBy( 24, 28, 128, 20 ), "SliderView", 0, 0, 400, 1, 'linear'); s2 = SliderView.new( w, Rect.newBy( 178, 29, 128, 20 ), "SliderView", 0, 0, 1, 0.01, 'linear'); StringView.new( w, Rect.newBy( 26, 57, 128, 20 ), "Mod. freq "); StringView.new( w, Rect.newBy( 181, 61, 128, 20 ), "Mod.amp "); { var freqc = 200, freqm = 2, ampc = 0.5, ampm = 0.05; l = SinOsc.ar( ControlIn.kr(s1), 0, ControlIn.kr(s2) ); s = SinOsc.ar( freqc, 0, l + ampc ); s }.scope; w.close; )