[plt-scheme] audio in Scheme

From: Noel Welsh (noelwelsh at gmail.com)
Date: Fri Dec 5 03:24:22 EST 2008

On Thu, Dec 4, 2008 at 2:48 PM, Stephen Bloch <sbloch at adelphi.edu> wrote:
> So what would I need?
>
> 1) I'd like to be able to copy and paste audio clips from, say, a Web page
> or a file into DrScheme, as I can currently copy and paste images.  I don't
> know how this would work, or whether it's already possible :-)  Is there an
> audio data type analogous to image-snip% ?

I dunno about copy and paste. libsndfile can read just about every
file format *except* MP3.  MAD supports MP3. portaudio gives you
cross-platform audio output and (I think) microphone input.

> 2) Obvious easy operations on audio clips: concatenate, reverse (in the time
> dimension), increase/decrease volume (i.e. scalar multiplication of
> amplitude), play simultaneously (i.e. add pointwise), amplitude-modulate
> (i.e. multiply pointwise), speed up and slow down (i.e. scalar
> multiplication in the time domain), find peak amplitude.

Do this in Scheme.  It should be fast enough, at least for simple problems.

> 3) Easy primitives: sine, square, and triangle waves of specified frequency
> and duration.

Do this in Scheme.

> 4) Not quite so trivial operations: transpose up or down without changing
> durations, change durations without changing pitch, invert pitches, apply a
> specified volume envelope (e.g. ADSR), convolve with a specified impulse
> response (e.g. to apply echo and reverb effects; is this actually the same
> operation?)

Hmmm... Try Scheme.

N.


Posted on the users mailing list.