You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
427 lines
5.2 KiB
427 lines
5.2 KiB
(
|
|
s.boot;
|
|
)
|
|
|
|
(
|
|
FreqScope.new;
|
|
)
|
|
|
|
(
|
|
{
|
|
WhiteNoise.ar(0.1)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
LPF.ar(WhiteNoise.ar(0.1), 1000)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
HPF.ar(LPF.ar(WhiteNoise.ar(0.1), 1000), 1000)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
LPF.ar(WhiteNoise.ar(0.1), Line.kr(10000, 1000, 10))
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
Resonz.ar(
|
|
LFNoise0.ar(400),
|
|
1000,
|
|
0.1
|
|
)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
Resonz.ar(
|
|
LFNoise0.ar(400),
|
|
Line.kr(10000, 1000, 10),
|
|
0.1
|
|
)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
var source, line, filter;
|
|
|
|
source = LFNoise0.ar(400);
|
|
line = Line.kr(10000, 1000, 10);
|
|
filter = Resonz.ar(source, line, 0.1);
|
|
|
|
filter
|
|
}.scope;
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar(400, 0, 0.1) + SinOsc.ar(660, 0, 0.1)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar([400, 660], 0, 0.1)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
Pan2.ar(
|
|
WhiteNoise.ar(0.1),
|
|
MouseX.kr(-1, 1)
|
|
)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar([400], 0, 0.1)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar(400, 0, 0.1)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar([400, 660, 870], 0, 0.1)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
Mix(
|
|
SinOsc.ar([400, 660], 0, 0.1)
|
|
)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
Pan2.ar(
|
|
Mix(
|
|
SinOsc.ar([400, 660], 0, 0.1)
|
|
),
|
|
MouseX.kr(-1, 1)
|
|
)
|
|
}.scope
|
|
)
|
|
|
|
// sawtooth wave
|
|
(
|
|
{
|
|
var n = 10;
|
|
var wave = Mix.fill(10, { |i|
|
|
var mult = ((-1) ** i) * (0.5 / ((i + 1)));
|
|
SinOsc.ar(440 * (i + 1)) * mult
|
|
});
|
|
|
|
Pan2.ar(wave / n, 0.0);
|
|
}.scope
|
|
)
|
|
|
|
// square wave
|
|
(
|
|
{
|
|
var n = 10;
|
|
var wave = Mix.fill(10, { |i|
|
|
var harmonicnumber = 2 * i + 1;
|
|
SinOsc.ar(440 * harmonicnumber) / harmonicnumber
|
|
}) * 0.25;
|
|
|
|
Pan2.ar(wave, 0.0);
|
|
}.scope
|
|
)
|
|
|
|
// triangle wave
|
|
(
|
|
{
|
|
var n = 10;
|
|
var wave = Mix.fill(10, { |i|
|
|
var harmonicnumber = 2 * i + 1;
|
|
var mult = ((-1) ** ((harmonicnumber - 1)/2)) * (1.0/(harmonicnumber*harmonicnumber));
|
|
SinOsc.ar(440 * i) * mult
|
|
})/n;
|
|
|
|
Pan2.ar(wave, 0.0);
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
Mix(
|
|
SinOsc.ar(500 * [0.5, 1, 1.19, 1.56, 2.51, 2.66, 3.01, 4.1], 0, 0.1)
|
|
)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
Mix(
|
|
SinOsc.ar(
|
|
500 * [0.5, 1, 1.19, 1.56, 2.51, 2.66, 3.01, 4.1],
|
|
0,
|
|
0.1 * [0.25, 1, 0.8, 0.5, 0.9, 0.4, 0.3, 0.6, 0.1]
|
|
)
|
|
)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
var n = 10;
|
|
|
|
{
|
|
Mix(SinOsc.ar(250 * (1..n), 0, 1/n))
|
|
}.scope
|
|
)
|
|
|
|
// 2.2
|
|
|
|
(
|
|
{
|
|
SinOsc.ar(mul: 0.1)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar(mul: 2.0)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar(mul: 0.1)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar(
|
|
mul: MouseY.kr(1.0, 0.1)
|
|
)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar(
|
|
mul: 0.1, add: MouseY.kr(0.9, -0.9)
|
|
)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar(
|
|
mul: MouseX.kr(0.1, 1.0),
|
|
add: MouseY.kr(0.9, -0.9)
|
|
)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
var cutoff = SinOsc.ar(
|
|
1,
|
|
mul: MouseX.kr(0.0, 1700.0),
|
|
add: 2000.0
|
|
);
|
|
|
|
LPF.ar(
|
|
WhiteNoise.ar,
|
|
freq: cutoff
|
|
);
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
0.1 * SinOsc.ar
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar(mul: 0.1)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
0.1 * SinOsc.ar + 0.5
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar(mul: 0.1, add: 0.5)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
var cutoff = SinOsc.ar(1) * 1700.0 + 2000.0;
|
|
LPF.ar(WhiteNoise.ar, freq: cutoff)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar(440, 0.0, 0.1, 0.0)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar(MouseX.kr(440, 880), 0.0, 0.1, 0.0)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar(MouseX.kr(440, 880), mul: 0.1)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar(440, mul: -20.dbamp)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
SinOsc.ar(
|
|
40 * SinOsc.ar(MouseX.kr(1, 20)) + 440,
|
|
0,
|
|
0.1
|
|
)
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
a = {
|
|
SinOsc.ar(440) * 0.1
|
|
}.play;
|
|
)
|
|
|
|
(
|
|
a.run(false);
|
|
)
|
|
|
|
(
|
|
a.run;
|
|
)
|
|
|
|
(
|
|
a.free;
|
|
)
|
|
|
|
(
|
|
a = {
|
|
arg freq=440;
|
|
SinOsc.ar(freq) * 0.1
|
|
}.play
|
|
)
|
|
|
|
(
|
|
a = {
|
|
arg freq=440, amp=0.1;
|
|
SinOsc.ar(freq) * amp;
|
|
}.play
|
|
)
|
|
|
|
(
|
|
a.set(\freq, rrand(220, 440), \amp, rrand(0.05, 0.2));
|
|
)
|
|
|
|
(
|
|
{
|
|
var carrier, modulator, carrfreq, modfreq;
|
|
|
|
carrfreq = MouseX.kr(440, 5000, 'exponential');
|
|
modfreq = MouseY.kr(1, 5000, 'exponential');
|
|
|
|
carrier = SinOsc.ar(carrfreq, 0, 0.5);
|
|
modulator = SinOsc.ar(modfreq, 0, 0.5);
|
|
|
|
carrier * modulator;
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
{ SinOsc.ar(440, 0, 0.5) }.scope
|
|
)
|
|
|
|
(
|
|
{ SinOsc.ar(440, 0, 0.5, 0.5) }.scope
|
|
)
|
|
|
|
(
|
|
{
|
|
var carrier, modulator, carrfreq, modfreq;
|
|
|
|
carrfreq = MouseX.kr(440, 5000, 'exponential');
|
|
modfreq = MouseY.kr(1, 5000, 'exponential');
|
|
|
|
carrier = SinOsc.ar(carrfreq, 0, 0.5);
|
|
modulator = SinOsc.ar(modfreq, 0, 0.25, 0.25);
|
|
|
|
carrier * modulator;
|
|
}.scope
|
|
)
|
|
|
|
(
|
|
var w, carrfreqslider, modfreqslider, moddepthslider, synth;
|
|
|
|
w = Window("frequency modulation", Rect(100, 400, 400, 300));
|
|
w.view.decorator = FlowLayout(w.view.bounds);
|
|
|
|
synth = {
|
|
arg carrfreq=440, modfreq=1, moddepth=0.1;
|
|
SinOsc.ar(carrfreq + (moddepth * SinOsc.ar(modfreq)), 0, 0.25)
|
|
}.scope;
|
|
|
|
carrfreqslider = EZSlider(
|
|
w, 300@50, "carrfreq",
|
|
ControlSpec(20, 5000, 'exponential', 10, 440),
|
|
{ |ez| synth.set(\carrfreq, ez.value) }
|
|
);
|
|
w.view.decorator.nextLine;
|
|
|
|
modfreqslider = EZSlider(
|
|
w, 300@50, "modfreq",
|
|
ControlSpec(1, 5000, 'exponential', 1, 1),
|
|
{ |ez| synth.set(\modfreq, ez.value) }
|
|
);
|
|
w.view.decorator.nextLine;
|
|
|
|
moddepthslider = EZSlider(
|
|
w, 300@50, "moddepth",
|
|
ControlSpec(0.01, 5000, 'exponential', 0.01, 0.01),
|
|
{ |ez| synth.set(\moddepth, ez.value) }
|
|
);
|
|
|
|
w.front;
|
|
)
|