cmake build system: visiblity support for clang
[supercollider.git] / Help / UGens / Delays / Tap.html
blob42e7b78576ad7a66f8c130f5b7527b3a2de67b5b
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <title></title>
7 <meta name="Generator" content="Cocoa HTML Writer">
8 <meta name="CocoaVersion" content="824.44">
9 <style type="text/css">
10 p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
11 p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
12 p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
13 p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #bf0000}
14 p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000; min-height: 12.0px}
15 p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000}
16 p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #0000bf}
17 p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #007300}
18 span.s1 {font: 18.0px Helvetica}
19 span.s2 {color: #0522ef}
20 span.s3 {color: #000000}
21 span.s4 {color: #0000bf}
22 span.s5 {color: #007300}
23 span.Apple-tab-span {white-space:pre}
24 </style>
25 </head>
26 <body>
27 <p class="p1"><span class="s1"><b>Tap<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b></span><b>A single tap into a delayline</b></p>
28 <p class="p2"><br></p>
29 <p class="p1"><b>Tap.ar(bufnum, numChannels, delaytime)</b></p>
30 <p class="p2"><br></p>
31 <p class="p1">The Tap UGen allows a single tap at a delay into a buffer.<span class="Apple-converted-space"> </span></p>
32 <p class="p1"><b>bufnum</b> - the index of the buffer to use</p>
33 <p class="p1"><b>numChannels </b>- number of channels of the buffer</p>
34 <p class="p1"><b>delaytime </b>- tap delay; cannot be modulated<span class="Apple-converted-space"> </span></p>
35 <p class="p2"><br></p>
36 <p class="p1"><b>See also:</b> <a href="../Playback and Recording/PlayBuf.html"><span class="s2">PlayBuf</span></a> (Tap uses the PlayBuf UGen internally).<span class="Apple-converted-space"> </span></p>
37 <p class="p2"><br></p>
38 <p class="p3"><br></p>
39 <p class="p4">// Create a buffer.<span class="Apple-converted-space"> </span></p>
40 <p class="p4"><span class="s3">b=</span><span class="s4">Buffer</span><span class="s3">.alloc(s, s.sampleRate, 1); </span>//enough space for one second of mono audio <span class="Apple-converted-space"> </span></p>
41 <p class="p5"><br></p>
42 <p class="p4">// Write to the Buffer with BufWr, read using two Taps, one for each ear!</p>
43 <p class="p6">(</p>
44 <p class="p7">SynthDef<span class="s3">(</span><span class="s5">\helpTap</span><span class="s3">, {</span>|bufnum|</p>
45 <p class="p6"><span class="Apple-tab-span"> </span><span class="s4">var</span> source, capture;<span class="Apple-converted-space"> </span></p>
46 <p class="p5"><span class="Apple-tab-span"> </span></p>
47 <p class="p4"><span class="s3"><span class="Apple-tab-span"> </span>source= </span><span class="s4">SoundIn</span><span class="s3">.ar(0); </span>//use headphones to avoid feedback</p>
48 <p class="p6"><span class="Apple-tab-span"> </span>capture= <span class="s4">BufWr</span>.ar(source, bufnum, <span class="s4">Phasor</span>.ar(0,1, 0, <span class="s4">BufFrames</span>.ir(bufnum),1));</p>
49 <p class="p5"><span class="Apple-converted-space"> </span></p>
50 <p class="p4"><span class="s3"><span class="Apple-tab-span"> </span></span><span class="s4">Out</span><span class="s3">.ar(0, </span><span class="s4">Tap</span><span class="s3">.ar(bufnum, 1, [0.1,0.9])); </span>//multichannel expansion, so one tap each ear <span class="Apple-converted-space"> </span></p>
51 <p class="p6">}).send(s);<span class="Apple-converted-space"> </span></p>
52 <p class="p6">)</p>
53 <p class="p5"><br></p>
54 <p class="p8"><span class="s3">x=</span><span class="s4">Synth</span><span class="s3">(</span>\helpTap<span class="s3">,[</span>\bufnum<span class="s3">, b]);</span></p>
55 <p class="p5"><br></p>
56 <p class="p6">x.free;</p>
57 </body>
58 </html>