iskip (optional, default=0) -- initial disposition of delay-loop data space (see reson). The default value is 0.
Performance
delay1 is a special form of delay that serves to delay the audio signal asig by just one sample. It is thus functionally equivalent to the delay opcode but is more efficient in both time and space. This unit is particularly useful in the fabrication of generalized non-recursive filters.
Examples
Here is an example of the delay and delay1 opcodes. It uses the file delay1.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform; Audio out Audio in-odac ;;;RT audio out; For Non-realtime ouput leave only the line below:; -o delay1.wav -W ;;; for file output any platform</CsOptions><CsInstruments>; by Menno Knevel 2021, after Russel Pinkstonsr=44100ksmps=32nchnls=20dbfs=1instr1; original soundsichoice=p4ifichoice==0thenprints"\n--**original beats**--\n\n"aoutdiskin2"drumsMlp.wav"elseprints"\n--**original noise**--\n\n"aoutrand.2endifoutsaout,aoutendininstr2; Finite Impulse Response (FIR) Filterichoice=p4ifichoice==0thenprints"\n--**FIRST-ORDER LOW-PASS on the beats**--\n\n"aoutdiskin2"drumsMlp.wav"elseprints"\n--**FIRST-ORDER LOW-PASS on the noise**--\n\n"aoutrand.2endifadel1delay1aout; delay 1 sample asig=(.5*aout)+(.5*adel1); average 2 succesive inputsoutsasig,asigendininstr3; Finite Impulse Response (FIR) Filter ichoice=p4ifichoice==0thenprints"\n--**FIRST-ORDER HIGH-PASS on the beats**--\n\n"aoutdiskin2"drumsMlp.wav"elseprints"\n--**FIRST-ORDER HIGH-PASS on the noise**--\n\n"aoutrand.2endifadel1delay1aout; delay 1 sampleasig=(.5*aout)-(.5*adel1); difference of 2 inputsoutsasig,asigendininstr4; Finite Impulse Response (FIR) Filter ichoice=p4ifichoice==0thenprints"\n--**SECOND-ORDER NOTCH on the beats**--\n\n"aoutdiskin2"drumsMlp.wav"elseprints"\n--**SECOND-ORDER NOTCH on the noise**--\n\n"aoutrand.2endifadel1delay1aout; x(n - 1)adel2delay1adel1; x(n - 2)asig=(.5*aout)+(.5*adel2); y(n) = .5x(n) + .5x(n - 2)outsasig,asigendininstr5; Finite Impulse Response (FIR) Filter ichoice=p4ifichoice==0thenprints"\n--**SECOND-ORDER BAND-PASS on the beats**--\n\n"aoutdiskin2"drumsMlp.wav"elseprints"\n--**SECOND-ORDER BAND-PASS on the noise**--\n\n"aoutrand.2endifadel1delay1aout; x(n - 1)adel2delay1adel1; x(n - 2)asig=(.5*aout)-(.5*adel2); y(n) = .5x(n) - .5x(n - 2)outsasig,asigendin</CsInstruments><CsScore>i1020i1321si2120i2421si3120i3421si4120i4421si5120i5421e</CsScore></CsoundSynthesizer>
This shows the result of the example: 5 times the beats and the noise. 1.Original samples, 2.first-order lowpass, 3.first-order highpass, 4.second-order notch and 5.second-order bandpass.