Forgot a help fix: Drag a dock's title bar, not divider, to reposition
[supercollider.git] / HelpSource / Tutorials / Mark_Polishook_tutorial / 14_Subtractive_synthesis.schelp
blobbc323c2fd5101ec9b2d0a501a1e47e7e1b346c37
1 title:: 14_Subtractive_synthesis
2 summary:: Mark Polishook tutorial
3 categories:: Tutorials>Mark_Polishook_tutorial
4 related:: Tutorials/Mark_Polishook_tutorial/00_Introductory_tutorial
6 section::Filtering
8 The basic idea of subtractive synthesis is similar to making coffee: something goes through a filter to remove unwanted components from the final product.
10 section::The .dumpClassSubtree message
12 Get a list of ugen filters in SuperCollider 3, by sending the .dumpClassSubtree message to the Filter class, as in
14 code::
15 Filter.dumpClassSubtree;
18 ( code::Object.dumpClassSubtree:: prints all SuperCollider classes)
20 ////////////////////////////////////////////////////////////////////////////////////////////////////
22 classtree::Filter
24 ////////////////////////////////////////////////////////////////////////////////////////////////////
26 Use LPF, a low-pass filter to subtract high-frequency content from an input source.
28 code::
30 SynthDef("subtractive", {
31         Out.ar(
32                 0,
33                 LPF.ar(
34                         Pulse.ar(440, 0.5, 0.1),        // the source to be filtered
35                         Line.kr(8000, 660, 6)           // control the filter frequency with a line
36                 )
37         )
38 }).add;
41 Synth("subtractive")
44 ////////////////////////////////////////////////////////////////////////////////////////////////////
46 RLPF, a resonant low-pass filter, removes high-frequency content and emphasizes the cutoff frequency.
48 code::
50 SynthDef("passLowFreqs2", {
51         Out.ar(
52                 0,
53                 RLPF.ar(
54                         Saw.ar([220, 221] + LFNoise0.kr(1, 100, 200), 0.2),
55                         [LFNoise0.kr(4, 600, 2400), LFNoise0.kr(3, 600, 2400)],
56                         0.1
57                 )
58         )
59 }).add;
62 Synth("passLowFreqs2")
65 ////////////////////////////////////////////////////////////////////////////////////////////////////
67 Resonz is a very, very, very strong filter. Use it to emphasize a frequency band.
69 Transform noise into pitch with a sharp cutoff.
71 code::
73 SynthDef("noiseToPitch", { arg out = 0, mul = 1;
74         Out.ar(
75                 out,
76                 Resonz.ar(
77                         WhiteNoise.ar(mul),
78                         LFNoise0.kr(4, 110, 660),
79                         [0.005, 0.005]
80                 )
81         )
82 }).add;
86 // activate left and right channels
87 Synth("noiseToPitch", [\out, 0, \mul, 1]);
88 Synth("noiseToPitch", [\out, 1, \mul, 1]);
92 ////////////////////////////////////////////////////////////////////////////////////////////////////
94 go to link::Tutorials/Mark_Polishook_tutorial/15_Groups::