120 likes | 358 Views
Computer Programming For Musical Applications II. Tutorial 06 SuperCollider SynthDefs 13 November, 2008. Tutorial Overview. Review of last weeks exercise SynthDefs Other UGen’s Exercise. 2. 13 November, 2008. MTE2007 Computer Programming For Musical Applications II.
E N D
Computer Programming For Musical Applications II Tutorial 06 SuperCollider SynthDefs 13 November, 2008
Tutorial Overview • Review of last weeks exercise • SynthDefs • Other UGen’s Exercise 2 13 November, 2008 MTE2007 Computer Programming For Musical Applications II
Review from last week The Saw UGen: Band limited sawtooth wave generator. Saw’s syntax: Saw.ar(freq, amp); { Saw.ar(XLine.kr(40,2000,5),0.2) }.play; An exponential curve controlling the Saw UGen’s frequency value Amplitude value 13 November, 2008 MTE2007 Computer Programming For Musical Applications II
Review from last week The LFNoise0 UGen: Generates random values at a rate given by the nearest integer division of the sample rate set by the freq argument. LFNoise0’s syntax: LFNoise0.ar(freq, amp); { LFNoise0.ar(XLine.kr(10, 10000, 10), 0.25) }.play; An exponential curve controlling the UGen’s frequency argument Amplitude value 13 November, 2008 MTE2007 Computer Programming For Musical Applications II
Review from last week The LPF Ugen: 2nd Order Butterworth lowpass filter LPF’s syntax: LPF.ar(in, freq, amp); ( var noise= {WhiteNoise.ar(0.9); }; var freq = { XLine.kr(20000,200,10) }; { LPF.ar(noise, freq,1.0) }.scope; ) Scope will draw the current waveform to the screen. It automatically calls play as well. You need the internal server running to use it 13 November, 2008 MTE2007 Computer Programming For Musical Applications II
SynthDef’s A SynthDef is SC’s way of creating a synthesizer patch or preset. The main difference here is that you can create your own SynthDef’s A SynthDef takes the code you write and compiles it as a kind of bytecode that can be understood by the server app. The SynthDef runs on the server app and therefore must be precompiled before being used. The can be saved to disk and any SynthDef saved in the synthdefs/ directory will be loaded into memory by a local Server when it is booted. 13 November, 2008 MTE2007 Computer Programming For Musical Applications II
SynthDef’s The SynthDef has two essential parts: A NAME and a FUNCTION SynthDef( "aSynthDef", { .... i am a ugenGraphFunc ... } ) • To make a SynthDef functional you must • Put code into the ugenGraphFunc • 2. Send a .load message to the synthdef 13 November, 2008 MTE2007 Computer Programming For Musical Applications II
SynthDef’s ugenGraphFunction name Audio Bus The .load message writes synthdefs to disk (in the directory 'synthdefs') and also sends them to the default server. A .send message sends them to the default server without writing it to the disk. 13 November, 2008 MTE2007 Computer Programming For Musical Applications II
SynthDef’s There are two different ways to play your SynthDef: a.play; or ( { Synth("mySynthDef", [ \freq, 440, \pan, 0.7 ] ); }).play(s); SynthDef Name Argument Name Argument Name Argument Value Argument Value 13 November, 2008 MTE2007 Computer Programming For Musical Applications II
SynthDef’s Task: Build a simple SynthDef that takes one argument, load it onto the server app and then play it using the Synth function Task: Add more than one argument so you can control the other parameters of your basic SynthDef ( a = SynthDef(”name", { //Arguments //Do something //Set the output } ).load(s); ) 13 November, 2008 MTE2007 Computer Programming For Musical Applications II
Other UGen’s Exercise Task: Create 5 different SynthDefs using at least 3 different Ugens in each. Try and make each SynthDef sonically unique. Play with the Reverb and Delay UGens to get some more interesting sounds. Remember to use a arguments to make the SynthDef’s more adaptable…….. 13 November, 2008 MTE2007 Computer Programming For Musical Applications II