File: WaveLoss.schelp

package info (click to toggle)
supercollider-sc3-plugins 3.7.1~repack-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 14,332 kB
  • ctags: 11,704
  • sloc: cpp: 140,180; lisp: 14,746; ansic: 2,133; xml: 86; makefile: 82; haskell: 21; sh: 8
file content (74 lines) | stat: -rw-r--r-- 1,974 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
CLASS:: WaveLoss
summary:: Lose bits of your waves
categories:: UGens>Filters>Nonlinear
related:: Classes/Squiz

DESCRIPTION::
Uses the zero-crossings to divide an audio stream into tiny segments, and simply discards a fraction of the segments (replacing them with silence). The technique was described in a lecture by Trevor Wishart.

Parameters: the filter drops strong::drop:: out of strong::outof:: chunks. strong::mode:: can be 1 to drop chunks in a simple deterministic fashion (e.g. always dropping the first 30 out of a set of 40 segments), or 2 to drop chunks randomly but in an appropriate proportion.

CLASSMETHODS::

METHOD:: ar
argument:: in
argument:: drop
argument:: outof
argument:: mode
argument:: mul
argument:: add

METHOD:: kr
argument:: in
argument:: drop
argument:: outof
argument:: mode
argument:: mul
argument:: add


EXAMPLES::

code::
s.boot;
// Move the mouse left/right to see the gradation of the effect. 
// Move up or down to choose mode. The modes sound very different.
(
x = {
	var sig, mode;
	sig = [SinOsc.ar, PinkNoise.ar].mean;
	mode = MouseY.kr(1,2).round;
	WaveLoss.ar(sig, MouseX.kr(0, 40), 40, mode: mode, mul: 0.1);
}.play;
)
x.free;

// Plotting shows quite clearly what's going on:
(
{
	var sig;
	sig = [SinOsc.ar, PinkNoise.ar].mean;
	[sig, WaveLoss.ar(sig, 20, 40, mode: 2)];
}.plot(0.15);
)

// A stereo example, evolves over a couple of minutes - specify a breakbeat loop sample below, sounds good
b = Buffer.read(s,"sounds/amenfast.wav"); // remember to free the buffer later.
(
x = {
	var sig, mode, woo;
	sig = PlayBuf.ar(1, b.bufnum, BufRateScale.kr(b.bufnum) * 0.75, startPos: 92898, loop: 1);
	woo = {
		WaveLoss.ar(sig, 
			EnvGen.kr(Env.new([199, 199, 150, 150, 199, 250], [20, 40, 60, 60, 100]), doneAction:2)
			+ (FSinOsc.kr(0.2 + XLine.kr(0.001, [1.3, 1.7], 90), 0, 50) * XLine.kr(0.00000001, 1, 60))
			,
			200, mode: 2, mul: 0.4);
	}.dup;
	woo = (woo * 0.9) + (woo.reverse * 0.1);
}.play;
)
x.free;
b.free;
::