From 4c5fb7cda1f76980be0e246fadf3ff47a8f80af7 Mon Sep 17 00:00:00 2001 From: rob Date: Wed, 17 Dec 2008 21:17:25 +0000 Subject: [PATCH] added help files --- Help/AverageOutput.html | 45 +++++++++++++++++++ Help/SwitchDelay.html | 97 ++++++++++++++++++++++++++++++++++++++++ classes/AverageOutput.sc | 11 +++++ classes/SwitchDelay.sc | 5 +++ src/rfw-ugens.cpp | 4 +- 5 files changed, 160 insertions(+), 2 deletions(-) create mode 100644 Help/AverageOutput.html create mode 100644 Help/SwitchDelay.html create mode 100644 classes/AverageOutput.sc create mode 100644 classes/SwitchDelay.sc diff --git a/Help/AverageOutput.html b/Help/AverageOutput.html new file mode 100644 index 0000000..9a842f6 --- /dev/null +++ b/Help/AverageOutput.html @@ -0,0 +1,45 @@ + + + + + + + + + + + +

AverageOutput

+


+

The mean average output since the last received trigger.

+


+

Class methods

+


+

*ar(in, trig, mul, add)

+

*kr(in, trig, mul, add)

+


+


+

in - input signal.

+


+

trig -  if changes from <= 0 to > 0, resets average and count to zero.

+


+


+

Examples

+


+

// sine oscillator, average slowly settles to zero

+

a = { AverageOutput.ar(SinOsc.ar(10000)).poll }.play;

+


+

a.free;

+ + diff --git a/Help/SwitchDelay.html b/Help/SwitchDelay.html new file mode 100644 index 0000000..7405c2d --- /dev/null +++ b/Help/SwitchDelay.html @@ -0,0 +1,97 @@ + + + + + + + + + + + +

SwitchDelay feedback delay line implementing switch-and-ramp buffer jumping

+


+

SwitchDelay.ar(input, drylevel, wetlevel, delaytime, delayfactor, maxdelaytime, mul, add)

+


+

A feedback delay line which allows switching the buffer read pointer using the switch-and-ramp technique

+

as described by Miller S. Puckette in his Theory and Techniques of Electronic Music book.

+

http://crca.ucsd.edu/~msp/techniques/latest/book.pdf (chapter 4)

+


+

Altering the buffer read position, in order to affect the perceived delay speed/timing, creates a 

+

discontinuity in the signal, and usually comes with unwanted audible artefacts. SwitchDelay seeks to 

+

minimize these artefacts by use of the above technique. See the examples below for comparison.

+


+

input - a signal to be filtered

+


+

drylevel - level of dry signal (default: 1.0)

+


+

wetlevel - level of delayed signal (default: 1.0)

+


+

delaytime - seconds to delay signal (default: 1.0)

+


+

delayfactor - multiplier for feedback level, affects the length of the feedback tail (default 0.7)

+

   limited slightly below 1.0 to avoid speaker damaging mistakes

+

   

+

maxdelaytime - buffer size (default 20.0)

+


+

  See also: CombN etc

+


+


+

// Load a soundfile:

+

b = Buffer.read(s, "sounds/a11wlk01.wav");

+


+

// simple feedback line, no modulation

+

(

+

SynthDef('help-switchdelay-1', { arg out=0, bufnum, delaytime;

+

Out.ar(out,

+

DelayLineCM2.ar(

+

PlayBuf.ar(numChannels: 1, bufnum: bufnum, loop: 0) * 0.5,

+

delaytime: delaytime,

+

wetlevel: 0.6

+

)

+

);

+

}).send(s);

+

)

+


+

x = Synth('help-switchdelay-1', [\bufnum, b, \delaytime, 2.0]);

+

x.free;

+


+


+


+

// this time, change the buffer read pointer periodically.

+

(

+

SynthDef('help-switchdelay-2', { arg out=0, bufnum, delaytime;

+

Out.ar(out,

+

DelayLineCM2.ar(

+

PlayBuf.ar(numChannels: 1, bufnum: bufnum, loop: 0) * 0.5,

+

wetlevel: 0.6,

+

delaytime: Select.kr(

+

Stepper.kr(Impulse.kr(0.5), 0, 0, 3),

+

[ 0.02, 0.1, 0.725, 0.25 ] 

+

)

+

)

+

);

+

}).send(s);

+

)

+


+

x = Synth('help-switchdelay-2', [\bufnum, b, \loop, 0, \delaytime, 2.0]);

+

x.free;

+


+ + diff --git a/classes/AverageOutput.sc b/classes/AverageOutput.sc new file mode 100644 index 0000000..348ce83 --- /dev/null +++ b/classes/AverageOutput.sc @@ -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); + } +} diff --git a/classes/SwitchDelay.sc b/classes/SwitchDelay.sc new file mode 100644 index 0000000..578338c --- /dev/null +++ b/classes/SwitchDelay.sc @@ -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) + } +} diff --git a/src/rfw-ugens.cpp b/src/rfw-ugens.cpp index 3b440a2..6816ffb 100644 --- a/src/rfw-ugens.cpp +++ b/src/rfw-ugens.cpp @@ -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