[PD] a simple recording/looping solution ?

julien.breval at tremplin-utc.net julien.breval at tremplin-utc.net
Mon Oct 25 13:18:43 CEST 2004


hello

Selon stephane <stephane.richard1 at tiscali.fr>:

> J'entends par "looping station", un patch capable d'enregistrer un 
> échantillon sonore (d'une durée indeterminée au moment de 
> l'enregistrement) en provenance de l' entrée d'une carte son  et de le 
> jouer en boucle à l'instant même ou l'enregistrement s'arrête.

Here is a simple solution, using a [table] and a Attack-Hold-Decay enveloppe
(for suppressing clicks when starting/stopping recording). 
Attack/Decay time is a parameter, it should be set to the closest possible to
zero ms (start with 10 ms, for example).
The recording is done in the [table] and the loop playing is obtained by reading
the table with a [phasor~] that has the right frequency and output factor, for
example
You have only one live control : start/stop. "start" triggers the recording, and
"stop" triggers looping playback. The time between start and stop must be
calculated (see "time-count" below).

Actually, "start" triggers several things at the same time (order is important,
use a [t] object):
1. stop looping playback : set the frequency of the phasor to 0 and reset phase
2. start time-count (from 0 ms, counts time until you hit "stop")
3. start recording
4. start enveloppe

"Stop" :
1. stop enveloppe
2. stop recording
3. stop time-count and store it somewhere (as "T" for example, in ms)
4. loop playing : set the [phasor~] frequency to 1/T and multipliate the output
value of the phasor by T*44.1 (tables use time values in samples, unlike max/msp
that works in ms) -- 44.1 is actually samplerate/1000  


It's not very optimized, but it gives you the idea of how it works. Looping
samplers shown in /pd/doc/3.audio.examples/ are a better way to start.

-j





More information about the Pd-list mailing list