added help files

This commit is contained in:
rob 2008-12-17 21:17:25 +00:00
parent 9428f8d807
commit 4c5fb7cda1
5 changed files with 160 additions and 2 deletions

45
Help/AverageOutput.html Normal file
View File

@ -0,0 +1,45 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="949.35">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Helvetica}
p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Helvetica; min-height: 16.0px}
p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
p.p8 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco; color: #8b2e18}
p.p9 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
span.s1 {text-decoration: underline}
</style>
</head>
<body>
<p class="p1"><b>AverageOutput</b></p>
<p class="p2"><br></p>
<p class="p3">The mean average output since the last received trigger.</p>
<p class="p2"><br></p>
<p class="p4"><b><span class="s1">Class methods</span></b></p>
<p class="p2"><br></p>
<p class="p5"><b>*ar(in, trig, mul, add)</b></p>
<p class="p5"><b>*kr(in, trig, mul, add)</b></p>
<p class="p6"><br></p>
<p class="p6"><br></p>
<p class="p3"><b>in - </b>input signal.</p>
<p class="p2"><br></p>
<p class="p3"><b>trig</b> -<span class="Apple-converted-space">  </span>if changes from &lt;= 0 to &gt; 0, resets average and count to zero.</p>
<p class="p2"><br></p>
<p class="p2"><br></p>
<p class="p3"><i>Examples</i></p>
<p class="p7"><br></p>
<p class="p8">// sine oscillator, average slowly settles to zero</p>
<p class="p9">a = { AverageOutput.ar(SinOsc.ar(10000)).poll }.play;</p>
<p class="p7"><br></p>
<p class="p9">a.free;</p>
</body>
</html>

97
Help/SwitchDelay.html Normal file
View File

