iatsfile – the ATS number (n in ats.n) or the name in quotes of the analysis file made using ATSA.
ibands – number of noise bands that will be used in the resynthesis (the noise has a maximum of 25 bands)
ibandoffset (optional) – is the first noise band used (defaults to 0).
ibandincr (optional) – sets an increment by which these synthesis opcodes counts up from ibandoffset for ibins components in the re-synthesis (defaults to 1).
Performance
ktimepnt – The time pointer in seconds used to index the ATS file. Used for ATSaddnz exactly the same as for pvoc and ATSadd.
ATSaddnz also reads from an ATS file but it resynthesizes the noise from noise energy data contained in the ATS file. It uses a modified randi function to create band limited noise and modulates that with a cosine wave, to synthesize a user specified selection of frequency bands. Modulating the noise is required to put the band limited noise in the correct place in the frequency spectrum.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac ;;;RT audio out;-iadc ;;;uncomment -iadc for RT audio input is needed too; For Non-realtime ouput leave only the line below:; -o ATSaddnzwav -W ;;; for file output any platform</CsOptions><CsInstruments>; by Menno Knevel - 2021sr=44100ksmps=32nchnls=20dbfs=1;ATSA wants a mono file!ires=system_i(1,{{ atsa Mathews.wav Mathews.ats }}); default optionsinstr1time:k=line(0,p3,p3)sig:a=ATSaddnz(time,"Mathews.ats",1,4); only 1 noise band, the 4th oneouts(sig*2,sig*2);amplifyendin</CsInstruments><CsScore>i1115.6e</CsScore></CsoundSynthesizer>
Here is a complete example of the ATSaddnz opcode. It uses the file ATSaddnz.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac ;;;RT audio out;-iadc ;;;uncomment -iadc for RT audio input is needed too; For Non-realtime ouput leave only the line below:; -o ATSaddnzwav -W ;;; for file output any platform</CsOptions><CsInstruments>; by Menno Knevel - 2021sr=44100ksmps=32nchnls=20dbfs=1;ATSA wants a mono file!iressystem_i1,{{ atsa Mathews.wav Mathews.ats }}; default optionsinstr1ktimeline0,p3,p3asigATSaddnzktime,"Mathews.ats",1,4; only 1 noise band, the 4th noise bandoutsasig*2,asig*2;amplifyendin</CsInstruments><CsScore>i1115.6e</CsScore></CsoundSynthesizer>
Here is another example of the ATSaddnz opcode. It uses the file ATSaddnz-2-modern.csd.
<CsoundSynthesizer><CsOptions>-odac -d -m1
</CsOptions><CsInstruments>;example by joachim heintz (& Menno Knevel)sr=44100ksmps=32nchnls=20dbfs=1;ATSA wants a mono file!;only 1 cycle and small hop sizeires=system_i(1,{{ atsa -h.1 -c1 fox.wav fox.ats }})instrAllTheNoisefile:S="fox.ats"prints("Resynthesizing with all the noise.\n")Dur:i=ATSinfo(file,7)p3=Durtime:k=line(0,Dur,Dur)sig:a=ATSaddnz(time,file,25)outs(sig,sig);start next instrevent_i("i","NoiseInBandsOfFive",Dur+1,1,0)endininstrNoiseInBandsOfFivefile:S="fox.ats"prints("Resynthesizing with noise bands %d - %d.\n",p4,p4+5)Dur:i=ATSinfo(file,7)p3=Durtime:k=line(0,Dur,Dur)sig:a=ATSaddnz(time,file,5,p4)outs(sig,sig);start next instrifp4<20thenevent_i("i","NoiseInBandsOfFive",Dur+1,1,p4+5)endifendin</CsInstruments><CsScore>i"AllTheNoise"01e25</CsScore></CsoundSynthesizer>
Here is another example of the ATSaddnz opcode. It uses the file ATSaddnz-2.csd.
<CsoundSynthesizer><CsOptions>-odac -d -m1
</CsOptions><CsInstruments>;example by joachim heintz (& Menno Knevel)sr=44100ksmps=32nchnls=20dbfs=1;ATSA wants a mono file!iressystem_i1,{{ atsa -h.1 -c1 fox.wav fox.ats }}; only 1 cycle and small hop sizeinstrAllTheNoiseSfile="fox.ats"prints"Resynthesizing with all the noise.\n"iDurATSinfoSfile,7p3=iDurktimeline0,iDur,iDurasigATSaddnzktime,Sfile,25outsasig,asig;start next instrevent_i"i","NoiseInBandsOfFive",iDur+1,1,0endininstrNoiseInBandsOfFiveSfile="fox.ats"prints"Resynthesizing with noise bands %d - %d.\n",p4,p4+5iDurATSinfoSfile,7p3=iDurktimeline0,iDur,iDurasigATSaddnzktime,Sfile,5,p4outsasig,asig;start next instrifp4<20thenevent_i"i","NoiseInBandsOfFive",iDur+1,1,p4+5endifendin</CsInstruments><CsScore>i"AllTheNoise"01e25</CsScore></CsoundSynthesizer>