[Csnd] instr in udo
Date | 2012-02-20 12:33 |
From | Stefan Thomas |
Subject | [Csnd] instr in udo |
Dear community, is it impossible to integrate an instr endin section in an UDO? I've tried it, but unseccessfully. |
Date | 2012-02-20 12:40 |
From | peiman khosravi |
Subject | Re: [Csnd] instr in udo |
Why? Surely there must be a better workaround. P On 20 February 2012 12:33, Stefan Thomas <kontrapunktstefan@googlemail.com> wrote: Dear community, |
Date | 2012-02-20 13:22 |
From | Stefan Thomas |
Subject | Re: [Csnd] instr in udo |
Dear Peiman, I've tried it with the below quoted code, which is just a test. The problem here is the instr- section within the opcode, I get the error message: instr not allowed in opcode block, line 31:Here is my code: <CsoundSynthesizer> <CsOptions> -odevaudio -Ma -b-1 -B 4096 -m0d </CsOptions> ; ============================================== <CsInstruments> sr = 48000 ksmps = 100 nchnls = 2 0dbfs = 1 gisine ftgen 0,0,2^10, 10, 1 opcode SimpleAdsyn, 0,iiiii inumparts,imaxdur,iatt,imaxamp,isubinstrumentnumber xin iamp ampmidi imaxamp icps cpsmidi ipartnumber = 1 isubinstr = isubinstrumentnummer+imidinot/1000 loop: ipartamp = iamp/ipartnumber ipartfreq = ipartnumber * icps idur = imaxdur/ipartnumber iatt = iatt/ipartnumber event_i "i", isubinstrumentnumber, 0, idur, ipartfreq, ipartamp, ipartnumber,iatt loop_le ipartnumber, 1, inumparts, loop krelease release if krelease == 1 then turnoff2 isubinstrumentnumber, 4, 1 endif instr isubinstrumentnumber idur = p3 ipartfreq = p4 ipartamp = p5 ipartnumber = p6 iatt = p7 aenv linsegr 0, iatt, 1, idur,0, 0,1, 0 asig poscil aenv*ipartamp, ipartfreq, gisine outs asig, asig endin endop instr 1 inumparts = 5 imaxdur = 5 iatt = 0.1 imaxamp = 1 isubinstrumentnumber = 101 SimpleAdsyn inumparts,imaxdur,iatt,imaxamp,isubinstrumentnumber endin </CsInstruments> ; ============================================== <CsScore> f 0 10 i1 0 10 </CsScore> </CsoundSynthesizer> Am 20. Februar 2012 13:40 schrieb peiman khosravi <peimankhosravi@gmail.com>: Why? Surely there must be a better workaround. |
Date | 2012-02-20 14:49 |
From | peiman khosravi |
Subject | Re: [Csnd] instr in udo |
I see. But you can have the instr block defined as a separate instrument rather than enclosing it inside your UDO right? P On 20 February 2012 13:22, Stefan Thomas <kontrapunktstefan@googlemail.com> wrote: Dear Peiman, |
Date | 2012-02-20 15:21 |
From | Stefan Thomas |
Subject | Re: [Csnd] instr in udo |
Yes, but I would like to include it in the UDO, if possible. Maybee something can be done with macros? Am 20. Februar 2012 15:49 schrieb peiman khosravi <peimankhosravi@gmail.com>: I see. But you can have the instr block defined as a separate instrument rather than enclosing it inside your UDO right? |
Date | 2012-02-20 15:44 |
From | Adam Puckett |
Subject | Re: [Csnd] instr in udo |
Why do you want an instrument inside an opcode? On 2/20/12, Stefan Thomas |
Date | 2012-02-20 16:26 |
From | Stefan Thomas |
Subject | Re: [Csnd] instr in udo |
Why do you want an instrument inside an opcode? Well, I'm too lazy to type once more than I think it should be necessary to type the below quoted lines. But I think, I will try to make it easier with an macro. instr isubinstrumentnumber Am 20. Februar 2012 16:44 schrieb Adam Puckett <adotsdothmusic@gmail.com>: Why do you want an instrument inside an opcode? |
Date | 2012-02-20 16:28 |
From | peiman khosravi |
Subject | Re: [Csnd] instr in udo |
But you only need to type it once!! P On 20 February 2012 16:26, Stefan Thomas <kontrapunktstefan@googlemail.com> wrote:
|
Date | 2012-02-20 16:30 |
From | Stefan Thomas |
Subject | Re: [Csnd] instr in udo |
But you only need to type it once!!Yes, true, maybee I'm too puristic. I think I will first write the udo, without macro, and then I will see. Am 20. Februar 2012 17:28 schrieb peiman khosravi <peimankhosravi@gmail.com>: But you only need to type it once!! |