Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example & help files: cleanup and streamlining of server handling #1728

Merged
merged 1 commit into from
Nov 21, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion HelpSource/Classes/DebugNodeWatcher.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ For debugging, it can be useful to see every node start and end. It doesn't requ
Examples::

code::
s = Server.default;
s.boot;

d = DebugNodeWatcher(s);
Expand Down
4 changes: 2 additions & 2 deletions HelpSource/Classes/FFTTrigger.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ a flag. If 0.0, the buffer will be prepared for complex data, if > 0.0, polar da
examples::
code::
(
s.boot.doWhenBooted{
s.waitForBoot({
b = Buffer.alloc(s, 512);
};
});
)
// Reminder: This isn't the intended typical usage! It's OK to do this though.
(
Expand Down
2 changes: 1 addition & 1 deletion HelpSource/Classes/FreqScope.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ An instance of link::Classes/Color::. The background color of the scope.
discussion::
Example:
code::
s = Server.default.boot;
s.boot;

// create a new analyzer
FreqScope.new(400, 200, 0, server: s);
Expand Down
3 changes: 0 additions & 3 deletions HelpSource/Classes/Group.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,7 @@ Queries the server for a message describing this group's node subtree. (Sends a

Examples::
code::
(
s = Server.default; // just to be sure
s.boot;
)

(
SynthDef("help-Group-moto-rev", { arg out=0,freq=100,ffreq=120;
Expand Down
2 changes: 1 addition & 1 deletion HelpSource/Classes/Hilbert.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This value will be added to the output.
Examples::

code::
s = s.boot;
s.boot;
s.scope;
a = {Hilbert.ar(SinOsc.ar(100)) * -20.dbamp}.play;
a.release;
Expand Down
2 changes: 1 addition & 1 deletion HelpSource/Classes/HilbertFIR.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ A Buffer to be used for the inter FFT processing. Best results with a size of 10


code::
s = s.boot;
s.boot;
s.scope;
a = { HilbertFIR.ar(SinOsc.ar(100) * -20.dbamp, LocalBuf(2048) }.play;
a.release;
Expand Down
3 changes: 0 additions & 3 deletions HelpSource/Classes/In.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ Examples::

read from an audio bus:
code::
(
s = Server.local;
s.boot;
)

(
SynthDef("help-PinkNoise", { arg out=0;
Expand Down
4 changes: 2 additions & 2 deletions HelpSource/Classes/InBus.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ EXAMPLES::

code::
(
s.waitForBoot {
s.waitForBoot({
b = Bus.control(s, 3);
b.setn([1, 10, 100]);
}
})
)
{ InBus.kr(b, 1, 0).poll(2, "val"); 0.0 }.play;
{ InBus.kr(b, 1, 1).poll(2, "val"); 0.0 }.play;
Expand Down
4 changes: 2 additions & 2 deletions HelpSource/Classes/LevelIndicator.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ EXAMPLES::
code::
(
// something to meter
Server.default.boot.doWhenBooted {
s.waitForBoot({
b = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");

x = {
Expand All @@ -212,7 +212,7 @@ o = OSCFunc({arg msg;
a.peakLevel = msg[4].ampdb.linlin(-40, 0, 0, 1);
}.defer;
}, '/levels', s.addr);
}
})
)

(
Expand Down
2 changes: 0 additions & 2 deletions HelpSource/Classes/MIDIIn.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ code::
subsection::example with sound
code::
MIDIIn.connect;
s = Server.local;
s.boot;

(
Expand Down Expand Up @@ -315,7 +314,6 @@ code::
//Powerbook G4, 512mb ram.
//- matrix6k@somahq.com

s = Server.local;
s.boot;

(
Expand Down
4 changes: 2 additions & 2 deletions HelpSource/Classes/MultiSliderView.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ code::
(
var size;
size = 12;
s.waitForBoot{
s.waitForBoot({
n={arg freq=330; SinOsc.ar(freq,0,0.2)}.play;

w = Window("test", Rect(200 , 450, 10 + (size * 17), 10 + (size * 17)));
Expand Down Expand Up @@ -463,6 +463,6 @@ s.waitForBoot{
{w.close}.defer;
});
AppClock.play(r);
};
});
)
::
1 change: 0 additions & 1 deletion HelpSource/Classes/OSCresponderNode.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ code::
// example from SendTrig

(
s = Server.local;
s.boot;
s.notify;
)
Expand Down
4 changes: 2 additions & 2 deletions HelpSource/Classes/Onsets.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ list::
examples::
code::
(
s.boot.doWhenBooted {
s.waitForBoot({
// Prepare the buffers
b = Buffer.alloc(s, 512);
// Feel free to load a more interesting clip!
// a11wlk01 is not an ideal example of musical onsets.
d = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
};
});
)

////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
12 changes: 6 additions & 6 deletions HelpSource/Classes/PV_ChainUGen.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ Examples::
subsection:: pvcalc
code::
(
s.boot.doWhenBooted{
s.waitForBoot({
c = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
}
})
)

(
Expand All @@ -93,9 +93,9 @@ x.free;
subsection:: pvcalc2
code::
(
s.boot.doWhenBooted {
s.waitForBoot({
c = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
}
})
)

(
Expand Down Expand Up @@ -130,9 +130,9 @@ x.free;
subsection:: pvcollect
code::
(
s.boot.doWhenBooted{
s.waitForBoot({
c = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
}
})
)

(
Expand Down
8 changes: 4 additions & 4 deletions HelpSource/Classes/PV_Copy.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ destination buffer.
examples::
code::
(
s.waitForBoot {
s.waitForBoot({
d = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
}
})
)


Expand Down Expand Up @@ -72,13 +72,13 @@ x.free;


(
s.waitForBoot {
s.waitForBoot({
b = Buffer.alloc(s,2048,1);
c = Buffer.alloc(s,2048,1);
d = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
e = Buffer.alloc(s,2048,1);
f = Buffer.alloc(s,2048,1);
}
})
)


Expand Down
4 changes: 2 additions & 2 deletions HelpSource/Classes/PV_Div.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ Examples::
In this example we estimate the transfer function of the LPF UGen. The transfer function is estimated by dividing the FFT of the output, by the FFT of the input, and looking at the magnitudes in the result.
code::
(
s.waitForBoot {
s.waitForBoot({
var fftsize = 16384;
b = Buffer.alloc(s, fftsize)
}
})
);


Expand Down
4 changes: 2 additions & 2 deletions HelpSource/Classes/PartConv.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ code::
(
~fftsize=2048; // also 4096 works on my machine; 1024 too often and amortisation too pushed, 8192 more high load FFT

s.waitForBoot {
s.waitForBoot({

{
var ir, irbuffer, bufsize;
Expand Down Expand Up @@ -68,7 +68,7 @@ var ir, irbuffer, bufsize;
irbuffer.free; // don't need time domain data anymore, just needed spectral version
}.fork;

};
});

)

Expand Down
2 changes: 1 addition & 1 deletion HelpSource/Classes/Pbus.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ SynthDef(\wah, { arg out=0, gate=1;
)

// watch the node structure as it changes
s.waitForBoot { s.plotTree };
s.waitForBoot({ s.plotTree });


(
Expand Down
2 changes: 1 addition & 1 deletion HelpSource/Classes/Pgpar.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ SynthDef(\wah, { arg out=0, gate=1, rate=0.3;
)

// watch the node structure as it changes
s.waitForBoot { s.plotTree };
s.waitForBoot({ s.plotTree });


(
Expand Down
2 changes: 1 addition & 1 deletion HelpSource/Classes/Pgroup.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ code::
p = Pbind(\degree, Prand((0..7), inf), \dur, 0.3, \legato, 0.2);

// watch the node structure as it changes
s.waitForBoot { s.plotTree };
s.waitForBoot({ s.plotTree });

// one group
Pgroup(p).play;
Expand Down
3 changes: 0 additions & 3 deletions HelpSource/Classes/ProxyMonitorGui.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ is a GUI for controlling the top-level of a nodeproxy and its monitor. It is e.g
Examples::

code::
(
Server.default = s = Server.internal;
s.boot;
)

// make a proxy space and a test proxy
(
Expand Down
1 change: 0 additions & 1 deletion HelpSource/Classes/SCEnvelopeEdit.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ v.refresh; // must refresh editor

Controlling a Synth
code::
s = Server.internal;
s.boot;

(
Expand Down
1 change: 0 additions & 1 deletion HelpSource/Classes/SendTrig.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Examples::

code::

s = Server.local;
s.boot;

(
Expand Down
4 changes: 2 additions & 2 deletions HelpSource/Classes/Signal.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Signal.chebyFill(1000, [0.3, -0.8, 1.1]).plot;
// example) cancels out any DC offsets (third version), while making full use
// of the -1 to 1 range.
(
s.waitForBoot {
s.waitForBoot({
var amplitudes = [0, 1, 1, -2, 1];
var sigs = [
Signal.chebyFill(256+1, amplitudes, normalize: true, zeroOffset: true),
Expand All @@ -74,7 +74,7 @@ s.waitForBoot {
var in = SinOsc.ar(100, 0, SinOsc.kr(0.1, 0, 0.5, 0.5));
Shaper.ar(b, in ) ++ LeakDC.ar(Shaper.ar(b[1], in))
}.scope;
}
})
)
x.free; b.do(_.free); b = nil
::
Expand Down
2 changes: 1 addition & 1 deletion HelpSource/Classes/SpecFlatness.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ an link::Classes/FFT:: chain.
examples::

code::
s = Server.internal.boot;
s.boot;
b = Buffer.alloc(s,2048,1);

(
Expand Down
2 changes: 1 addition & 1 deletion HelpSource/Classes/SpecPcile.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ argument:: interpolate
examples::

code::
s = Server.internal.boot;
s.boot;
b = Buffer.alloc(s,2048,1);

// Simple demo with filtering white noise, and trying to infer the cutoff freq.
Expand Down
8 changes: 2 additions & 6 deletions HelpSource/Classes/Synth.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,13 @@ The synthdef has to be .add'ed, so that it is stored in the link::Classes/SynthD
Example:
code::
(
s.waitForBoot {
s.waitForBoot({
SynthDef(\helpSeti, { |freqs = #[100,150,200,250]|
Out.ar(0, SinOsc.ar(freqs.poll,0,0.1).sum ! 2)
}).add;
s.sync;
x = Synth(\helpSeti);
}
})
)
x.seti(\freqs,2,600); // set only the third element
x.seti(\freqs,1,[400,410]); // set second and third element
Expand All @@ -247,11 +247,7 @@ x.free;

Examples::
code::
// boot the default server
s = Server.default; // just to be sure
s.boot;


(
// send a synth def to server
SynthDef("tpulse", { arg out = 0,freq = 700, sawFreq = 440.0;
Expand Down
4 changes: 2 additions & 2 deletions HelpSource/Classes/Unpack1FFT.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ argument:: whichmeasure
examples::
code::
(
s.boot.doWhenBooted{
s.waitForBoot({
c = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
}
})
)

// Let's extract the DC component - i.e. the magnitude at index zero.
Expand Down
4 changes: 2 additions & 2 deletions HelpSource/Classes/UnpackFFT.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ code::
examples::
code::
(
s.boot.doWhenBooted {
s.waitForBoot({
var fftsize = 1024;
b = Buffer.alloc(s, fftsize, 1);
c = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
}
})
)

// This one just drags out various the values and posts them - a little bit pointless!
Expand Down
Loading