<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac ;;;realtime audio out;-iadc ;;;uncomment -iadc if RT audio input is needed too; For Non-realtime ouput leave only the line below:; -o loop_gt.wav -W ;;; for file output any platform; By Stefano Cucchi - 2021</CsOptions><CsInstruments>sr=44100ksmps=32nchnls=20dbfs=1saw@global:i=ftgen(3,0,16384,10,0,0.2,0,0.4,0,0.6,0,0.8,0,1,\
0,0.8,0,0.6,0,0.4,0,0.2)instr1;master instrumentndxFreq:i=p5loop:freq:i=p4+ndxFreqprint(freq)amp:i=0.5/((p5-p7)/p6)eventi("i",10,0,p3,amp,freq)loopgt(ndxFreq,p6,p7,loop)endininstr10sig:a=oscili(p4,p5,saw)sig=butterhp(sig,50)declick:k=linseg(0,0.1,1,p3-0.2,1,0.1,0)out(sig*declick,sig*declick)endin</CsInstruments><CsScore>i1022001031i12220040.31i1422005571i16220030.21e</CsScore></CsoundSynthesizer>
Here is an example of the loop_gt opcode. It uses the file loop_gt.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac ;;;realtime audio out;-iadc ;;;uncomment -iadc if RT audio input is needed too; For Non-realtime ouput leave only the line below:; -o loop_gt.wav -W ;;; for file output any platform; By Stefano Cucchi - 2021</CsOptions><CsInstruments>sr=44100ksmps=32nchnls=20dbfs=1gisawftgen3,0,16384,10,0,.2,0,.4,0,.6,0,.8,0,1,0,.8,0,.6,0,.4,0,.2instr1;master instrumentindxFreq=p5loop:ifreq=p4+indxFreqprintifreqiamp=0.5/((p5-p7)/p6)event_i"i",10,0,p3,iamp,ifreqloop_gtindxFreq,p6,p7,loopendininstr10asigoscilip4,p5,gisawasigbutterhpasig,50kdeclicklinseg0,0.1,1,p3-0.2,1,0.1,0outsasig*kdeclick,asig*kdeclickendin</CsInstruments><CsScore>i1022001031i12220040.31i1422005571i16220030.21e</CsScore></CsoundSynthesizer>