Re: [Csnd-dev] for-loop over audio vector

vlz <[email protected]>
Newsgroups gmane.comp.audio.csound.devel
Message-ID <[email protected]>
You need an array in for loops, aSin is an asig.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 13 Aug 2025, at 09:20, joachim heintz <[email protected]> wrote:
> 
> i am testing the for-loop in different situations and found this:
> 
> with a while loop i can do
> instr 1
>  aSin = poscil(1,100)
>  kndx = 0
>  while (kndx < ksmps) do
>    printk2(aSin[kndx])
>    kndx += 1
>  od
>  turnoff
> endin
> 
> but with a for-loop ...
> instr 2
>  aSin = poscil(1,100)
>  for kndx in aSin do
>    printk2(aSin[kndx])
>  od
>  turnoff
> endin
> ... i get the error:
> invalid argument in for statement: found 'aSin', which is not an array
> 
> should this not work?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.