soundscrape

A programmatic framework for modular synthesis:
Scheme in the front, C in the back!
< | ^ | > | :>

reading from and writing to disk

Soundscrape uses the libsndfile library to perform input and output to files, which allows it quite a range of supported audio formats.

input: disk-in

Input from sound files on disk is accomplished with the disk-in unit generator, which only operates at audio rate. Calling audio on this class will return a list of as many channels as the sound file contains.

;; Render a drum beat
(render (audio syndrum ;; look up syndrum in the help
               :trigger (control random-osc 2) ;; same with random-osc
               :velocity 1.0
               :frequency 200
               :resonance 0.1)
        5
        "my-sound-file.wav")

;; now play the file
(play (audio disk-in "my-sound-file.wav"))

;; we can even delete it from scheme -- dangerous but useful
(delete-file "my-sound-file.wav")

;; audio for disk-in has two extra optional arguments, loop? and
;; start-frame. both are accepted but have no effect on input, as they
;; are not implemented yet.

output

For the moment, render and record are the only ways to write to disk. However, as it is sometimes useful to have more control over the process, a disk-out unit generator will appear sometime in the future.

The last two arguments to render and record specify the type of file to create. The first specifies the major type, and can be set with the keyword :type. Possible values for :type include the following:

aiff

Apple/SGI

au

Sun/NeXT

iff

Amiga IFF/SVX8/SV16

mat

GNU Octave 2.0 / Matlab 4.2

mat-MAT5--GNU-Octave-2-1---Matlab-5-0-

GNU Octave 2.1 / Matlab 5.0

paf

Ensoniq PARIS

pvf

Portable Voice Format

raw

header-less file

sf

Berkeley/IRCAM/CARL

voc

Creative Labs

w64

SoundFoundry WAVE 64

wav

Microsoft

wav-WAV--NIST-Sphere-

NIST Sphere

xi

FastTracker 2

The second of the two type arguments specifies the minor type, accesible via the :format keyword. Not all of the major-minor combinations are supported; see the sndfile page, listed in the references, for more information. Possible values for the minor type are self-explanatory, and are listed in the following table:

The exact set of major and minor types may change as libsndfile develops. According to the web page, its author is currently planning to implement support for Soundfont II, Gravis Ultrasound, Kurtzweil K2000, Ogg Vorbis, and FLAC files.

< | ^ | > | :>