Returns a frequency, amplitude pair from an atsbufread opcode.
Note
Up to Csound 6, this opcode was called ATSpartialtap.
Syntax
kfrq,kamp=atspartialtap(ipartialnum)
kfrq,kampATSpartialtapipartialnum
Initialization
ipartialnum - selects a partial from the current atsbufread buffer, starting at 1. It must not exceed that reader's ipartials. This is a position within the selected buffer, not the original file's partial number.
An atsbufread must initialize first in the same instrument, UDO or subinstrument instance. See reader scope and order.
Performance
kfrq - returns the frequency value for the requested partial.
kamp - returns the amplitude value for the requested partial.
During performance, atspartialtap uses the last atsbufread that ran in its instance. If that reader has fewer partials than ipartialnum, the opcode reports a performance error. A reader in another instance cannot supply the data.
atspartialtap takes a partial number and returns a frequency, amplitude pair. The frequency and amplitude data comes from an atsbufread opcode. This is more restricted version of atsread, since each atsread opcode has its own independent time pointer, and atspartialtap is restricted to the data given by an atsbufread. Its simplicity is its attractive feature.
<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 ATSpartialtap.wav -W ;;; for file output any platform</CsOptions><CsInstruments>sr=44100ksmps=32nchnls=20dbfs=1; by Menno Knevel - 2023; default settingsres1:i=systemi(1,{{ atsa drumsMlp.wav drumsMlp1.ats }}); longer hopsize & more cyclesres2:i=systemi(1,{{ atsa -h.8 -c8 drumsMlp.wav drumsMlp2.ats }})instr1time:k=line(0,p3,2)atsbufread(time,1,p4,54)freq1:k,amp1:k=atspartialtap(5)freq2:k,amp2:k=atspartialtap(20)freq3:k,amp3:k=atspartialtap(30)out1:a=poscil(amp1,freq1,1)out2:a=poscil(amp2,freq2,1)out3:a=poscil(amp3,freq3,1)Out:a=(out1+out2+out3)*10; amplify some moreout(Out*p5,Out*p5)endin</CsInstruments><CsScore>f10163841010.50.33; square-ish wave; stretch the drums...i102"drumsMlp1.ats"2.5; defaults settings for ATSAi1310"drumsMlp2.ats"1; different settingse</CsScore></CsoundSynthesizer>
Here is an example of the ATSpartialtap opcode. It uses the file ATSpartialtap.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 ATSpartialtap.wav -W ;;; for file output any platform</CsOptions><CsInstruments>sr=44100ksmps=32nchnls=20dbfs=1; by Menno Knevel - 2023ires1system_i1,{{ atsa drumsMlp.wav drumsMlp1.ats }}; default settingsires2system_i1,{{ atsa -h.8 -c8 drumsMlp.wav drumsMlp2.ats }}; longer hopsize & more cyclesinstr1ktimeline0,p3,2ATSbufreadktime,1,p4,54kfreq1,kam1ATSpartialtap5kfreq2,kam2ATSpartialtap20kfreq3,kam3ATSpartialtap30aout1oscilkam1,kfreq1,1aout2oscilkam2,kfreq2,1aout3oscilkam3,kfreq3,1aout=(aout1+aout2+aout3)*10; amplify some moreoutsaout*p5,aout*p5endin</CsInstruments><CsScore>f10163841010.50.33; square-ish wave; stretch the drums...i102"drumsMlp1.ats"2.5; defaults settings for ATSAi1310"drumsMlp2.ats"1; different settingse</CsScore></CsoundSynthesizer>
This example here uses an atspartialtap, and an atsbufread to read partials 5, 20 and 30 from 'beats.ats'. These amplitudes and frequencies could be used to re-synthesize those partials, or something all together different.