[Csnd] concat a value to a string and print it
Date | 2011-06-22 10:52 |
From | stephane boussuge |
Subject | [Csnd] concat a value to a string and print it |
hi list, i'm trying to print a kvalue concat to a string but i'can't.
here's my code, what wrong ? thank you in advance stf <CsoundSynthesizer> <CsOptions> </CsOptions> <CsInstruments> instr 1 kindx init 1 kstep init 1 loop: if kstep < 32 kgoto readval kgoto stop readval: Sslot sprintf "sq1-%i",kstep ;kstepval invalue Sslot
puts Sslot,1 kstep = kstep + 1 loop_lt kindx, 1, 32, loop stop: turnoff endin </CsInstruments> <CsScore>
i1 0 2 e </CsScore> </CsoundSynthesizer> |
Date | 2011-06-22 12:00 |
From | Rory Walsh |
Subject | Re: [Csnd] concat a value to a string and print it |
sprintfk? On 22 June 2011 10:52, stephane boussuge |
Date | 2011-06-22 12:08 |
From | Iain McCurdy |
Subject | RE: [Csnd] concat a value to a string and print it |
indeed sprintfk. Also the trigger for puts needs to change as well as being non-zero each time you want it to print. Is this what you're after? instr 1 kindx init 1 kstep init 1 loop: Sslot sprintfk "sq-%d", kstep puts Sslot,kindx kstep = kstep + 1 loop_lt kindx, 1, 32, loop turnoff endin > Date: Wed, 22 Jun 2011 12:00:25 +0100 > From: rorywalsh@ear.ie > To: csound@lists.bath.ac.uk > Subject: Re: [Csnd] concat a value to a string and print it > > sprintfk? > > On 22 June 2011 10:52, stephane boussuge <stfboussuge@gmail.com> wrote: > > hi list, > > i'm trying to print a kvalue concat to a string but i'can't. > > here's my code, what wrong ? > > thank you in advance > > stf > > > > <CsoundSynthesizer> > > > > <CsOptions> > > > > </CsOptions> > > > > <CsInstruments> > > > > instr 1 > > > > kindx init 1 > > > > kstep init 1 > > > > loop: > > > > if kstep < 32 kgoto readval > > > > kgoto stop > > > > readval: > > > > Sslot sprintf "sq1-%i",kstep > > > > ;kstepval invalue Sslot > > > > puts Sslot,1 > > > > kstep = kstep + 1 > > > > loop_lt kindx, 1, 32, loop > > > > stop: > > > > turnoff > > > > endin > > > > </CsInstruments> > > > > <CsScore> > > > > i1 0 2 > > > > e > > > > </CsScore> > > > > </CsoundSynthesizer> > > > 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 sympa@lists.bath.ac.uk with body "unsubscribe csound" > |
Date | 2011-06-22 13:01 |
From | stephane boussuge |
Subject | Re: [Csnd] concat a value to a string and print it |
Great !! Thank you very much Rory and Ian. stf 2011/6/22 Iain McCurdy <i_mccurdy@hotmail.com>
|