@ -0,0 +1,97 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="949.35">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; color: #bf0000; min-height: 16.0px}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; min-height: 16.0px}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; color: #bf0000}
p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; color: #606060}
p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco}
p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; color: #0000bf}
p.p9 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; color: #007300}
span.s1 {font: 18.0px Helvetica}
span.s2 {color: #0018f7}
span.s3 {color: #000000}
span.s4 {color: #0000bf}
span.s5 {color: #007300}
span.Apple-tab-span {white-space:pre}
</style>
</head>
<body>
<p class="p1"><span class="s1"><b>SwitchDelay<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b></span><b>feedback delay line implementing switch-and-ramp buffer jumping</b></p>
<p class="p2"><br></p>
<p class="p1"><b>SwitchDelay.ar(input, drylevel, wetlevel, delaytime, delayfactor, maxdelaytime, mul, add)</b></p>
<p class="p2"><br></p>
<p class="p1">A feedback delay line which allows switching the buffer read pointer using the switch-and-ramp technique</p>
<p class="p1">as described by Miller S. Puckette in his Theory and Techniques of Electronic Music book.</p>
<p class="p1"><a href="http://crca.ucsd.edu/~msp/techniques/latest/book.pdf">http://crca.ucsd.edu/~msp/techniques/latest/book.pdf</a> (chapter 4)</p>
<p class="p2"><br></p>
<p class="p1">Altering the buffer read position, in order to affect the perceived delay speed/timing, creates a<span class="Apple-converted-space"> </span></p>
<p class="p1">discontinuity in the signal, and usually comes with unwanted audible artefacts. SwitchDelay seeks to<span class="Apple-converted-space"> </span></p>
<p class="p1">minimize these artefacts by use of the above technique. See the examples below for comparison.</p>
<p class="p2"><br></p>
<p class="p1"><b>input</b> - a signal to be filtered</p>
<p class="p2"><br></p>
<p class="p1"><b>drylevel</b> - level of dry signal (default: 1.0)</p>
<p class="p2"><br></p>
<p class="p1"><b>wetlevel</b> - level of delayed signal (default: 1.0)</p>
<p class="p2"><br></p>
<p class="p1"><b>delaytime</b> - seconds to delay signal (default: 1.0)</p>
<p class="p2"><br></p>
<p class="p1"><b>delayfactor</b> - multiplier for feedback level, affects the length of the feedback tail (default 0.7)</p>
<p class="p1"><span class="Apple-converted-space">   <span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span>limited slightly below 1.0 to avoid speaker damaging mistakes</p>
<p class="p2"><span class="Apple-converted-space">   <span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span></p>
<p class="p1"><b>maxdelaytime</b> - buffer size (default 20.0)</p>
<p class="p2"><br></p>
<p class="p1"><b><span class="Apple-converted-space">  </span>See also:</b> <a href="../../../../Applications/SuperCollider3/build/Help/UGens/Delays/CombN.html"><span class="s2">CombN</span></a><span class="s2"> </span>etc</p>
<p class="p3"><br></p>
<p class="p4"><br></p>
<p class="p5">// Load a soundfile:</p>
<p class="p6"><span class="s3">b = </span><span class="s4">Buffer</span><span class="s3">.read(s, </span>"sounds/a11wlk01.wav"<span class="s3">);</span></p>
<p class="p4"><br></p>
<p class="p5">// simple feedback line, no modulation</p>
<p class="p7">(</p>
<p class="p7"><span class="s4">SynthDef</span>(<span class="s5">'help-switchdelay-1'</span>, { <span class="s4">arg</span> out=0, bufnum, delaytime;</p>
<p class="p7"><span class="Apple-tab-span"> </span><span class="s4">Out</span>.ar(out,</p>
<p class="p8"><span class="s3"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span>DelayLineCM2<span class="s3">.ar(</span></p>
<p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s4">PlayBuf</span>.ar(numChannels: 1, bufnum: bufnum, loop: 0) * 0.5,</p>
<p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>delaytime: delaytime,</p>
<p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>wetlevel: 0.6</p>
<p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>)</p>
<p class="p7"><span class="Apple-tab-span"> </span>);</p>
<p class="p7">}).send(s);</p>
<p class="p7">)</p>
<p class="p4"><br></p>
<p class="p9"><span class="s3">x = </span><span class="s4">Synth</span><span class="s3">(</span>'help-switchdelay-1'<span class="s3">, [</span>\bufnum<span class="s3">, b, </span>\delaytime<span class="s3">, 2.0]);</span></p>
<p class="p7">x.free;</p>
<p class="p4"><br></p>
<p class="p4"><br></p>
<p class="p4"><br></p>
<p class="p5">// this time, change the buffer read pointer periodically.</p>
<p class="p7">(</p>
<p class="p7"><span class="s4">SynthDef</span>(<span class="s5">'help-switchdelay-2'</span>, { <span class="s4">arg</span> out=0, bufnum, delaytime;</p>
<p class="p7"><span class="Apple-tab-span"> </span><span class="s4">Out</span>.ar(out,</p>
<p class="p8"><span class="s3"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span>DelayLineCM2<span class="s3">.ar(</span></p>
<p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s4">PlayBuf</span>.ar(numChannels: 1, bufnum: bufnum, loop: 0) * 0.5,</p>
<p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>wetlevel: 0.6,</p>
<p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>delaytime: <span class="s4">Select</span>.kr(</p>
<p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s4">Stepper</span>.kr(<span class="s4">Impulse</span>.kr(0.5), 0, 0, 3),</p>
<p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>[ 0.02, 0.1, 0.725, 0.25 ]<span class="Apple-converted-space"> </span></p>
<p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>)</p>
<p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>)</p>
<p class="p7"><span class="Apple-tab-span"> </span>);</p>
<p class="p7">}).send(s);</p>
<p class="p7">)</p>
<p class="p4"><br></p>
<p class="p9"><span class="s3">x = </span><span class="s4">Synth</span><span class="s3">(</span>'help-switchdelay-2'<span class="s3">, [</span>\bufnum<span class="s3">, b, </span>\loop<span class="s3">, 0, </span>\delaytime<span class="s3">, 2.0]);</span></p>
<p class="p7">x.free;</p>
<p class="p4"><br></p>
</body>
</html>

11
classes/AverageOutput.sc Normal file
View File

@ -0,0 +1,11 @@
AverageOutput : UGen {
*ar {
arg in, trig=0.0, mul=1.0, add=0.0;
^this.multiNew('audio', in, trig).madd(mul, add);
}
*kr {
arg in, trig=0.0, mul=1.0, add=0.0;
^this.multiNew('control', in, trig).madd(mul, add);
}
}

5
classes/SwitchDelay.sc Normal file
View File

@ -0,0 +1,5 @@
SwitchDelay : UGen {
*ar { arg in, drylevel=1.0, wetlevel=1.0, delaytime=1.0, delayfactor=0.7, maxdelaytime=20.0, mul=1.0, add=0.0;
^this.multiNew('audio', in, drylevel, wetlevel, delaytime, delayfactor, maxdelaytime).madd(mul, add)
}
}

View File

@ -5,11 +5,11 @@
* Created by Rob Watson on 17/December/2008.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*
* https://github.com/rfwatson
* Git repository: https://github.com/rfwatson
*/
/*
SuperCollider real time audio synthesis system
Copyright (c) 2002 James McCartney. All rights reserved.
Copyright (c) 2002 James McCartney. All rights reserved.
http://www.audiosynth.com
This program is free software; you can redistribute it and/or modify