fold

fold — Adds artificial foldover to an audio signal.

Description

Adds artificial foldover to an audio signal.

Syntax

ares fold asig, kincr

Performance

asig -- input signal

kincr -- amount of foldover expressed in multiple of sampling rate. Must be >= 1

fold is an opcode which creates artificial foldover. For example, when kincr is equal to 1 with sr=44100, no foldover is added. When kincr is set to 2, the foldover is equivalent to a downsampling to 22050, when it is set to 4, to 11025 etc. Fractional values of kincr are possible, allowing a continuous variation of foldover amount. This can be used for a wide range of special effects.

Examples

Here is an example of the fold opcode. It uses the file fold.csd.

Example 311. Example of the fold opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac      ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o fold.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

instr 1

asig  poscil3 .8, 400, 1 ;very clean sine
kincr line p4, p3, p5
asig  fold asig, kincr
      outs asig, asig

endin
</CsInstruments>
<CsScore>
;sine wave.
f 1 0 16384 10 1

i 1 0  4 2  2 
i 1 5  4 5  5 
i 1 10 4 10 10 
i 1 15 4 1 100	; Vary the fold-over amount from 1 to 100

e
</CsScore>
</CsoundSynthesizer>


Credits

Author: Gabriel Maldonado
Italy
1999

New in Csound version 3.56