[Csnd] loop with ATSpartialtap
Date | 2010-12-05 20:42 |
From | Stefan Thomas |
Subject | [Csnd] loop with ATSpartialtap |
Dear community, I have a question concerning ATSpartialtap. I would like to use loops in the below quoted example for the part krealfreq1, kamp1 ATSpartialtap 1(etc.) Is it possible to do that: Here is my filecode: <CsoundSynthesizer> <CsOptions> </CsOptions> <CsInstruments> sr = 48000 ksmps = 100 nchnls = 2 0dbfs = 1 gisine ftgen 0,0,2^10, 10, 1 instr 1 inote notnum ilaut veloc iamp ampmidi 1 icps cpsmidi ktime line 0, 10, 4.9 inumberofpartials = 5 ATSbufread ktime, 1, "guitarE.ats", inumberofpartials; reads the first 5 partials of the file krealfreq1, kamp1 ATSpartialtap 1 krealfreq2, kamp2 ATSpartialtap 2 krealfreq3, kamp3 ATSpartialtap 3 krealfreq4, kamp4 ATSpartialtap 4 krealfreq5, kamp5 ATSpartialtap 5 ; changing the freqencies of the partials ioktave = 2 ipar1 = icps ipar2 = icps*ioktave ipar3 = icps*ioktave^1.5849625007211563 ipar4 = icps*ioktave^2 ipar5 = icps*ioktave^2.321928094887362 ; sending it to poscil schicken iwave = gisine apar1 poscil kamp1, ipar1, iwave apar2 poscil kamp2, ipar2, iwave apar3 poscil kamp3, ipar3, iwave apar4 poscil kamp4, ipar4, iwave apar5 poscil kamp5, ipar5, iwave ; mix it all together asig = apar1+apar2+apar3+apar4+apar5 outs iamp*asig, iamp*asig endin </CsInstruments> ; ============================================== <CsScore> f 0 3600 i1 0 3600 </CsScore> </CsoundSynthesizer> |
Date | 2010-12-06 10:36 |
From | peiman khosravi |
Subject | [Csnd] Re: loop with ATSpartialtap |
What do you mean exactly by loops? On 5 December 2010 20:42, Stefan Thomas |
Date | 2010-12-06 12:31 |
From | Stefan Thomas |
Subject | [Csnd] Re: Re: loop with ATSpartialtap |
Dear Peiman, sorry for making anyone nervous. I found a solution for my code! It works fine now. I've quoted it below. Maybee someone else is trying to do something similar <CsoundSynthesizer> <CsOptions> </CsOptions> <CsInstruments> sr = 44100 ksmps = 100 nchnls = 2 0dbfs = 1 giPartfreqs ftgen 0, 0, -30, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 giSine ftgen 0, 0, 2^10, 10, 1 massign 0, 1 instr 10 gimaxdur = 16 ; maximum duration endin instr 1 ;triggered by midi. Calls inumparts instances of instr 100 inumparts = 19 ; number of partials imidinot notnum icps cpsmidi iamp ampmidi 1 idur = gimaxdur indx = 1 ; start with first partial isubinstr = 100+imidinot/1000 ;e.g 100.060 für c loop: ipartfreq tab_i indx-1, giPartfreqs ipartfreq = ipartfreq * icps event_i "i", isubinstr, 0, idur, ipartfreq, iamp, indx loop_le indx, 1, inumparts, loop krelease release if krelease == 1 then ; for the noteoff-event turnoff2 isubinstr, 4, 1 endif endin instr 100 ;spielt einen teilton: hohe teiltöne sind kürzer iamp ampmidi 1 idur = p3 ; duration ifreq = p4 ;partial frequency iamp = p5 ; key velocity ittnr = p6 ; partial number ifiledur = 4 ktime line 0, 15, ifiledur ifilecode = 1 imaxpartials = 19 ATSbufread ktime, 1, "guitarE.ats", imaxpartials krealfreq, kamp ATSpartialtap ittnr asig poscil iamp*kamp, ifreq, giSine aout = asig outs aout, aout endin </CsInstruments> <CsScore> f 0 36 i 1 0 36 ; i 10 0 36 </CsScore> </CsoundSynthesizer> 2010/12/6 peiman khosravi <peimankhosravi@gmail.com> What do you mean exactly by loops? |