ServerRecordWindow
part of wslib
A dedicated graphic interface for recording from a Server
w = ServerRecordWindow( s );
ServerRecordWindow ( server, nodeID )
The controls in the window you get should be self-explanatory.
There can be no more then one ServerRecordWindow per server. If you create another one for the same server it will just bring the window of the already existing one to the front.
The filename popupmenu gives you the following options:
auto name
the filename will be automatically generated as soon as the "prepare" button is hit. This is the default SuperCollider behaviour for Server:prepareForRecord is called.
<a filename> / recording.aif
if this item is selected the server will record to the file at that path, overwriting it without notice if it already exsists. The filename item will change to that of the last recorded file name after recording.
specify..
specify brings up a SCRequestString dialog where you can change the filename displayed in the item above.
browse..
brings up a CocoaDialog:savePanel where you can enter a name and browse for a location
The show button shows the folder where ServerRecordWindow will be recording to in the Finder.
The time counter will keep running during recording, and will display the total duration after recording was stopped. This counter is not sample accurate, and may drift when you record very long sections or hit pause a lot.
Once you've hit prepare there's no way back; the header for the file is then already created. The filename and format etc. cannot be changed anymore then. Make sure you're not overwriting any important files by hitting "prepare" too early. If you press it by accident you need to press record and stop to return to the initial state.
prepare, record, pause, stop
These are methods to automate ServerRecordWindow
w = ServerRecordWindow( s );
(
SynthDef( "sinegrain", { |freq = 440, sustain = 0.1, amp = 0.1, pan = 0|
Out.ar(0,
Env.sine( sustain, amp ).kr(2) *
Pan2.ar( SinOsc.ar( freq ), pan ) );
}).store;
)
(
p = Pbind(
\instrument, \sinegrain,
\freq, Pwhite( 110, 2200, inf ),
\dur, Pwhite( 0.001, 0.01, inf ),
\legato, Pwhite( 0.25, 4, inf ),
\pan, Pwhite( -1.0, 1.0, inf ),
\amp, Pwhite(0.005, 0.01, inf )
);
)
// now by hand select a file format and filename if you wish in the window
w.prepare;
(
w.record;
q = p.play( quant: 0 );
TempoClock.default.sched( 5, { q.stop; } ); // after 5 secs stop the pattern
TempoClock.default.sched( 5.1, { { w.stop; }.defer; } ); // 0.1 sec later stop recording
)