iatsfile – the ATS number (n in ats.n) or the name in quotes of the analysis file made using ATSA.
ipartials – number of partials that will be used in the resynthesis (the noise has a maximum of 25 bands)
ipartialoffset (optional) – is the first partial used (defaults to 0).
ipartialincr (optional) – sets an increment by which these synthesis opcodes counts up from ipartialoffset 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 ATSbufread exactly the same as for pvoc.
kfmod – an input for performing pitch transposition or frequency modulation on all of the synthesized partials, if no fm or pitch change is desired then use a 1 for this value.
ATSbufread is based on pvbufread by Richard Karpen. ATScross, ATSinterpread and ATSpartialtap are all dependent on ATSbufread just as pvcross and pvinterp are on pvbufread. ATSbufread reads data from and ATS data file and stores it in an internal data table of frequency, amplitude pairs. The data stored by an ATSbufread can only be accessed by other unit generators, and therefore, due to the architecture of Csound, an ATSbufread must come before (but not necessarily directly) any dependent unit generator. Besides the fact that ATSbufread does not output any data directly, it works almost exactly as ATSadd. The ugen uses a time pointer (ktimepnt) to index the data in time, ipartials, ipartialoffset and ipartialincr to select which partials to store in the table and kfmod to scale partials in frequency.
Examples
Here is an example of the ATSbufread opcode. It uses the file ATSbufread-modern.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac --limiter=.95 ;;;RT audio out;-iadc ;;;uncomment -iadc for RT audio input is needed too; For Non-realtime ouput leave only the line below:; -o ATSbufread.wav -W ;;; for file output any platform</CsOptions><CsInstruments>sr=44100ksmps=32nchnls=20dbfs=1; by Menno Knevel - 2023;ATSA wants a mono file!;it takes a while to analyze these files...ires1=system_i(1,{{ atsa finneganswake1.flac finneganswake.ats }})prints("\n***1st analyzed file is ready***\n\n")ires2=system_i(1,{{ atsa drumsMlp.wav drumsMlp.ats }})prints("\n***2nd analyzed file is ready***\n\n")instr1res1:i=ATSinfo("finneganswake.ats",3); get number of partialsres2:i=ATSinfo("drumsMlp.ats",3); get number of partialsprints("\n***number of partials of finneganswake.ats = %d***\n\n",res1)prints("\n***number of partials of drumsMlp.ats = %d***\n\n",res2)time1:k=line(0,p3,12.67)time2:k=line(0,p3,2)Line:k=line(0,p3,1); cross from voice to the beatsATSbufread(time1,1,"finneganswake.ats",res1)aout=ATScross(time2,1,"drumsMlp.ats",1,Line,1,res2)outs(aout*2.5,aout*2.5)endin</CsInstruments><CsScore>; sinoid wave.f1016384101.3.1.5i1012.7e</CsScore></CsoundSynthesizer>
Here is an example of the ATSbufread opcode. It uses the file ATSbufread.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac --limiter=.95 ;;;RT audio out;-iadc ;;;uncomment -iadc for RT audio input is needed too; For Non-realtime ouput leave only the line below:; -o ATSbufread.wav -W ;;; for file output any platform</CsOptions><CsInstruments>sr=44100ksmps=32nchnls=20dbfs=1; by Menno Knevel - 2023;ATSA wants a mono file!;it takes a while to analyze these files...ires1system_i1,{{ atsa finneganswake1.flac finneganswake.ats }}prints"\n***1st analyzed file is ready***\n\n"ires2system_i1,{{ atsa drumsMlp.wav drumsMlp.ats }}prints"\n***2nd analyzed file is ready***\n\n"instr1ires1ATSinfo"finneganswake.ats",3; get number of partialsires2ATSinfo"drumsMlp.ats",3; get number of partialsprints"\n***number of partials of finneganswake.ats = %d***\n\n",ires1prints"\n***number of partials of drumsMlp.ats = %d***\n\n",ires2ktime1line0,p3,12.67ktime2line0,p3,2klineline0,p3,1; cross from voice to the beatsATSbufreadktime1,1,"finneganswake.ats",ires1aoutATScrossktime2,1,"drumsMlp.ats",1,kline,1,ires2outsaout*2.5,aout*2.5endin</CsInstruments><CsScore>; sinoid wave.f1016384101.3.1.5i1012.7e</CsScore></CsoundSynthesizer>