Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Programming For Musical Applications II Tutorial 05 SuperCollider Sound Fundamentals 07 November, 2008.

Similar presentations


Presentation on theme: "Computer Programming For Musical Applications II Tutorial 05 SuperCollider Sound Fundamentals 07 November, 2008."— Presentation transcript:

1 Computer Programming For Musical Applications II Tutorial 05 SuperCollider Sound Fundamentals 07 November, 2008

2 Tutorial Overview Sonic startup Sine Wave Unit Generator Audio Rate & Control Rate Line & XLine Unit Generators Noise Exercise’s 2 07 November, 2008MTE2007 Computer Programming For Musical Applications II

3 Sonic Startup Here is how you can get some basic sound in SuperCollider: First you need to start up the server, this is automatically assigned to the variable s when SC first loads. You can either boot up the localhost server by using the code: or by hitting the Boot button on the localhost server GUI pane When it boots you should see the Boot button change to Quit and turn green s.boot; 07 November, 2008MTE2007 Computer Programming For Musical Applications II

4 Sonic Startup Now your ready to play some sound: One of the most basic ways of getting sound is to play a sine wave using the SinOsc Unit Generator (UGen): { SinOsc.ar(200, 0, 0.5) }.play; UGenAudio rateFrequency (Hz)PhaseAmplitude Press the Enter button to make this play. Use the keys CMD. to make it stop 07 November, 2008MTE2007 Computer Programming For Musical Applications II

5 Sonic Startup Notice the { } brackets around the UGen method call, this is actually placing the UGen call inside a function. Due to the Object Orientated nature of SC (i.e. EVERYTHING in SC is an Object), a function knows how to play itself...hence why we get sound. { SinOsc.ar(200, 0, 0.5) }.play; ( a = { SinOsc.ar(200, 0, 0.5) }; a.play; ) This allows us to place the function inside a variable: 07 November, 2008MTE2007 Computer Programming For Musical Applications II

6 Sonic Startup Task 1.1: Startup SC Boot the server Play some sound using the SinOsc Unit Generator { SinOsc.ar(freq, phase, amp) }.play; Task 1.2: Modify your code so you use three different variables to control the frequency, phase and amplitude parameters of the SinOsc Use the syntax var myVariable = value; to create a variable 07 November, 2008MTE2007 Computer Programming For Musical Applications II

7 Audio Rate & Control Rate There are two different sample rates to use in SC: AUDIO RATE & CONTROL RATE Unit Generators to which an ar message is sent will run at audio rate, this is 44,100 samples per second by default. Unit Generators to which a kr message is sent will run at control rate, by default control rate ugens will generate one sample for every 64 samples made by an audio rate ugen. They therefore run at 689 samples per second. Control rate ugens are useful for controlling the parameters of audio rate ugens, such as frequency or amplitude 07 November, 2008MTE2007 Computer Programming For Musical Applications II

8 Audio Rate & Control Rate ( a = { SinOsc.kr(5,0,10) }; b = { SinOsc.ar(200+a, 0, 0.5) }; b.play; ) Here a SinOsc UGen at control rate is used to control the frequency of another SinOsc UGen that is at audio rate 07 November, 2008MTE2007 Computer Programming For Musical Applications II

9 Audio Rate & Control Rate Task 2.1: Use one SinOsc at control rate to control the frequency of another SinOsc at audio rate. Place each UGen in a separate function to make things easier Task 2.2 Create another SinOsc at control rate to control the amplitude of the SinOsc that is running at audio rate 07 November, 2008MTE2007 Computer Programming For Musical Applications II

10 We can also use other UGens to control the parameters of our SinOsc. The Line UGen will create a line from a start value to an end value over a specified duration. It can be created using either audio rate or control rate. ( a = { Line.kr(0,500,5) }; b = { SinOsc.ar(200+a, 0, 0.5) }; b.play; ) Here a Line UGen is created and used to control the frequency of a SinOsc UGen. The line will go from 0 to 500 over 5 seconds Line Unit Generator Line’s syntax: Line.kr(start, end, duration); 07 November, 2008MTE2007 Computer Programming For Musical Applications II

11 The XLine UGen will do the same as the Line UGen, with the exception that it will create an exponential curve rather than a straight line. ( a = { XLine.kr(200,12000,10) }; b = { SinOsc.ar(a, 0, 0.5) }; b.play; ) Here an XLine UGen is created and used to control the frequency of a SinOsc UGen. The curve will go from 200 to 12000 over 10 seconds XLine Unit Generator XLine’s syntax: Xline.kr(start, end, duration); 07 November, 2008MTE2007 Computer Programming For Musical Applications II

12 Task 3.1: Use a Line UGen at control rate to control the frequency of another SinOsc at audio rate. Make the frequency of the SinOsc UGen raise from 200Hz to 15000Hz over 10 seconds. Task 2.2 Use an XLine UGen at control rate to control the frequency of another SinOsc at audio rate. Make the frequency of the SinOsc UGen raise from 200Hz to 15000Hz over 10 seconds. Play both of these and listen to the difference between them Line & XLine Unit Generator’s 07 November, 2008MTE2007 Computer Programming For Musical Applications II

13 Noise Noise syntax: NoiseUGen.ar(amplitude); There are several basic noise UGens, they all use the same santax: For example: White Noise syntax: WhiteNoise.ar(0.1); Pink Noise syntax: PinkNoise.ar(0.1); Brown Noise syntax: BrownNoise.ar(0.1); Gray Noise syntax: GrayNoise.ar(0.1); Clip Noise syntax: ClipNoise.ar(0.1); 07 November, 2008MTE2007 Computer Programming For Musical Applications II

14 Noise More interesting noise UGens: Dust & Dust2 Dust syntax: Dust.ar(density,amplitude); Dust generates random impulses from 0 to 1, the density argument specifies the number of impulses per second ( a = { XLine.kr(1,200,10) }; b = { Dust.ar(a, 0.5) }; b.play; ) 07 November, 2008MTE2007 Computer Programming For Musical Applications II

15 More interesting noise UGens: Crackle Crackle syntax: Crackle.ar(param,amplitude); Crackle generates noise based on a chaotic function, the param parameter is the value of the chaotic function with useful values from just below 1.0 to just above 2.0 ( a = { XLine.kr(1.0,2.0,5) }; b = { Crackle.ar(a, 0.5) }; b.play; ) Noise 07 November, 2008MTE2007 Computer Programming For Musical Applications II

16 Noise Task 4.1 Test each of the Noise UGen’s below independently and compare how they sound: White Noise Pink Noise Brown Noise Gray Noise Clip Noise Noise syntax: NoiseUGen.ar(amplitude); 07 November, 2008MTE2007 Computer Programming For Musical Applications II

17 Noise Task 4.2 Use the Line UGen to control the density of a Dust UGen Task 4.3 Use the XLine UGen to control the chaos function of a Crackle UGen 07 November, 2008MTE2007 Computer Programming For Musical Applications II

18 Look up the SC Help file (press CMD + d to open it) Select the Tour of Unit Generators link in the Tutorials section Play with the following UGens: Saw LFNoise0 Then use the Low Pass Filter UGen ( LPF ) to filter the Saw UGen. Tip - If the text in the help file is blue then you can access specific help about that item. Select the text and press CMD + d to bring up the item’s help file. TASKS 07 November, 2008MTE2007 Computer Programming For Musical Applications II

19


Download ppt "Computer Programming For Musical Applications II Tutorial 05 SuperCollider Sound Fundamentals 07 November, 2008."

Similar presentations


Ads by Google