Skip to content

Commit 934b9c2

Browse files
author
James Harkins
committed
Help: DiskOut: Explain the procedure in text (don't rely only on examples)
1 parent 2de6388 commit 934b9c2

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

HelpSource/Classes/DiskOut.schelp

+26
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,28 @@ Record to a soundfile to disk. Uses a link::Classes/Buffer::.
88

99
See link::Classes/RecordBuf:: for recording into a buffer in memory.
1010

11+
subsection:: Disk recording procedure
12+
13+
Recording to disk involves several steps, which should be taken in the right order. link::Classes/Server#-record:: performs these steps for you. To record arbitrary buses using DiskOut explicitly, make sure to do the following:
14+
15+
numberedlist::
16+
## Define a DiskOut link::Classes/SynthDef::, as shown in the example below.
17+
## Allocate a link::Classes/Buffer:: for recording.
18+
list::
19+
## The buffer size should be a power of two.
20+
## A duration of at least one second is recommended: code::s.sampleRate.nextPowerOfTwo::.
21+
## Do not allocate the buffer inside the SynthDef.
22+
## Keep the buffer in a variable.
23+
::
24+
## Specify the file path and recording format using link::Classes/Buffer#-write::, with the teletype::leaveOpen:: flag set to code::true::. This is the only way to set the file path and recording format.
25+
## Create a link::Classes/Synth:: node to run the DiskOut UGen.
26+
## When recording is finished, stop the DiskOut synth.
27+
## Close the buffer: code::b.close::. This step updates the recorded file's audio header. Without it, the file will be unusable.
28+
## Free the buffer: code::b.free::.
29+
::
30+
31+
These steps are illustrated in the Examples section. In general, only the "Object Style" approach is needed. ("Messaging Style" is provided as a historical reference, but it isn't needed for typical use.)
32+
1133
classmethods::
1234
private:: categories
1335

@@ -85,6 +107,10 @@ x.free; b.close; b.free; // cleanup
85107
subsection:: Messaging Style
86108
code::
87109
// The same thing done in Messaging Style (less overhead but without the convienence of objects)
110+
// This does nothing different from the Messaging Style example.
111+
// If any of the following is confusing, stick to Messaging Style
112+
// and ignore this part.
113+
88114
// start something to record
89115
s.sendMsg("/s_new", "bubbles", 2003, 1, 1);
90116

0 commit comments

Comments
 (0)