Csound Csound-dev Csound-tekno Search About

[Csnd] concat a value to a string and print it

Date2011-06-22 10:52
Fromstephane 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>


Date2011-06-22 12:00
FromRory Walsh
SubjectRe: [Csnd] concat a value to a string and print it
sprintfk?

On 22 June 2011 10:52, stephane boussuge  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
>
> 
>
> 
>
> 
>
> 
>
> 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
>
> 
>
> 
>
> i1 0 2
>
> e
>
> 
>
> 


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"

Date2011-06-22 12:08
FromIain McCurdy
SubjectRE: [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"
>

Date2011-06-22 13:01
Fromstephane boussuge
SubjectRe: [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>
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"
>