sndloop Signal Generators:Sample Playback sndloop sndloop A sound looper with pitch control. Description This opcode records input audio and plays it back in a loop with user-defined duration and crossfade time. It also allows the pitch of the loop to be controlled, including reversed playback. Syntax asig, krec sndloop ain, kpitch, ktrig, idur, ifad Initialization idur -- loop duration in seconds ifad -- crossfade duration in seconds Performance asig -- output sig krec -- 'rec on' signal, 1 when recording, 0 otherwise kpitch -- pitch control (transposition ratio); negative values play the loop back in reverse ktrig -- trigger signal: when 0, processing is bypassed. When switched on (ktrig >= 1), the opcode starts recording until the loop memory is full. It then plays the looped sound until it is switched off again (ktrig = 0). Another recording can start again with ktrig >= 1. Examples Here is an example of the sndloop opcode. It uses the file sndloop.csd. Example of the sndloop opcode. See the sections Real-time Audio and Command Line Flags for more information on using command line flags. The example above shows the basic operation of sndloop. Pitch can be controlled at the k-rate, recording is started as soon as the trigger value is >= 1. Recording can be restarted by making the trigger 0 and then 1 again. See also Sample Playback Credits Author: &namevictor; April 2005 New in Version 5.00