|
Dear community,
is it impossible to integrate an instr endin section in an UDO? I've tried it, but unseccessfully. |
|
Why? Surely there must be a better workaround.
P On 20 February 2012 12:33, Stefan Thomas <[hidden email]> wrote: Dear community, |
|
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 <[hidden email]>: Why? Surely there must be a better workaround. |
|
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 <[hidden email]> wrote: Dear Peiman, |
|
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 <[hidden email]>: I see. But you can have the instr block defined as a separate instrument rather than enclosing it inside your UDO right? |
|
Why do you want an instrument inside an opcode?
On 2/20/12, Stefan Thomas <[hidden email]> wrote: > 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 <[hidden email]> > : > >> 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 <[hidden email] >> > wrote: >> >>> 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 < >>> [hidden email]>: >>> >>> Why? Surely there must be a better workaround. >>>> >>>> P >>>> >>>> >>>> On 20 February 2012 12:33, Stefan Thomas < >>>> [hidden email]> wrote: >>>> >>>>> Dear community, >>>>> is it impossible to integrate an instr endin section in an UDO? >>>>> I've tried it, but unseccessfully. >>>>> >>>> >>>> >>> >> > > Send bugs reports to the Sourceforge bug tracker > https://sourceforge.net/tracker/?group_id=81968&atid=564599 > Discussions of bugs and features can be posted here > To unsubscribe, send email [hidden email] with body "unsubscribe > csound" > > Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email [hidden email] with body "unsubscribe csound" |
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 <[hidden email]>: Why do you want an instrument inside an opcode? |
|
But you only need to type it once!!
P On 20 February 2012 16:26, Stefan Thomas <[hidden email]> wrote:
|
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 <[hidden email]>: But you only need to type it once!! |
| Powered by Nabble | See how NAML generates this page |
