/usr/share/SuperCollider/HelpSource/Classes/VOsc.schelp is in supercollider-common 1:3.8.0~repack-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | class:: VOsc
summary:: Variable wavetable oscillator.
related:: Classes/COsc, Classes/Osc, Classes/OscN, Classes/VOsc3
categories:: UGens>Generators>Deterministic
Description::
A wavetable lookup oscillator which can be swept smoothly across
wavetables. All the wavetables must be allocated to the same size.
Fractional values of table will interpolate between two adjacent tables.
This oscillator requires at least two buffers to be filled with a
wavetable format signal. This preprocesses the Signal into a form which
can be used efficiently by the Oscillator. The buffer size must be a
power of 2.
This can be achieved by creating a link::Classes/Buffer:: object and sending it one of
the "b_gen" messages ( sine1, sine2, sine3 ) with the wavetable flag set to true.
This can also be achieved by creating a link::Classes/Signal:: object and sending it
the link::Overviews/Methods#asWavetable#asWavetable:: message, saving it to disk, and having the server load
it from there.
If you use Buffer objects to manage buffer numbers, you can use the
[*allocConsecutive] method to allocate a continuous block of buffers.
See the link::Classes/Buffer:: helpfile for details.
note::
VOsc requires the b_gen sine1 wavetable flag to be ON.
::
classmethods::
method::ar, kr
argument::bufpos
Buffer index. Can be swept continuously among adjacent wavetable
buffers of the same size.
argument::freq
Frequency in Hertz.
argument::phase
Phase offset or modulator in radians.
argument::mul
Output will be multiplied by this value.
argument::add
This value will be added to the output.
Examples::
code::
(
s = Server.local;
// allocate and fill tables 0 to 7
8.do({ arg i;
var n, a;
// allocate table
s.sendMsg(\b_alloc, i, 1024);
// generate array of harmonic amplitudes
n = (i+1)**2;
a = Array.fill(n, { arg j; ((n-j)/n).squared.round(0.001) });
// fill table
s.performList(\sendMsg, \b_gen, i, \sine1, 7, a);
// the argument '7' here is a flag for the \sine1 wave fill method -
// see the "Wave Fill Commands" section in the Server Command Reference
});
)
(
SynthDef("help-VOsc",{ arg out=0, bufoffset=0;
var x;
// mouse x controls the wavetable position
x = MouseX.kr(0,7);
Out.ar(out,
VOsc.ar(bufoffset+x, [120,121], 0, 0.3)
)
}).play(s,[\out, 0, \bufoffset, 0]);
)
(
8.do({ arg i;
var a;
s.sendMsg(\b_alloc, i, 1024); // allocate table
// generate array of harmonic amplitudes
a = Array.fill(i, 0) ++ [0.5, 1, 0.5];
// fill table
s.performList(\sendMsg, \b_gen, i, \sine1, 7, a);
});
)
(
8.do({ arg i;
var a;
s.sendMsg(\b_alloc, i, 1024); // allocate table
// generate array of harmonic amplitudes
a = Array.fill(32,0);
12.do({ arg i; a.put(32.rand, 1) });
// fill table
s.performList(\sendMsg, \b_gen, i, \sine1, 7, a);
});
)
(
8.do({ arg i;
var a;
s.sendMsg(\b_alloc, i, 1024); // allocate table
// generate array of harmonic amplitudes
n = (i+1)**2;
a = Array.fill(n, { arg j; 1.0.rand2 });
// fill table
s.performList(\sendMsg, \b_gen, i, \sine1, 7, a);
});
)
::
|