You are on page 1of 1

1.5 Practice Paragraph 1.

5 - Introduction to working w ith sampled sound

RECORDING AN AUDIO FILE

The object t hat enables us to record sounds to disk is called sfre c ord - . Open
the f ile 01_ 1S_audiofile _record.m ax pat (seen in f igure 1. 56) to t ry it .

1) First. crea te 2) After that , activate the DSP by


an aJd io file Clicking on the "startwindow" message

3) Fina lly, record : 1 starts


recor ding and O stops it
...
pll asor- 660 -
record500
As an alternative, you can start
rec ording using the record
message, and include a duration
in milliseconds. In th is case,
recording will stop automatica lly.

... Once yo u've stopped record ing, it isn't


...
sfreco rd- 2 possible to re-rec ord using the same
file. You must create a new one .
( 0.
sfrecord- outputs elapsed
$t\lrtwindow
recording time in milliseconds
s~ .....
dac -

Fig. 1.56 The f ile 01_ 1S_audiof ile_record.maxpat

We can create an audio fi le on d isk by sending the comma nd "open" to t he


sf record- object. It is also possible to select the forma t to be used for the f ile
at th is po int : the possible choices match those that can be read by s fplay-.
Once we've created the audio fi le that will soon hold o ur sound, we still have
two steps to complete: f irst, we must click on "startw indow " to activate the
two triangle wave oscillators that w ill prod uce the signal that fl ows into the tw o
channels of the sfr e cord- object, and secondly, we must activate recording
wi th the toggle. (We can both start and stop the recording using th is con-
tro l.) Recording can also be activated by provid ing a du ration in milliseconds
when you send the "r ecord" comma nd. (This method circumvents the need to
manually stop recording.)

READING A SOUND FROM A MEMORY BUFFER


We've seen how to read and write sounds to and from disk, but it is also pos-
sible to load a sound file directly into compute r memory, in order to have faster
access than wou ld be possible from disk. (Access to disk dr ives is slow because
mechanical movement must occur whenever reading files from a disk.) For
example, if we wanted to load many diff erent sounds into a patch and then
move qu ickly betw een t hem, it wou ld be fastest to load all of the m into memory
and t hen hop back and fo rt h. The int ernal memory of a compute r, however, is
always more limited fo r space than its hard drive, and so for f iles that are very
long, t his technique wou ld not be reasonable. There is a tradeoff: if you wa nt
fast access, you' ll need to work w ith f iles t hat are short enoug h to be loaded
in memo ry, but if you want to use very long files (f iles that occupy more space
than you may have available in memory, o r which wou ld occupy the major part
102

You might also like