Csound Csound-dev Csound-tekno Search About

no looping

Date2016-01-21 10:26
FromMenno Knevel
Subjectno looping
Hi,
i have an image that i want to convert to sound.
 
This image example is 100 pixels x 3 pixels.

I get it to scan from left to right but not from left to right while
scanning the y axis. Somehow my loop is not correct but i don't see how.
Perhaps someone can help here?

loop:                                                                   
	ky = kindex / imageh
	kred, kgreen, kblue imagegetpixel image, kx, ky
;printk 0, ky
;printk 0, kblue 
	printk 0, kindex 
	tablew (kgreen + kblue)*.5 , kindex, giamps 		;write as amps to table
	tablew imageh*1000 , kindex, gifrqs 			;write as freqs to another table
	kres tablei kindex, gifrqs                       
	kindex = kindex + 1
if (kindex < imageh) kgoto loop

and in a greater context:


	instr 1

;===========load image==============================================
image imageload "/home/menno/onderzoek/imageopcodes/px3greenblue.png"                                 
imagew, imageh imagesize image
printf "width and height of image = %d x %d\n", 1, imagew, imageh              
;show width and height of image                                                                    

giamps ftgen 0, 0, -imageh, 10, 1 
gifrqs ftgen 0, 0, imagew, -7, 0, imagew, 2

kindex = 1
kx linseg 0, p3, 1                                      ;X-axis range
                    
loop:                                                                   
	ky = kindex / imageh
	kred, kgreen, kblue imagegetpixel image, kx, ky
;printk 0, ky
;printk 0, kblue 
	printk 0, kindex 
	tablew (kgreen + kblue)*.5 , kindex, giamps 		;write as amps to table
	tablew imageh*1000 , kindex, gifrqs 			;write as freqs to another table
	kres tablei kindex, gifrqs                       
	kindex = kindex + 1
if (kindex < imageh) kgoto loop



--
View this message in context: http://csound.1045644.n5.nabble.com/no-looping-tp5746506.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-21 11:05
FromKevin Welsh
SubjectRe: no looping
Hello Menno,

I had taken a look at your imageplayer instrument a month or two ago
when I was considering "porting" it to cabbage.  I noticed it wasn't
looping on the y axis as well, so I had taken a crack at re-writing
it.  I've been way too busy with life to really put too much effort
into continuing the imageplayer port, I'm hoping I'll get more free
time soon to work on it.

This loop snippet starts both X and Y at 0, reads the data (insert
your own code for this where the comment is in the middle), increments
X, returns to the "loopx" label to read again as long as it hasn't
reached maxX, in which case is continues... increments y, and returns
to loopy label which in turn resets X to 0 to start reading the next
row.  This continues until Y reaches it's max as well.

The code can't be copy/pasted right in as a replacement, but it
hopefully it gives you an idea to get you moving forward.

  iimage imageload Sfile
  imaxX, imaxY imagesize iimage

  kxindex init 0
  kyindex init 0

  loopy:
    kxindex = 0
  loopx:

;    imagegetpixel and the rest of what you want to do in the "meat"
of the loop goes here

    kxindex=kxindex+1
    cggoto (kxindex wrote:
> Hi,
> i have an image that i want to convert to sound.
> 
> This image example is 100 pixels x 3 pixels.
>
> I get it to scan from left to right but not from left to right while
> scanning the y axis. Somehow my loop is not correct but i don't see how.
> Perhaps someone can help here?
>
> loop:
>         ky = kindex / imageh
>         kred, kgreen, kblue imagegetpixel image, kx, ky
> ;printk 0, ky
> ;printk 0, kblue
>         printk 0, kindex
>         tablew (kgreen + kblue)*.5 , kindex, giamps             ;write as amps to table
>         tablew imageh*1000 , kindex, gifrqs                     ;write as freqs to another table
>         kres tablei kindex, gifrqs
>         kindex = kindex + 1
> if (kindex < imageh) kgoto loop
>
> and in a greater context:
>
>
>         instr 1
>
> ;===========load image==============================================
> image imageload "/home/menno/onderzoek/imageopcodes/px3greenblue.png"
> imagew, imageh imagesize image
> printf "width and height of image = %d x %d\n", 1, imagew, imageh
> ;show width and height of image
>
> giamps ftgen 0, 0, -imageh, 10, 1
> gifrqs ftgen 0, 0, imagew, -7, 0, imagew, 2
>
> kindex = 1
> kx linseg 0, p3, 1                                      ;X-axis range
>
> loop:
>         ky = kindex / imageh
>         kred, kgreen, kblue imagegetpixel image, kx, ky
> ;printk 0, ky
> ;printk 0, kblue
>         printk 0, kindex
>         tablew (kgreen + kblue)*.5 , kindex, giamps             ;write as amps to table
>         tablew imageh*1000 , kindex, gifrqs                     ;write as freqs to another table
>         kres tablei kindex, gifrqs
>         kindex = kindex + 1
> if (kindex < imageh) kgoto loop
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/no-looping-tp5746506.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-21 15:44
FromSteven Yi
SubjectRe: no looping
I haven't looked at the code in depth, but in general for this kind of
2-dimensional data, I think it'd be more common to use nested loops,
i.e.:

kx = 0

until (kx >= imaxX) do
  ky = 0
  until (ky >= imaxY) do
  ... do code ...
  od
od

That should read as "for each x location, read each y location and "do
code". I would also suggest using the until-looping structure over
goto's of any sort.


On Thu, Jan 21, 2016 at 6:05 AM, Kevin Welsh  wrote:
> Hello Menno,
>
> I had taken a look at your imageplayer instrument a month or two ago
> when I was considering "porting" it to cabbage.  I noticed it wasn't
> looping on the y axis as well, so I had taken a crack at re-writing
> it.  I've been way too busy with life to really put too much effort
> into continuing the imageplayer port, I'm hoping I'll get more free
> time soon to work on it.
>
> This loop snippet starts both X and Y at 0, reads the data (insert
> your own code for this where the comment is in the middle), increments
> X, returns to the "loopx" label to read again as long as it hasn't
> reached maxX, in which case is continues... increments y, and returns
> to loopy label which in turn resets X to 0 to start reading the next
> row.  This continues until Y reaches it's max as well.
>
> The code can't be copy/pasted right in as a replacement, but it
> hopefully it gives you an idea to get you moving forward.
>
>   iimage imageload Sfile
>   imaxX, imaxY imagesize iimage
>
>   kxindex init 0
>   kyindex init 0
>
>   loopy:
>     kxindex = 0
>   loopx:
>
> ;    imagegetpixel and the rest of what you want to do in the "meat"
> of the loop goes here
>
>     kxindex=kxindex+1
>     cggoto (kxindex     kyindex=kyindex+1
>     cggoto (kyindex
> On Thu, Jan 21, 2016 at 5:26 AM, Menno Knevel  wrote:
>> Hi,
>> i have an image that i want to convert to sound.
>> 
>> This image example is 100 pixels x 3 pixels.
>>
>> I get it to scan from left to right but not from left to right while
>> scanning the y axis. Somehow my loop is not correct but i don't see how.
>> Perhaps someone can help here?
>>
>> loop:
>>         ky = kindex / imageh
>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>> ;printk 0, ky
>> ;printk 0, kblue
>>         printk 0, kindex
>>         tablew (kgreen + kblue)*.5 , kindex, giamps             ;write as amps to table
>>         tablew imageh*1000 , kindex, gifrqs                     ;write as freqs to another table
>>         kres tablei kindex, gifrqs
>>         kindex = kindex + 1
>> if (kindex < imageh) kgoto loop
>>
>> and in a greater context:
>>
>>
>>         instr 1
>>
>> ;===========load image==============================================
>> image imageload "/home/menno/onderzoek/imageopcodes/px3greenblue.png"
>> imagew, imageh imagesize image
>> printf "width and height of image = %d x %d\n", 1, imagew, imageh
>> ;show width and height of image
>>
>> giamps ftgen 0, 0, -imageh, 10, 1
>> gifrqs ftgen 0, 0, imagew, -7, 0, imagew, 2
>>
>> kindex = 1
>> kx linseg 0, p3, 1                                      ;X-axis range
>>
>> loop:
>>         ky = kindex / imageh
>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>> ;printk 0, ky
>> ;printk 0, kblue
>>         printk 0, kindex
>>         tablew (kgreen + kblue)*.5 , kindex, giamps             ;write as amps to table
>>         tablew imageh*1000 , kindex, gifrqs                     ;write as freqs to another table
>>         kres tablei kindex, gifrqs
>>         kindex = kindex + 1
>> if (kindex < imageh) kgoto loop
>>
>>
>>
>> --
>> View this message in context: http://csound.1045644.n5.nabble.com/no-looping-tp5746506.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-21 18:20
FromSteven Yi
SubjectRe: no looping
Sorry, I realized I should have added increments, so the basic form should be:

kx = 0

until (kx >= imaxX) do
  ky = 0
  until (ky >= imaxY) do
    ... do code ...
    ky += 1
  od
  kx += 1
od

On Thu, Jan 21, 2016 at 10:44 AM, Steven Yi  wrote:
> I haven't looked at the code in depth, but in general for this kind of
> 2-dimensional data, I think it'd be more common to use nested loops,
> i.e.:
>
> kx = 0
>
> until (kx >= imaxX) do
>   ky = 0
>   until (ky >= imaxY) do
>   ... do code ...
>   od
> od
>
> That should read as "for each x location, read each y location and "do
> code". I would also suggest using the until-looping structure over
> goto's of any sort.
>
>
> On Thu, Jan 21, 2016 at 6:05 AM, Kevin Welsh  wrote:
>> Hello Menno,
>>
>> I had taken a look at your imageplayer instrument a month or two ago
>> when I was considering "porting" it to cabbage.  I noticed it wasn't
>> looping on the y axis as well, so I had taken a crack at re-writing
>> it.  I've been way too busy with life to really put too much effort
>> into continuing the imageplayer port, I'm hoping I'll get more free
>> time soon to work on it.
>>
>> This loop snippet starts both X and Y at 0, reads the data (insert
>> your own code for this where the comment is in the middle), increments
>> X, returns to the "loopx" label to read again as long as it hasn't
>> reached maxX, in which case is continues... increments y, and returns
>> to loopy label which in turn resets X to 0 to start reading the next
>> row.  This continues until Y reaches it's max as well.
>>
>> The code can't be copy/pasted right in as a replacement, but it
>> hopefully it gives you an idea to get you moving forward.
>>
>>   iimage imageload Sfile
>>   imaxX, imaxY imagesize iimage
>>
>>   kxindex init 0
>>   kyindex init 0
>>
>>   loopy:
>>     kxindex = 0
>>   loopx:
>>
>> ;    imagegetpixel and the rest of what you want to do in the "meat"
>> of the loop goes here
>>
>>     kxindex=kxindex+1
>>     cggoto (kxindex>     kyindex=kyindex+1
>>     cggoto (kyindex>
>> On Thu, Jan 21, 2016 at 5:26 AM, Menno Knevel  wrote:
>>> Hi,
>>> i have an image that i want to convert to sound.
>>> 
>>> This image example is 100 pixels x 3 pixels.
>>>
>>> I get it to scan from left to right but not from left to right while
>>> scanning the y axis. Somehow my loop is not correct but i don't see how.
>>> Perhaps someone can help here?
>>>
>>> loop:
>>>         ky = kindex / imageh
>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>>> ;printk 0, ky
>>> ;printk 0, kblue
>>>         printk 0, kindex
>>>         tablew (kgreen + kblue)*.5 , kindex, giamps             ;write as amps to table
>>>         tablew imageh*1000 , kindex, gifrqs                     ;write as freqs to another table
>>>         kres tablei kindex, gifrqs
>>>         kindex = kindex + 1
>>> if (kindex < imageh) kgoto loop
>>>
>>> and in a greater context:
>>>
>>>
>>>         instr 1
>>>
>>> ;===========load image==============================================
>>> image imageload "/home/menno/onderzoek/imageopcodes/px3greenblue.png"
>>> imagew, imageh imagesize image
>>> printf "width and height of image = %d x %d\n", 1, imagew, imageh
>>> ;show width and height of image
>>>
>>> giamps ftgen 0, 0, -imageh, 10, 1
>>> gifrqs ftgen 0, 0, imagew, -7, 0, imagew, 2
>>>
>>> kindex = 1
>>> kx linseg 0, p3, 1                                      ;X-axis range
>>>
>>> loop:
>>>         ky = kindex / imageh
>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>>> ;printk 0, ky
>>> ;printk 0, kblue
>>>         printk 0, kindex
>>>         tablew (kgreen + kblue)*.5 , kindex, giamps             ;write as amps to table
>>>         tablew imageh*1000 , kindex, gifrqs                     ;write as freqs to another table
>>>         kres tablei kindex, gifrqs
>>>         kindex = kindex + 1
>>> if (kindex < imageh) kgoto loop
>>>
>>>
>>>
>>> --
>>> View this message in context: http://csound.1045644.n5.nabble.com/no-looping-tp5746506.html
>>> Sent from the Csound - General mailing list archive at Nabble.com.
>>>
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-21 19:33
FromKevin Welsh
SubjectRe: no looping
Steven, is there a performance reason until is preferred over if/goto
or cggoto?  I haven't tested it, but I believe in Menno's case (from
having looked at the imageplayer before) he needs k-rate loops
operating more than one pass per control rate.  Does using until
achieve this too?

Sorry if they're stupid questions... as evidenced by my last thread
about loops and my replies to Rory's thread about loops, it's probably
obvious looping in k-rate is fairly new to me.

On Thu, Jan 21, 2016 at 1:20 PM, Steven Yi  wrote:
> Sorry, I realized I should have added increments, so the basic form should be:
>
> kx = 0
>
> until (kx >= imaxX) do
>   ky = 0
>   until (ky >= imaxY) do
>     ... do code ...
>     ky += 1
>   od
>   kx += 1
> od
>
> On Thu, Jan 21, 2016 at 10:44 AM, Steven Yi  wrote:
>> I haven't looked at the code in depth, but in general for this kind of
>> 2-dimensional data, I think it'd be more common to use nested loops,
>> i.e.:
>>
>> kx = 0
>>
>> until (kx >= imaxX) do
>>   ky = 0
>>   until (ky >= imaxY) do
>>   ... do code ...
>>   od
>> od
>>
>> That should read as "for each x location, read each y location and "do
>> code". I would also suggest using the until-looping structure over
>> goto's of any sort.
>>
>>
>> On Thu, Jan 21, 2016 at 6:05 AM, Kevin Welsh  wrote:
>>> Hello Menno,
>>>
>>> I had taken a look at your imageplayer instrument a month or two ago
>>> when I was considering "porting" it to cabbage.  I noticed it wasn't
>>> looping on the y axis as well, so I had taken a crack at re-writing
>>> it.  I've been way too busy with life to really put too much effort
>>> into continuing the imageplayer port, I'm hoping I'll get more free
>>> time soon to work on it.
>>>
>>> This loop snippet starts both X and Y at 0, reads the data (insert
>>> your own code for this where the comment is in the middle), increments
>>> X, returns to the "loopx" label to read again as long as it hasn't
>>> reached maxX, in which case is continues... increments y, and returns
>>> to loopy label which in turn resets X to 0 to start reading the next
>>> row.  This continues until Y reaches it's max as well.
>>>
>>> The code can't be copy/pasted right in as a replacement, but it
>>> hopefully it gives you an idea to get you moving forward.
>>>
>>>   iimage imageload Sfile
>>>   imaxX, imaxY imagesize iimage
>>>
>>>   kxindex init 0
>>>   kyindex init 0
>>>
>>>   loopy:
>>>     kxindex = 0
>>>   loopx:
>>>
>>> ;    imagegetpixel and the rest of what you want to do in the "meat"
>>> of the loop goes here
>>>
>>>     kxindex=kxindex+1
>>>     cggoto (kxindex>>     kyindex=kyindex+1
>>>     cggoto (kyindex>>
>>> On Thu, Jan 21, 2016 at 5:26 AM, Menno Knevel  wrote:
>>>> Hi,
>>>> i have an image that i want to convert to sound.
>>>> 
>>>> This image example is 100 pixels x 3 pixels.
>>>>
>>>> I get it to scan from left to right but not from left to right while
>>>> scanning the y axis. Somehow my loop is not correct but i don't see how.
>>>> Perhaps someone can help here?
>>>>
>>>> loop:
>>>>         ky = kindex / imageh
>>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>>>> ;printk 0, ky
>>>> ;printk 0, kblue
>>>>         printk 0, kindex
>>>>         tablew (kgreen + kblue)*.5 , kindex, giamps             ;write as amps to table
>>>>         tablew imageh*1000 , kindex, gifrqs                     ;write as freqs to another table
>>>>         kres tablei kindex, gifrqs
>>>>         kindex = kindex + 1
>>>> if (kindex < imageh) kgoto loop
>>>>
>>>> and in a greater context:
>>>>
>>>>
>>>>         instr 1
>>>>
>>>> ;===========load image==============================================
>>>> image imageload "/home/menno/onderzoek/imageopcodes/px3greenblue.png"
>>>> imagew, imageh imagesize image
>>>> printf "width and height of image = %d x %d\n", 1, imagew, imageh
>>>> ;show width and height of image
>>>>
>>>> giamps ftgen 0, 0, -imageh, 10, 1
>>>> gifrqs ftgen 0, 0, imagew, -7, 0, imagew, 2
>>>>
>>>> kindex = 1
>>>> kx linseg 0, p3, 1                                      ;X-axis range
>>>>
>>>> loop:
>>>>         ky = kindex / imageh
>>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>>>> ;printk 0, ky
>>>> ;printk 0, kblue
>>>>         printk 0, kindex
>>>>         tablew (kgreen + kblue)*.5 , kindex, giamps             ;write as amps to table
>>>>         tablew imageh*1000 , kindex, gifrqs                     ;write as freqs to another table
>>>>         kres tablei kindex, gifrqs
>>>>         kindex = kindex + 1
>>>> if (kindex < imageh) kgoto loop
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context: http://csound.1045644.n5.nabble.com/no-looping-tp5746506.html
>>>> Sent from the Csound - General mailing list archive at Nabble.com.
>>>>
>>>> Csound mailing list
>>>> Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>         https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-21 21:04
FromSteven Yi
SubjectRe: no looping
Hi Kevin,

Using until-loops will compile down to gotos and labels and the loops
will process each value per k-rate loop and is as efficient as using
gotos and labels directly. Usage of until-loops is for clarity and
falls under the category of "control structures" within "structured
programming" (see [1] for background info). Dijkstra's [2] argument
against gotos and Knuth's [3] discussion of it and structured
programming are worthwhile reads, IMO, to get an idea of what happened
from the early days of programming as programming language design
evolved.  I think all of the same arguments against gotos/labels still
apply to Csound programming today.

For my own Csound programming, since the introduction of if-then in CS
4.23 and until- and while-loops in CS5/6, I have not had a need for
labels and gotos anymore. I'd generally encourage others to stop using
gotos/labels as well.

steven

[1] - https://en.wikipedia.org/wiki/Structured_programming
[2] - http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html
[3] - http://www.cs.sjsu.edu/~mak/CS185C/KnuthStructuredProgrammingGoTo.pdf

On Thu, Jan 21, 2016 at 2:33 PM, Kevin Welsh  wrote:
> Steven, is there a performance reason until is preferred over if/goto
> or cggoto?  I haven't tested it, but I believe in Menno's case (from
> having looked at the imageplayer before) he needs k-rate loops
> operating more than one pass per control rate.  Does using until
> achieve this too?
>
> Sorry if they're stupid questions... as evidenced by my last thread
> about loops and my replies to Rory's thread about loops, it's probably
> obvious looping in k-rate is fairly new to me.
>
> On Thu, Jan 21, 2016 at 1:20 PM, Steven Yi  wrote:
>> Sorry, I realized I should have added increments, so the basic form should be:
>>
>> kx = 0
>>
>> until (kx >= imaxX) do
>>   ky = 0
>>   until (ky >= imaxY) do
>>     ... do code ...
>>     ky += 1
>>   od
>>   kx += 1
>> od
>>
>> On Thu, Jan 21, 2016 at 10:44 AM, Steven Yi  wrote:
>>> I haven't looked at the code in depth, but in general for this kind of
>>> 2-dimensional data, I think it'd be more common to use nested loops,
>>> i.e.:
>>>
>>> kx = 0
>>>
>>> until (kx >= imaxX) do
>>>   ky = 0
>>>   until (ky >= imaxY) do
>>>   ... do code ...
>>>   od
>>> od
>>>
>>> That should read as "for each x location, read each y location and "do
>>> code". I would also suggest using the until-looping structure over
>>> goto's of any sort.
>>>
>>>
>>> On Thu, Jan 21, 2016 at 6:05 AM, Kevin Welsh  wrote:
>>>> Hello Menno,
>>>>
>>>> I had taken a look at your imageplayer instrument a month or two ago
>>>> when I was considering "porting" it to cabbage.  I noticed it wasn't
>>>> looping on the y axis as well, so I had taken a crack at re-writing
>>>> it.  I've been way too busy with life to really put too much effort
>>>> into continuing the imageplayer port, I'm hoping I'll get more free
>>>> time soon to work on it.
>>>>
>>>> This loop snippet starts both X and Y at 0, reads the data (insert
>>>> your own code for this where the comment is in the middle), increments
>>>> X, returns to the "loopx" label to read again as long as it hasn't
>>>> reached maxX, in which case is continues... increments y, and returns
>>>> to loopy label which in turn resets X to 0 to start reading the next
>>>> row.  This continues until Y reaches it's max as well.
>>>>
>>>> The code can't be copy/pasted right in as a replacement, but it
>>>> hopefully it gives you an idea to get you moving forward.
>>>>
>>>>   iimage imageload Sfile
>>>>   imaxX, imaxY imagesize iimage
>>>>
>>>>   kxindex init 0
>>>>   kyindex init 0
>>>>
>>>>   loopy:
>>>>     kxindex = 0
>>>>   loopx:
>>>>
>>>> ;    imagegetpixel and the rest of what you want to do in the "meat"
>>>> of the loop goes here
>>>>
>>>>     kxindex=kxindex+1
>>>>     cggoto (kxindex>>>     kyindex=kyindex+1
>>>>     cggoto (kyindex>>>
>>>> On Thu, Jan 21, 2016 at 5:26 AM, Menno Knevel  wrote:
>>>>> Hi,
>>>>> i have an image that i want to convert to sound.
>>>>> 
>>>>> This image example is 100 pixels x 3 pixels.
>>>>>
>>>>> I get it to scan from left to right but not from left to right while
>>>>> scanning the y axis. Somehow my loop is not correct but i don't see how.
>>>>> Perhaps someone can help here?
>>>>>
>>>>> loop:
>>>>>         ky = kindex / imageh
>>>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>>>>> ;printk 0, ky
>>>>> ;printk 0, kblue
>>>>>         printk 0, kindex
>>>>>         tablew (kgreen + kblue)*.5 , kindex, giamps             ;write as amps to table
>>>>>         tablew imageh*1000 , kindex, gifrqs                     ;write as freqs to another table
>>>>>         kres tablei kindex, gifrqs
>>>>>         kindex = kindex + 1
>>>>> if (kindex < imageh) kgoto loop
>>>>>
>>>>> and in a greater context:
>>>>>
>>>>>
>>>>>         instr 1
>>>>>
>>>>> ;===========load image==============================================
>>>>> image imageload "/home/menno/onderzoek/imageopcodes/px3greenblue.png"
>>>>> imagew, imageh imagesize image
>>>>> printf "width and height of image = %d x %d\n", 1, imagew, imageh
>>>>> ;show width and height of image
>>>>>
>>>>> giamps ftgen 0, 0, -imageh, 10, 1
>>>>> gifrqs ftgen 0, 0, imagew, -7, 0, imagew, 2
>>>>>
>>>>> kindex = 1
>>>>> kx linseg 0, p3, 1                                      ;X-axis range
>>>>>
>>>>> loop:
>>>>>         ky = kindex / imageh
>>>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>>>>> ;printk 0, ky
>>>>> ;printk 0, kblue
>>>>>         printk 0, kindex
>>>>>         tablew (kgreen + kblue)*.5 , kindex, giamps             ;write as amps to table
>>>>>         tablew imageh*1000 , kindex, gifrqs                     ;write as freqs to another table
>>>>>         kres tablei kindex, gifrqs
>>>>>         kindex = kindex + 1
>>>>> if (kindex < imageh) kgoto loop
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context: http://csound.1045644.n5.nabble.com/no-looping-tp5746506.html
>>>>> Sent from the Csound - General mailing list archive at Nabble.com.
>>>>>
>>>>> Csound mailing list
>>>>> Csound@listserv.heanet.ie
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>> Send bugs reports to
>>>>>         https://github.com/csound/csound/issues
>>>>> Discussions of bugs and features can be posted here
>>>>
>>>> Csound mailing list
>>>> Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>         https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-22 03:15
Fromthorin kerr
SubjectRe: no looping
Yes.... but.... Csound is peculiar.  
For example, I use ckgoto a lot to do stuff on a single control pass, which I think is more useful than stuffing it all into a conditional block.

konce init 0
ckgoto (konce == 1), terminate

... krate stuff, usually on arrays or k-rate opcodes like event

konce = 1

terminate:





On Fri, Jan 22, 2016 at 7:04 AM, Steven Yi <stevenyi@gmail.com> wrote:
Hi Kevin,

Using until-loops will compile down to gotos and labels and the loops
will process each value per k-rate loop and is as efficient as using
gotos and labels directly. Usage of until-loops is for clarity and
falls under the category of "control structures" within "structured
programming" (see [1] for background info). Dijkstra's [2] argument
against gotos and Knuth's [3] discussion of it and structured
programming are worthwhile reads, IMO, to get an idea of what happened
from the early days of programming as programming language design
evolved.  I think all of the same arguments against gotos/labels still
apply to Csound programming today.

For my own Csound programming, since the introduction of if-then in CS
4.23 and until- and while-loops in CS5/6, I have not had a need for
labels and gotos anymore. I'd generally encourage others to stop using
gotos/labels as well.

steven

[1] - https://en.wikipedia.org/wiki/Structured_programming
[2] - http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html
[3] - http://www.cs.sjsu.edu/~mak/CS185C/KnuthStructuredProgrammingGoTo.pdf

On Thu, Jan 21, 2016 at 2:33 PM, Kevin Welsh <tgrey1@gmail.com> wrote:
> Steven, is there a performance reason until is preferred over if/goto
> or cggoto?  I haven't tested it, but I believe in Menno's case (from
> having looked at the imageplayer before) he needs k-rate loops
> operating more than one pass per control rate.  Does using until
> achieve this too?
>
> Sorry if they're stupid questions... as evidenced by my last thread
> about loops and my replies to Rory's thread about loops, it's probably
> obvious looping in k-rate is fairly new to me.
>
> On Thu, Jan 21, 2016 at 1:20 PM, Steven Yi <stevenyi@gmail.com> wrote:
>> Sorry, I realized I should have added increments, so the basic form should be:
>>
>> kx = 0
>>
>> until (kx >= imaxX) do
>>   ky = 0
>>   until (ky >= imaxY) do
>>     ... do code ...
>>     ky += 1
>>   od
>>   kx += 1
>> od
>>
>> On Thu, Jan 21, 2016 at 10:44 AM, Steven Yi <stevenyi@gmail.com> wrote:
>>> I haven't looked at the code in depth, but in general for this kind of
>>> 2-dimensional data, I think it'd be more common to use nested loops,
>>> i.e.:
>>>
>>> kx = 0
>>>
>>> until (kx >= imaxX) do
>>>   ky = 0
>>>   until (ky >= imaxY) do
>>>   ... do code ...
>>>   od
>>> od
>>>
>>> That should read as "for each x location, read each y location and "do
>>> code". I would also suggest using the until-looping structure over
>>> goto's of any sort.
>>>
>>>
>>> On Thu, Jan 21, 2016 at 6:05 AM, Kevin Welsh <tgrey1@gmail.com> wrote:
>>>> Hello Menno,
>>>>
>>>> I had taken a look at your imageplayer instrument a month or two ago
>>>> when I was considering "porting" it to cabbage.  I noticed it wasn't
>>>> looping on the y axis as well, so I had taken a crack at re-writing
>>>> it.  I've been way too busy with life to really put too much effort
>>>> into continuing the imageplayer port, I'm hoping I'll get more free
>>>> time soon to work on it.
>>>>
>>>> This loop snippet starts both X and Y at 0, reads the data (insert
>>>> your own code for this where the comment is in the middle), increments
>>>> X, returns to the "loopx" label to read again as long as it hasn't
>>>> reached maxX, in which case is continues... increments y, and returns
>>>> to loopy label which in turn resets X to 0 to start reading the next
>>>> row.  This continues until Y reaches it's max as well.
>>>>
>>>> The code can't be copy/pasted right in as a replacement, but it
>>>> hopefully it gives you an idea to get you moving forward.
>>>>
>>>>   iimage imageload Sfile
>>>>   imaxX, imaxY imagesize iimage
>>>>
>>>>   kxindex init 0
>>>>   kyindex init 0
>>>>
>>>>   loopy:
>>>>     kxindex = 0
>>>>   loopx:
>>>>
>>>> ;    imagegetpixel and the rest of what you want to do in the "meat"
>>>> of the loop goes here
>>>>
>>>>     kxindex=kxindex+1
>>>>     cggoto (kxindex<imaxX), loopx
>>>>     kyindex=kyindex+1
>>>>     cggoto (kyindex<imaxY), loopy
>>>>
>>>> On Thu, Jan 21, 2016 at 5:26 AM, Menno Knevel <magknevel@gmail.com> wrote:
>>>>> Hi,
>>>>> i have an image that i want to convert to sound.
>>>>> <http://csound.1045644.n5.nabble.com/file/n5746506/30.png>
>>>>> This image example is 100 pixels x 3 pixels.
>>>>>
>>>>> I get it to scan from left to right but not from left to right while
>>>>> scanning the y axis. Somehow my loop is not correct but i don't see how.
>>>>> Perhaps someone can help here?
>>>>>
>>>>> loop:
>>>>>         ky = kindex / imageh
>>>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>>>>> ;printk 0, ky
>>>>> ;printk 0, kblue
>>>>>         printk 0, kindex
>>>>>         tablew (kgreen + kblue)*.5 , kindex, giamps             ;write as amps to table
>>>>>         tablew imageh*1000 , kindex, gifrqs                     ;write as freqs to another table
>>>>>         kres tablei kindex, gifrqs
>>>>>         kindex = kindex + 1
>>>>> if (kindex < imageh) kgoto loop
>>>>>
>>>>> and in a greater context:
>>>>>
>>>>>
>>>>>         instr 1
>>>>>
>>>>> ;===========load image==============================================
>>>>> image imageload "/home/menno/onderzoek/imageopcodes/px3greenblue.png"
>>>>> imagew, imageh imagesize image
>>>>> printf "width and height of image = %d x %d\n", 1, imagew, imageh
>>>>> ;show width and height of image
>>>>>
>>>>> giamps ftgen 0, 0, -imageh, 10, 1
>>>>> gifrqs ftgen 0, 0, imagew, -7, 0, imagew, 2
>>>>>
>>>>> kindex = 1
>>>>> kx linseg 0, p3, 1                                      ;X-axis range
>>>>>
>>>>> loop:
>>>>>         ky = kindex / imageh
>>>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>>>>> ;printk 0, ky
>>>>> ;printk 0, kblue
>>>>>         printk 0, kindex
>>>>>         tablew (kgreen + kblue)*.5 , kindex, giamps             ;write as amps to table
>>>>>         tablew imageh*1000 , kindex, gifrqs                     ;write as freqs to another table
>>>>>         kres tablei kindex, gifrqs
>>>>>         kindex = kindex + 1
>>>>> if (kindex < imageh) kgoto loop
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context: http://csound.1045644.n5.nabble.com/no-looping-tp5746506.html
>>>>> Sent from the Csound - General mailing list archive at Nabble.com.
>>>>>
>>>>> Csound mailing list
>>>>> Csound@listserv.heanet.ie
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>> Send bugs reports to
>>>>>         https://github.com/csound/csound/issues
>>>>> Discussions of bugs and features can be posted here
>>>>
>>>> Csound mailing list
>>>> Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>         https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-22 04:07
FromSteven Yi
SubjectRe: no looping
I don't really think of Csound as being all that peculiar. ;)

For my own code, I tend to use init-time code (e.g., use event_i
instead of event) and turnoff rather than do a single k-rate pass.
Even then, you could use turnoff at perf-time for an early exit with a
conditional block:

kcount init 0
if (kcount == 1) then
  turnoff  ;; early exit, done on 2nd k-pass
endif

... krate stuff ...
kcount += 1

For example, this instrument:

instr 1
kcount init 0

printk2 kcount

if (kcount == 1) then
  turnoff
endif
kcount += 1
printk2 kcount, 2

endin

produces:

 i1     0.00000
 i1       1.00000
 i1     1.00000

before it exits. I personally think the if-statement is a bit clearer
on the intention of the code than the ckgoto version.  It's a little
more verbose but removes the use of a label to look for and keep track
of, which is worth the trade off for my tastes.



On Thu, Jan 21, 2016 at 10:15 PM, thorin kerr  wrote:
> Yes.... but.... Csound is peculiar.
> For example, I use ckgoto a lot to do stuff on a single control pass, which
> I think is more useful than stuffing it all into a conditional block.
>
> konce init 0
> ckgoto (konce == 1), terminate
>
> ... krate stuff, usually on arrays or k-rate opcodes like event
>
> konce = 1
>
> terminate:
>
>
>
>
>
> On Fri, Jan 22, 2016 at 7:04 AM, Steven Yi  wrote:
>>
>> Hi Kevin,
>>
>> Using until-loops will compile down to gotos and labels and the loops
>> will process each value per k-rate loop and is as efficient as using
>> gotos and labels directly. Usage of until-loops is for clarity and
>> falls under the category of "control structures" within "structured
>> programming" (see [1] for background info). Dijkstra's [2] argument
>> against gotos and Knuth's [3] discussion of it and structured
>> programming are worthwhile reads, IMO, to get an idea of what happened
>> from the early days of programming as programming language design
>> evolved.  I think all of the same arguments against gotos/labels still
>> apply to Csound programming today.
>>
>> For my own Csound programming, since the introduction of if-then in CS
>> 4.23 and until- and while-loops in CS5/6, I have not had a need for
>> labels and gotos anymore. I'd generally encourage others to stop using
>> gotos/labels as well.
>>
>> steven
>>
>> [1] - https://en.wikipedia.org/wiki/Structured_programming
>> [2] -
>> http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html
>> [3] -
>> http://www.cs.sjsu.edu/~mak/CS185C/KnuthStructuredProgrammingGoTo.pdf
>>
>> On Thu, Jan 21, 2016 at 2:33 PM, Kevin Welsh  wrote:
>> > Steven, is there a performance reason until is preferred over if/goto
>> > or cggoto?  I haven't tested it, but I believe in Menno's case (from
>> > having looked at the imageplayer before) he needs k-rate loops
>> > operating more than one pass per control rate.  Does using until
>> > achieve this too?
>> >
>> > Sorry if they're stupid questions... as evidenced by my last thread
>> > about loops and my replies to Rory's thread about loops, it's probably
>> > obvious looping in k-rate is fairly new to me.
>> >
>> > On Thu, Jan 21, 2016 at 1:20 PM, Steven Yi  wrote:
>> >> Sorry, I realized I should have added increments, so the basic form
>> >> should be:
>> >>
>> >> kx = 0
>> >>
>> >> until (kx >= imaxX) do
>> >>   ky = 0
>> >>   until (ky >= imaxY) do
>> >>     ... do code ...
>> >>     ky += 1
>> >>   od
>> >>   kx += 1
>> >> od
>> >>
>> >> On Thu, Jan 21, 2016 at 10:44 AM, Steven Yi  wrote:
>> >>> I haven't looked at the code in depth, but in general for this kind of
>> >>> 2-dimensional data, I think it'd be more common to use nested loops,
>> >>> i.e.:
>> >>>
>> >>> kx = 0
>> >>>
>> >>> until (kx >= imaxX) do
>> >>>   ky = 0
>> >>>   until (ky >= imaxY) do
>> >>>   ... do code ...
>> >>>   od
>> >>> od
>> >>>
>> >>> That should read as "for each x location, read each y location and "do
>> >>> code". I would also suggest using the until-looping structure over
>> >>> goto's of any sort.
>> >>>
>> >>>
>> >>> On Thu, Jan 21, 2016 at 6:05 AM, Kevin Welsh  wrote:
>> >>>> Hello Menno,
>> >>>>
>> >>>> I had taken a look at your imageplayer instrument a month or two ago
>> >>>> when I was considering "porting" it to cabbage.  I noticed it wasn't
>> >>>> looping on the y axis as well, so I had taken a crack at re-writing
>> >>>> it.  I've been way too busy with life to really put too much effort
>> >>>> into continuing the imageplayer port, I'm hoping I'll get more free
>> >>>> time soon to work on it.
>> >>>>
>> >>>> This loop snippet starts both X and Y at 0, reads the data (insert
>> >>>> your own code for this where the comment is in the middle),
>> >>>> increments
>> >>>> X, returns to the "loopx" label to read again as long as it hasn't
>> >>>> reached maxX, in which case is continues... increments y, and returns
>> >>>> to loopy label which in turn resets X to 0 to start reading the next
>> >>>> row.  This continues until Y reaches it's max as well.
>> >>>>
>> >>>> The code can't be copy/pasted right in as a replacement, but it
>> >>>> hopefully it gives you an idea to get you moving forward.
>> >>>>
>> >>>>   iimage imageload Sfile
>> >>>>   imaxX, imaxY imagesize iimage
>> >>>>
>> >>>>   kxindex init 0
>> >>>>   kyindex init 0
>> >>>>
>> >>>>   loopy:
>> >>>>     kxindex = 0
>> >>>>   loopx:
>> >>>>
>> >>>> ;    imagegetpixel and the rest of what you want to do in the "meat"
>> >>>> of the loop goes here
>> >>>>
>> >>>>     kxindex=kxindex+1
>> >>>>     cggoto (kxindex> >>>>     kyindex=kyindex+1
>> >>>>     cggoto (kyindex> >>>>
>> >>>> On Thu, Jan 21, 2016 at 5:26 AM, Menno Knevel 
>> >>>> wrote:
>> >>>>> Hi,
>> >>>>> i have an image that i want to convert to sound.
>> >>>>> 
>> >>>>> This image example is 100 pixels x 3 pixels.
>> >>>>>
>> >>>>> I get it to scan from left to right but not from left to right while
>> >>>>> scanning the y axis. Somehow my loop is not correct but i don't see
>> >>>>> how.
>> >>>>> Perhaps someone can help here?
>> >>>>>
>> >>>>> loop:
>> >>>>>         ky = kindex / imageh
>> >>>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>> >>>>> ;printk 0, ky
>> >>>>> ;printk 0, kblue
>> >>>>>         printk 0, kindex
>> >>>>>         tablew (kgreen + kblue)*.5 , kindex, giamps
>> >>>>> ;write as amps to table
>> >>>>>         tablew imageh*1000 , kindex, gifrqs
>> >>>>> ;write as freqs to another table
>> >>>>>         kres tablei kindex, gifrqs
>> >>>>>         kindex = kindex + 1
>> >>>>> if (kindex < imageh) kgoto loop
>> >>>>>
>> >>>>> and in a greater context:
>> >>>>>
>> >>>>>
>> >>>>>         instr 1
>> >>>>>
>> >>>>> ;===========load image==============================================
>> >>>>> image imageload
>> >>>>> "/home/menno/onderzoek/imageopcodes/px3greenblue.png"
>> >>>>> imagew, imageh imagesize image
>> >>>>> printf "width and height of image = %d x %d\n", 1, imagew, imageh
>> >>>>> ;show width and height of image
>> >>>>>
>> >>>>> giamps ftgen 0, 0, -imageh, 10, 1
>> >>>>> gifrqs ftgen 0, 0, imagew, -7, 0, imagew, 2
>> >>>>>
>> >>>>> kindex = 1
>> >>>>> kx linseg 0, p3, 1                                      ;X-axis
>> >>>>> range
>> >>>>>
>> >>>>> loop:
>> >>>>>         ky = kindex / imageh
>> >>>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>> >>>>> ;printk 0, ky
>> >>>>> ;printk 0, kblue
>> >>>>>         printk 0, kindex
>> >>>>>         tablew (kgreen + kblue)*.5 , kindex, giamps
>> >>>>> ;write as amps to table
>> >>>>>         tablew imageh*1000 , kindex, gifrqs
>> >>>>> ;write as freqs to another table
>> >>>>>         kres tablei kindex, gifrqs
>> >>>>>         kindex = kindex + 1
>> >>>>> if (kindex < imageh) kgoto loop
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> --
>> >>>>> View this message in context:
>> >>>>> http://csound.1045644.n5.nabble.com/no-looping-tp5746506.html
>> >>>>> Sent from the Csound - General mailing list archive at Nabble.com.
>> >>>>>
>> >>>>> Csound mailing list
>> >>>>> Csound@listserv.heanet.ie
>> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>>>> Send bugs reports to
>> >>>>>         https://github.com/csound/csound/issues
>> >>>>> Discussions of bugs and features can be posted here
>> >>>>
>> >>>> Csound mailing list
>> >>>> Csound@listserv.heanet.ie
>> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>>> Send bugs reports to
>> >>>>         https://github.com/csound/csound/issues
>> >>>> Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list
>> >> Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> Send bugs reports to
>> >>         https://github.com/csound/csound/issues
>> >> Discussions of bugs and features can be posted here
>> >
>> > Csound mailing list
>> > Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> > Send bugs reports to
>> >         https://github.com/csound/csound/issues
>> > Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-22 04:30
FromKevin Welsh
SubjectRe: no looping
Thanks for the detailed response Steven!  I am (at least vaguely)
familiar with the problems labels and gotos create, and strongly avoid
and advocate against them in most other languages.  I am a bit of an
old curmudgeon tho when it comes to my coding practices, and most of
my csound learning occurred before 4.x... so sometimes I get stuck in
my old ways.  I don't write loops that often, especially not krate
loops, but in the future I'll try the more current approach.

For some reason I didn't think an until loop would operate the same
way (allowing multiple loop passes per k-cycle), and that was most of
my concern and reasoning for using cggoto.  I was pleasantly surprised
when I ran my test!

As for Thorin's question, I'm not sure... but I think he's using this
structure to create "run once only" code in an instrument that
continues sounding, rather than an instrument that exits after only
one k-cycle... but perhaps I misinterpreted his example and goal.

On Thu, Jan 21, 2016 at 10:15 PM, thorin kerr  wrote:
> Yes.... but.... Csound is peculiar.
> For example, I use ckgoto a lot to do stuff on a single control pass, which
> I think is more useful than stuffing it all into a conditional block.
>
> konce init 0
> ckgoto (konce == 1), terminate
>
> ... krate stuff, usually on arrays or k-rate opcodes like event
>
> konce = 1
>
> terminate:
>
>
>
>
>
> On Fri, Jan 22, 2016 at 7:04 AM, Steven Yi  wrote:
>>
>> Hi Kevin,
>>
>> Using until-loops will compile down to gotos and labels and the loops
>> will process each value per k-rate loop and is as efficient as using
>> gotos and labels directly. Usage of until-loops is for clarity and
>> falls under the category of "control structures" within "structured
>> programming" (see [1] for background info). Dijkstra's [2] argument
>> against gotos and Knuth's [3] discussion of it and structured
>> programming are worthwhile reads, IMO, to get an idea of what happened
>> from the early days of programming as programming language design
>> evolved.  I think all of the same arguments against gotos/labels still
>> apply to Csound programming today.
>>
>> For my own Csound programming, since the introduction of if-then in CS
>> 4.23 and until- and while-loops in CS5/6, I have not had a need for
>> labels and gotos anymore. I'd generally encourage others to stop using
>> gotos/labels as well.
>>
>> steven
>>
>> [1] - https://en.wikipedia.org/wiki/Structured_programming
>> [2] -
>> http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html
>> [3] -
>> http://www.cs.sjsu.edu/~mak/CS185C/KnuthStructuredProgrammingGoTo.pdf
>>
>> On Thu, Jan 21, 2016 at 2:33 PM, Kevin Welsh  wrote:
>> > Steven, is there a performance reason until is preferred over if/goto
>> > or cggoto?  I haven't tested it, but I believe in Menno's case (from
>> > having looked at the imageplayer before) he needs k-rate loops
>> > operating more than one pass per control rate.  Does using until
>> > achieve this too?
>> >
>> > Sorry if they're stupid questions... as evidenced by my last thread
>> > about loops and my replies to Rory's thread about loops, it's probably
>> > obvious looping in k-rate is fairly new to me.
>> >
>> > On Thu, Jan 21, 2016 at 1:20 PM, Steven Yi  wrote:
>> >> Sorry, I realized I should have added increments, so the basic form
>> >> should be:
>> >>
>> >> kx = 0
>> >>
>> >> until (kx >= imaxX) do
>> >>   ky = 0
>> >>   until (ky >= imaxY) do
>> >>     ... do code ...
>> >>     ky += 1
>> >>   od
>> >>   kx += 1
>> >> od
>> >>
>> >> On Thu, Jan 21, 2016 at 10:44 AM, Steven Yi  wrote:
>> >>> I haven't looked at the code in depth, but in general for this kind of
>> >>> 2-dimensional data, I think it'd be more common to use nested loops,
>> >>> i.e.:
>> >>>
>> >>> kx = 0
>> >>>
>> >>> until (kx >= imaxX) do
>> >>>   ky = 0
>> >>>   until (ky >= imaxY) do
>> >>>   ... do code ...
>> >>>   od
>> >>> od
>> >>>
>> >>> That should read as "for each x location, read each y location and "do
>> >>> code". I would also suggest using the until-looping structure over
>> >>> goto's of any sort.
>> >>>
>> >>>
>> >>> On Thu, Jan 21, 2016 at 6:05 AM, Kevin Welsh  wrote:
>> >>>> Hello Menno,
>> >>>>
>> >>>> I had taken a look at your imageplayer instrument a month or two ago
>> >>>> when I was considering "porting" it to cabbage.  I noticed it wasn't
>> >>>> looping on the y axis as well, so I had taken a crack at re-writing
>> >>>> it.  I've been way too busy with life to really put too much effort
>> >>>> into continuing the imageplayer port, I'm hoping I'll get more free
>> >>>> time soon to work on it.
>> >>>>
>> >>>> This loop snippet starts both X and Y at 0, reads the data (insert
>> >>>> your own code for this where the comment is in the middle),
>> >>>> increments
>> >>>> X, returns to the "loopx" label to read again as long as it hasn't
>> >>>> reached maxX, in which case is continues... increments y, and returns
>> >>>> to loopy label which in turn resets X to 0 to start reading the next
>> >>>> row.  This continues until Y reaches it's max as well.
>> >>>>
>> >>>> The code can't be copy/pasted right in as a replacement, but it
>> >>>> hopefully it gives you an idea to get you moving forward.
>> >>>>
>> >>>>   iimage imageload Sfile
>> >>>>   imaxX, imaxY imagesize iimage
>> >>>>
>> >>>>   kxindex init 0
>> >>>>   kyindex init 0
>> >>>>
>> >>>>   loopy:
>> >>>>     kxindex = 0
>> >>>>   loopx:
>> >>>>
>> >>>> ;    imagegetpixel and the rest of what you want to do in the "meat"
>> >>>> of the loop goes here
>> >>>>
>> >>>>     kxindex=kxindex+1
>> >>>>     cggoto (kxindex> >>>>     kyindex=kyindex+1
>> >>>>     cggoto (kyindex> >>>>
>> >>>> On Thu, Jan 21, 2016 at 5:26 AM, Menno Knevel 
>> >>>> wrote:
>> >>>>> Hi,
>> >>>>> i have an image that i want to convert to sound.
>> >>>>> 
>> >>>>> This image example is 100 pixels x 3 pixels.
>> >>>>>
>> >>>>> I get it to scan from left to right but not from left to right while
>> >>>>> scanning the y axis. Somehow my loop is not correct but i don't see
>> >>>>> how.
>> >>>>> Perhaps someone can help here?
>> >>>>>
>> >>>>> loop:
>> >>>>>         ky = kindex / imageh
>> >>>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>> >>>>> ;printk 0, ky
>> >>>>> ;printk 0, kblue
>> >>>>>         printk 0, kindex
>> >>>>>         tablew (kgreen + kblue)*.5 , kindex, giamps
>> >>>>> ;write as amps to table
>> >>>>>         tablew imageh*1000 , kindex, gifrqs
>> >>>>> ;write as freqs to another table
>> >>>>>         kres tablei kindex, gifrqs
>> >>>>>         kindex = kindex + 1
>> >>>>> if (kindex < imageh) kgoto loop
>> >>>>>
>> >>>>> and in a greater context:
>> >>>>>
>> >>>>>
>> >>>>>         instr 1
>> >>>>>
>> >>>>> ;===========load image==============================================
>> >>>>> image imageload
>> >>>>> "/home/menno/onderzoek/imageopcodes/px3greenblue.png"
>> >>>>> imagew, imageh imagesize image
>> >>>>> printf "width and height of image = %d x %d\n", 1, imagew, imageh
>> >>>>> ;show width and height of image
>> >>>>>
>> >>>>> giamps ftgen 0, 0, -imageh, 10, 1
>> >>>>> gifrqs ftgen 0, 0, imagew, -7, 0, imagew, 2
>> >>>>>
>> >>>>> kindex = 1
>> >>>>> kx linseg 0, p3, 1                                      ;X-axis
>> >>>>> range
>> >>>>>
>> >>>>> loop:
>> >>>>>         ky = kindex / imageh
>> >>>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>> >>>>> ;printk 0, ky
>> >>>>> ;printk 0, kblue
>> >>>>>         printk 0, kindex
>> >>>>>         tablew (kgreen + kblue)*.5 , kindex, giamps
>> >>>>> ;write as amps to table
>> >>>>>         tablew imageh*1000 , kindex, gifrqs
>> >>>>> ;write as freqs to another table
>> >>>>>         kres tablei kindex, gifrqs
>> >>>>>         kindex = kindex + 1
>> >>>>> if (kindex < imageh) kgoto loop
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> --
>> >>>>> View this message in context:
>> >>>>> http://csound.1045644.n5.nabble.com/no-looping-tp5746506.html
>> >>>>> Sent from the Csound - General mailing list archive at Nabble.com.
>> >>>>>
>> >>>>> Csound mailing list
>> >>>>> Csound@listserv.heanet.ie
>> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>>>> Send bugs reports to
>> >>>>>         https://github.com/csound/csound/issues
>> >>>>> Discussions of bugs and features can be posted here
>> >>>>
>> >>>> Csound mailing list
>> >>>> Csound@listserv.heanet.ie
>> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>>> Send bugs reports to
>> >>>>         https://github.com/csound/csound/issues
>> >>>> Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list
>> >> Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> Send bugs reports to
>> >>         https://github.com/csound/csound/issues
>> >> Discussions of bugs and features can be posted here
>> >
>> > Csound mailing list
>> > Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> > Send bugs reports to
>> >         https://github.com/csound/csound/issues
>> > Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-22 05:26
Fromthorin kerr
SubjectRe: no looping
OK, while I'm here, I'll share some code... it mixes all of the above, and has a ckgoto

I'm not being argumentative. It really is just a matter of taste. I just felt like an excuse to share some code.

opcode chordal, 0, k[]k[]opO
;quick chords. koriginal holds the pfields on an event. (limit of 10 pfields)
;koriginal is an array, holding pfields for an event
;kintervals specifies concurrant pitches with that event. 
;idur specifies durations of the new events
;iampfac is a multiplier for p4 (assumed to be amplitude)
;uses cpstun for pitches, with scale specified by kscale (defaults to gi_CurrentScale)
koriginal[],kintervals[],idur,iampfac,kscale xin
  kndx      init      0                           
  konce     init      0  

  ckgoto    (konce == 1), terminate     ; one pass

  kscale    =  (kscale == 0 ? gi_CurrentScale : kscale)
  kpitval init 0
  ilen lenarray kintervals
  iplen lenarray koriginal

  kdur    =  (idur == 0 ? koriginal[2] : idur)

  until     (kndx >= ilen) do
    kpitval   =  koriginal[4] + kintervals[kndx]
    if (iplen == 5) then
      event     "i", koriginal[0], tempodur_k(koriginal[1]), tempodur_k(kdur), koriginal[3]*iampfac,\
                      cpstun(1,kpitval,kscale)
    elseif (iplen == 6) then
      event     "i", koriginal[0], tempodur_k(koriginal[1]), tempodur_k(kdur), koriginal[3]*iampfac,\
                      cpstun(1,kpitval,kscale), koriginal[5]
    elseif (iplen == 7) then
      event     "i", koriginal[0], tempodur_k(koriginal[1]), tempodur_k(kdur), koriginal[3]*iampfac,\
                      cpstun(1,kpitval,kscale), koriginal[5], koriginal[6]
    elseif (iplen == 8) then
      event     "i", koriginal[0], tempodur_k(koriginal[1]), tempodur_k(kdur), koriginal[3]*iampfac,\
                      cpstun(1,kpitval,kscale), koriginal[5], koriginal[6], koriginal[7]
    elseif (iplen == 9) then
      event     "i", koriginal[0], tempodur_k(koriginal[1]), tempodur_k(kdur), koriginal[3]*iampfac,\
                      cpstun(1,kpitval,kscale), koriginal[5], koriginal[6], koriginal[7], koriginal[8]
    elseif (iplen == 10) then
      event     "i", koriginal[0], tempodur_k(koriginal[1]), tempodur_k(kdur), koriginal[3]*iampfac,\
                      cpstun(1,kpitval,kscale), koriginal[5], koriginal[6], koriginal[7], koriginal[8], koriginal[9]
    endif

  kndx      +=        1
  od

  konce = 1
  terminate:
endop


;Can be used in an instrument like this. Fires instrument 1 chords, every 2 seconds.

instr 10

chordal array(1, 0, 2, 0.5, 0), array(0,2,4,8,10, -7, -14)

schedule p1, 2, 1, p4 + 1
turnoff
endin

instr 1
ares fmrhode p4, p5, 3, 2, 0.3, 3, -1, -1, -1, -1, -1
outs ares, ares
endin




On Fri, Jan 22, 2016 at 2:07 PM, Steven Yi <stevenyi@gmail.com> wrote:
I don't really think of Csound as being all that peculiar. ;)

For my own code, I tend to use init-time code (e.g., use event_i
instead of event) and turnoff rather than do a single k-rate pass.
Even then, you could use turnoff at perf-time for an early exit with a
conditional block:

kcount init 0
if (kcount == 1) then
  turnoff  ;; early exit, done on 2nd k-pass
endif

... krate stuff ...
kcount += 1

For example, this instrument:

instr 1
kcount init 0

printk2 kcount

if (kcount == 1) then
  turnoff
endif
kcount += 1
printk2 kcount, 2

endin

produces:

 i1     0.00000
 i1       1.00000
 i1     1.00000

before it exits. I personally think the if-statement is a bit clearer
on the intention of the code than the ckgoto version.  It's a little
more verbose but removes the use of a label to look for and keep track
of, which is worth the trade off for my tastes.



On Thu, Jan 21, 2016 at 10:15 PM, thorin kerr <thorin.kerr@gmail.com> wrote:
> Yes.... but.... Csound is peculiar.
> For example, I use ckgoto a lot to do stuff on a single control pass, which
> I think is more useful than stuffing it all into a conditional block.
>
> konce init 0
> ckgoto (konce == 1), terminate
>
> ... krate stuff, usually on arrays or k-rate opcodes like event
>
> konce = 1
>
> terminate:
>
>
>
>
>
> On Fri, Jan 22, 2016 at 7:04 AM, Steven Yi <stevenyi@gmail.com> wrote:
>>
>> Hi Kevin,
>>
>> Using until-loops will compile down to gotos and labels and the loops
>> will process each value per k-rate loop and is as efficient as using
>> gotos and labels directly. Usage of until-loops is for clarity and
>> falls under the category of "control structures" within "structured
>> programming" (see [1] for background info). Dijkstra's [2] argument
>> against gotos and Knuth's [3] discussion of it and structured
>> programming are worthwhile reads, IMO, to get an idea of what happened
>> from the early days of programming as programming language design
>> evolved.  I think all of the same arguments against gotos/labels still
>> apply to Csound programming today.
>>
>> For my own Csound programming, since the introduction of if-then in CS
>> 4.23 and until- and while-loops in CS5/6, I have not had a need for
>> labels and gotos anymore. I'd generally encourage others to stop using
>> gotos/labels as well.
>>
>> steven
>>
>> [1] - https://en.wikipedia.org/wiki/Structured_programming
>> [2] -
>> http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html
>> [3] -
>> http://www.cs.sjsu.edu/~mak/CS185C/KnuthStructuredProgrammingGoTo.pdf
>>
>> On Thu, Jan 21, 2016 at 2:33 PM, Kevin Welsh <tgrey1@gmail.com> wrote:
>> > Steven, is there a performance reason until is preferred over if/goto
>> > or cggoto?  I haven't tested it, but I believe in Menno's case (from
>> > having looked at the imageplayer before) he needs k-rate loops
>> > operating more than one pass per control rate.  Does using until
>> > achieve this too?
>> >
>> > Sorry if they're stupid questions... as evidenced by my last thread
>> > about loops and my replies to Rory's thread about loops, it's probably
>> > obvious looping in k-rate is fairly new to me.
>> >
>> > On Thu, Jan 21, 2016 at 1:20 PM, Steven Yi <stevenyi@gmail.com> wrote:
>> >> Sorry, I realized I should have added increments, so the basic form
>> >> should be:
>> >>
>> >> kx = 0
>> >>
>> >> until (kx >= imaxX) do
>> >>   ky = 0
>> >>   until (ky >= imaxY) do
>> >>     ... do code ...
>> >>     ky += 1
>> >>   od
>> >>   kx += 1
>> >> od
>> >>
>> >> On Thu, Jan 21, 2016 at 10:44 AM, Steven Yi <stevenyi@gmail.com> wrote:
>> >>> I haven't looked at the code in depth, but in general for this kind of
>> >>> 2-dimensional data, I think it'd be more common to use nested loops,
>> >>> i.e.:
>> >>>
>> >>> kx = 0
>> >>>
>> >>> until (kx >= imaxX) do
>> >>>   ky = 0
>> >>>   until (ky >= imaxY) do
>> >>>   ... do code ...
>> >>>   od
>> >>> od
>> >>>
>> >>> That should read as "for each x location, read each y location and "do
>> >>> code". I would also suggest using the until-looping structure over
>> >>> goto's of any sort.
>> >>>
>> >>>
>> >>> On Thu, Jan 21, 2016 at 6:05 AM, Kevin Welsh <tgrey1@gmail.com> wrote:
>> >>>> Hello Menno,
>> >>>>
>> >>>> I had taken a look at your imageplayer instrument a month or two ago
>> >>>> when I was considering "porting" it to cabbage.  I noticed it wasn't
>> >>>> looping on the y axis as well, so I had taken a crack at re-writing
>> >>>> it.  I've been way too busy with life to really put too much effort
>> >>>> into continuing the imageplayer port, I'm hoping I'll get more free
>> >>>> time soon to work on it.
>> >>>>
>> >>>> This loop snippet starts both X and Y at 0, reads the data (insert
>> >>>> your own code for this where the comment is in the middle),
>> >>>> increments
>> >>>> X, returns to the "loopx" label to read again as long as it hasn't
>> >>>> reached maxX, in which case is continues... increments y, and returns
>> >>>> to loopy label which in turn resets X to 0 to start reading the next
>> >>>> row.  This continues until Y reaches it's max as well.
>> >>>>
>> >>>> The code can't be copy/pasted right in as a replacement, but it
>> >>>> hopefully it gives you an idea to get you moving forward.
>> >>>>
>> >>>>   iimage imageload Sfile
>> >>>>   imaxX, imaxY imagesize iimage
>> >>>>
>> >>>>   kxindex init 0
>> >>>>   kyindex init 0
>> >>>>
>> >>>>   loopy:
>> >>>>     kxindex = 0
>> >>>>   loopx:
>> >>>>
>> >>>> ;    imagegetpixel and the rest of what you want to do in the "meat"
>> >>>> of the loop goes here
>> >>>>
>> >>>>     kxindex=kxindex+1
>> >>>>     cggoto (kxindex<imaxX), loopx
>> >>>>     kyindex=kyindex+1
>> >>>>     cggoto (kyindex<imaxY), loopy
>> >>>>
>> >>>> On Thu, Jan 21, 2016 at 5:26 AM, Menno Knevel <magknevel@gmail.com>
>> >>>> wrote:
>> >>>>> Hi,
>> >>>>> i have an image that i want to convert to sound.
>> >>>>> <http://csound.1045644.n5.nabble.com/file/n5746506/30.png>
>> >>>>> This image example is 100 pixels x 3 pixels.
>> >>>>>
>> >>>>> I get it to scan from left to right but not from left to right while
>> >>>>> scanning the y axis. Somehow my loop is not correct but i don't see
>> >>>>> how.
>> >>>>> Perhaps someone can help here?
>> >>>>>
>> >>>>> loop:
>> >>>>>         ky = kindex / imageh
>> >>>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>> >>>>> ;printk 0, ky
>> >>>>> ;printk 0, kblue
>> >>>>>         printk 0, kindex
>> >>>>>         tablew (kgreen + kblue)*.5 , kindex, giamps
>> >>>>> ;write as amps to table
>> >>>>>         tablew imageh*1000 , kindex, gifrqs
>> >>>>> ;write as freqs to another table
>> >>>>>         kres tablei kindex, gifrqs
>> >>>>>         kindex = kindex + 1
>> >>>>> if (kindex < imageh) kgoto loop
>> >>>>>
>> >>>>> and in a greater context:
>> >>>>>
>> >>>>>
>> >>>>>         instr 1
>> >>>>>
>> >>>>> ;===========load image==============================================
>> >>>>> image imageload
>> >>>>> "/home/menno/onderzoek/imageopcodes/px3greenblue.png"
>> >>>>> imagew, imageh imagesize image
>> >>>>> printf "width and height of image = %d x %d\n", 1, imagew, imageh
>> >>>>> ;show width and height of image
>> >>>>>
>> >>>>> giamps ftgen 0, 0, -imageh, 10, 1
>> >>>>> gifrqs ftgen 0, 0, imagew, -7, 0, imagew, 2
>> >>>>>
>> >>>>> kindex = 1
>> >>>>> kx linseg 0, p3, 1                                      ;X-axis
>> >>>>> range
>> >>>>>
>> >>>>> loop:
>> >>>>>         ky = kindex / imageh
>> >>>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>> >>>>> ;printk 0, ky
>> >>>>> ;printk 0, kblue
>> >>>>>         printk 0, kindex
>> >>>>>         tablew (kgreen + kblue)*.5 , kindex, giamps
>> >>>>> ;write as amps to table
>> >>>>>         tablew imageh*1000 , kindex, gifrqs
>> >>>>> ;write as freqs to another table
>> >>>>>         kres tablei kindex, gifrqs
>> >>>>>         kindex = kindex + 1
>> >>>>> if (kindex < imageh) kgoto loop
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> --
>> >>>>> View this message in context:
>> >>>>> http://csound.1045644.n5.nabble.com/no-looping-tp5746506.html
>> >>>>> Sent from the Csound - General mailing list archive at Nabble.com.
>> >>>>>
>> >>>>> Csound mailing list
>> >>>>> Csound@listserv.heanet.ie
>> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>>>> Send bugs reports to
>> >>>>>         https://github.com/csound/csound/issues
>> >>>>> Discussions of bugs and features can be posted here
>> >>>>
>> >>>> Csound mailing list
>> >>>> Csound@listserv.heanet.ie
>> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>>> Send bugs reports to
>> >>>>         https://github.com/csound/csound/issues
>> >>>> Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list
>> >> Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> Send bugs reports to
>> >>         https://github.com/csound/csound/issues
>> >> Discussions of bugs and features can be posted here
>> >
>> > Csound mailing list
>> > Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> > Send bugs reports to
>> >         https://github.com/csound/csound/issues
>> > Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-25 09:55
FromMenno Knevel
SubjectRe: no looping
i am using the until...do..od construction but get unexpected results. I have
several questions but will break them up in manageable portions.

I would like to fill 2 tables with the resulting values, so i can use them
at a later time.
- how can i get kxindex to count up to 3 and then stop? 
- what is wrong with the printing statement?

This is my code:
 

; Select audio/midi flags here according to platform
; Audio out   Audio in
-odac           -iadc    ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o imageopcodesdemo2.wav -W ;;; for file output any platform
 
 
sr      =      	48000 
ksmps  	=     	32
nchnls	=	2
0dbfs=1

	instr 1

kyindex = 0

until (kyindex >= 3) do
    kxindex = 0
    khy linseg 0, p3, 30

	until (kxindex >= 10) do
	kx = kxindex
	kwx linseg 0, p3, 100
	printks "kyindex = %f, khy = %f\\n", 0, kyindex, khy
	printks "kxindex = %f, kw = %f\\n", 0, kxindex, kwx
	kxindex += 1
	od

    kyindex += 1
od


asig1 oscil 1, 200 + khy
asig2 oscil 1, 200 + kwx
outs asig1, asig2
endin

;kx = 0

;until (kx >= imaxX) do
;  ky = 0
;  until (ky >= imaxY) do
;    ... do code ...
;    ky += 1
;  od
;  kx += 1
;od 

 


i1 1 .1

e





and the output:
new alloc for instr 1:
%f, khy = %f

%f

kyindex = 0.000000, khy = 0.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 0.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 0.600000
%f, kw = %f

%f

kxindex = 0.000000, kw = 20.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 1.200000
%f, kw = %f

%f

kxindex = 0.000000, kw = 40.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 2.400000
%f, kw = %f

%f

kxindex = 0.000000, kw = 80.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 3.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 4.200000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 4.800000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 6.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 6.600000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 7.800000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 8.400000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 9.600000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 10.200000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 11.400000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 12.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 13.200000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 13.800000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 15.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 15.600000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 16.800000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 17.400000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 18.600000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 19.200000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 20.400000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 21.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 22.200000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 22.800000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 24.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 24.600000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 25.800000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 26.400000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 27.600000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 28.200000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 29.400000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
%f, khy = %f

%f

kyindex = 0.000000, khy = 30.000000
%f, kw = %f

%f

kxindex = 0.000000, kw = 100.000000
B  1.000 ..  1.100 T  1.101 TT  1.101 M:  1.00000  0.99998
Score finished in csoundPerform().
inactive allocs returned to freespace
end of score.		   overall amps:  1.00000  0.99998
	   overall samples out of range:        0        0
0 errors in performance
Elapsed time at end of performance: real: 1.289s, CPU: 0.040s
207 512 sample blks of 64-bit floats written to dac:system:playback_
menno@muziek:/usr/bin$ 



--
View this message in context: http://csound.1045644.n5.nabble.com/no-looping-tp5746506p5746612.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-25 13:45
Fromjpff
SubjectRe: no looping
A linseg inside a loop is odd it will run out of data before p3.  Not sure 
what your problem is but tat is certainly an ssue.  One of theresons I do 
not like loops in csound, toehe with giles in los...

On Mon, 25 Jan 2016, Menno Knevel wrote:

> i am using the until...do..od construction but get unexpected results. I have
> several questions but will break them up in manageable portions.
>
> I would like to fill 2 tables with the resulting values, so i can use them
> at a later time.
> - how can i get kxindex to count up to 3 and then stop?
> - what is wrong with the printing statement?
>
> This is my code:
> 
> 
> ; Select audio/midi flags here according to platform
> ; Audio out   Audio in
> -odac           -iadc    ;;;RT audio I/O
> ; For Non-realtime ouput leave only the line below:
> ; -o imageopcodesdemo2.wav -W ;;; for file output any platform
> 
> 
> sr      =      	48000
> ksmps  	=     	32
> nchnls	=	2
> 0dbfs=1
>
> 	instr 1
>
> kyindex = 0
>
> until (kyindex >= 3) do
>    kxindex = 0
>    khy linseg 0, p3, 30
>
> 	until (kxindex >= 10) do
> 	kx = kxindex
> 	kwx linseg 0, p3, 100
> 	printks "kyindex = %f, khy = %f\\n", 0, kyindex, khy
> 	printks "kxindex = %f, kw = %f\\n", 0, kxindex, kwx
> 	kxindex += 1
> 	od
>
>    kyindex += 1
> od
>
>
> asig1 oscil 1, 200 + khy
> asig2 oscil 1, 200 + kwx
> outs asig1, asig2
> endin
>
> ;kx = 0
>
> ;until (kx >= imaxX) do
> ;  ky = 0
> ;  until (ky >= imaxY) do
> ;    ... do code ...
> ;    ky += 1
> ;  od
> ;  kx += 1
> ;od
>
> 
> 
>
> i1 1 .1
>
> e
>
> 
> 
>
>
> and the output:
> new alloc for instr 1:
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 0.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 0.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 0.600000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 20.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 1.200000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 40.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 2.400000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 80.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 3.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 4.200000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 4.800000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 6.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 6.600000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 7.800000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 8.400000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 9.600000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 10.200000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 11.400000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 12.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 13.200000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 13.800000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 15.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 15.600000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 16.800000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 17.400000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 18.600000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 19.200000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 20.400000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 21.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 22.200000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 22.800000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 24.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 24.600000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 25.800000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 26.400000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 27.600000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 28.200000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 29.400000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> %f, khy = %f
>
> %f
>
> kyindex = 0.000000, khy = 30.000000
> %f, kw = %f
>
> %f
>
> kxindex = 0.000000, kw = 100.000000
> B  1.000 ..  1.100 T  1.101 TT  1.101 M:  1.00000  0.99998
> Score finished in csoundPerform().
> inactive allocs returned to freespace
> end of score.		   overall amps:  1.00000  0.99998
> 	   overall samples out of range:        0        0
> 0 errors in performance
> Elapsed time at end of performance: real: 1.289s, CPU: 0.040s
> 207 512 sample blks of 64-bit floats written to dac:system:playback_
> menno@muziek:/usr/bin$
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/no-looping-tp5746506p5746612.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-25 13:54
FromMenno Knevel
SubjectRe: no looping
i'm sorry, John, but your last remark is too encrypted for me:"toehe with
giles in los... " :)
What do you mean?



--
View this message in context: http://csound.1045644.n5.nabble.com/no-looping-tp5746506p5746626.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-25 16:18
Fromjpff
SubjectRe: no looping
Means my old lapto's keyboard is breaking up

"together with filters in loops..."y

On Mon, 25 Jan 2016, Menno Knevel wrote:

> i'm sorry, John, but your last remark is too encrypted for me:"toehe with
> giles in los... " :)
> What do you mean?
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/no-looping-tp5746506p5746626.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-25 16:42
FromSteven Yi
SubjectRe: no looping
Hi Thorin,

Thanks for sharing that. I still prefer to avoid gotos/labels myself,
but the posted code is certainly clear to me and I can see why you'd
prefer that style too.  Like you said, different tastes. :)

One thing about the example is that it makes me think we should look
at implementing a few functional programming approaches to array/list
processing (particularly an apply operator, in-line lambdas as UDO's,
a more generic map opcode).  That might simplify the event generation
code there.  Something to think about for CS7.

steven



On Fri, Jan 22, 2016 at 12:26 AM, thorin kerr  wrote:
> OK, while I'm here, I'll share some code... it mixes all of the above, and
> has a ckgoto
>
> I'm not being argumentative. It really is just a matter of taste. I just
> felt like an excuse to share some code.
>
> opcode chordal, 0, k[]k[]opO
> ;quick chords. koriginal holds the pfields on an event. (limit of 10
> pfields)
> ;koriginal is an array, holding pfields for an event
> ;kintervals specifies concurrant pitches with that event.
> ;idur specifies durations of the new events
> ;iampfac is a multiplier for p4 (assumed to be amplitude)
> ;uses cpstun for pitches, with scale specified by kscale (defaults to
> gi_CurrentScale)
> koriginal[],kintervals[],idur,iampfac,kscale xin
>   kndx      init      0
>   konce     init      0
>
>   ckgoto    (konce == 1), terminate     ; one pass
>
>   kscale    =  (kscale == 0 ? gi_CurrentScale : kscale)
>   kpitval init 0
>   ilen lenarray kintervals
>   iplen lenarray koriginal
>
>   kdur    =  (idur == 0 ? koriginal[2] : idur)
>
>   until     (kndx >= ilen) do
>     kpitval   =  koriginal[4] + kintervals[kndx]
>     if (iplen == 5) then
>       event     "i", koriginal[0], tempodur_k(koriginal[1]),
> tempodur_k(kdur), koriginal[3]*iampfac,\
>                       cpstun(1,kpitval,kscale)
>     elseif (iplen == 6) then
>       event     "i", koriginal[0], tempodur_k(koriginal[1]),
> tempodur_k(kdur), koriginal[3]*iampfac,\
>                       cpstun(1,kpitval,kscale), koriginal[5]
>     elseif (iplen == 7) then
>       event     "i", koriginal[0], tempodur_k(koriginal[1]),
> tempodur_k(kdur), koriginal[3]*iampfac,\
>                       cpstun(1,kpitval,kscale), koriginal[5], koriginal[6]
>     elseif (iplen == 8) then
>       event     "i", koriginal[0], tempodur_k(koriginal[1]),
> tempodur_k(kdur), koriginal[3]*iampfac,\
>                       cpstun(1,kpitval,kscale), koriginal[5], koriginal[6],
> koriginal[7]
>     elseif (iplen == 9) then
>       event     "i", koriginal[0], tempodur_k(koriginal[1]),
> tempodur_k(kdur), koriginal[3]*iampfac,\
>                       cpstun(1,kpitval,kscale), koriginal[5], koriginal[6],
> koriginal[7], koriginal[8]
>     elseif (iplen == 10) then
>       event     "i", koriginal[0], tempodur_k(koriginal[1]),
> tempodur_k(kdur), koriginal[3]*iampfac,\
>                       cpstun(1,kpitval,kscale), koriginal[5], koriginal[6],
> koriginal[7], koriginal[8], koriginal[9]
>     endif
>
>   kndx      +=        1
>   od
>
>   konce = 1
>   terminate:
> endop
>
>
> ;Can be used in an instrument like this. Fires instrument 1 chords, every 2
> seconds.
>
> instr 10
>
> chordal array(1, 0, 2, 0.5, 0), array(0,2,4,8,10, -7, -14)
>
> schedule p1, 2, 1, p4 + 1
> turnoff
> endin
>
> instr 1
> ares fmrhode p4, p5, 3, 2, 0.3, 3, -1, -1, -1, -1, -1
> outs ares, ares
> endin
>
>
>
>
> On Fri, Jan 22, 2016 at 2:07 PM, Steven Yi  wrote:
>>
>> I don't really think of Csound as being all that peculiar. ;)
>>
>> For my own code, I tend to use init-time code (e.g., use event_i
>> instead of event) and turnoff rather than do a single k-rate pass.
>> Even then, you could use turnoff at perf-time for an early exit with a
>> conditional block:
>>
>> kcount init 0
>> if (kcount == 1) then
>>   turnoff  ;; early exit, done on 2nd k-pass
>> endif
>>
>> ... krate stuff ...
>> kcount += 1
>>
>> For example, this instrument:
>>
>> instr 1
>> kcount init 0
>>
>> printk2 kcount
>>
>> if (kcount == 1) then
>>   turnoff
>> endif
>> kcount += 1
>> printk2 kcount, 2
>>
>> endin
>>
>> produces:
>>
>>  i1     0.00000
>>  i1       1.00000
>>  i1     1.00000
>>
>> before it exits. I personally think the if-statement is a bit clearer
>> on the intention of the code than the ckgoto version.  It's a little
>> more verbose but removes the use of a label to look for and keep track
>> of, which is worth the trade off for my tastes.
>>
>>
>>
>> On Thu, Jan 21, 2016 at 10:15 PM, thorin kerr 
>> wrote:
>> > Yes.... but.... Csound is peculiar.
>> > For example, I use ckgoto a lot to do stuff on a single control pass,
>> > which
>> > I think is more useful than stuffing it all into a conditional block.
>> >
>> > konce init 0
>> > ckgoto (konce == 1), terminate
>> >
>> > ... krate stuff, usually on arrays or k-rate opcodes like event
>> >
>> > konce = 1
>> >
>> > terminate:
>> >
>> >
>> >
>> >
>> >
>> > On Fri, Jan 22, 2016 at 7:04 AM, Steven Yi  wrote:
>> >>
>> >> Hi Kevin,
>> >>
>> >> Using until-loops will compile down to gotos and labels and the loops
>> >> will process each value per k-rate loop and is as efficient as using
>> >> gotos and labels directly. Usage of until-loops is for clarity and
>> >> falls under the category of "control structures" within "structured
>> >> programming" (see [1] for background info). Dijkstra's [2] argument
>> >> against gotos and Knuth's [3] discussion of it and structured
>> >> programming are worthwhile reads, IMO, to get an idea of what happened
>> >> from the early days of programming as programming language design
>> >> evolved.  I think all of the same arguments against gotos/labels still
>> >> apply to Csound programming today.
>> >>
>> >> For my own Csound programming, since the introduction of if-then in CS
>> >> 4.23 and until- and while-loops in CS5/6, I have not had a need for
>> >> labels and gotos anymore. I'd generally encourage others to stop using
>> >> gotos/labels as well.
>> >>
>> >> steven
>> >>
>> >> [1] - https://en.wikipedia.org/wiki/Structured_programming
>> >> [2] -
>> >>
>> >> http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html
>> >> [3] -
>> >> http://www.cs.sjsu.edu/~mak/CS185C/KnuthStructuredProgrammingGoTo.pdf
>> >>
>> >> On Thu, Jan 21, 2016 at 2:33 PM, Kevin Welsh  wrote:
>> >> > Steven, is there a performance reason until is preferred over if/goto
>> >> > or cggoto?  I haven't tested it, but I believe in Menno's case (from
>> >> > having looked at the imageplayer before) he needs k-rate loops
>> >> > operating more than one pass per control rate.  Does using until
>> >> > achieve this too?
>> >> >
>> >> > Sorry if they're stupid questions... as evidenced by my last thread
>> >> > about loops and my replies to Rory's thread about loops, it's
>> >> > probably
>> >> > obvious looping in k-rate is fairly new to me.
>> >> >
>> >> > On Thu, Jan 21, 2016 at 1:20 PM, Steven Yi 
>> >> > wrote:
>> >> >> Sorry, I realized I should have added increments, so the basic form
>> >> >> should be:
>> >> >>
>> >> >> kx = 0
>> >> >>
>> >> >> until (kx >= imaxX) do
>> >> >>   ky = 0
>> >> >>   until (ky >= imaxY) do
>> >> >>     ... do code ...
>> >> >>     ky += 1
>> >> >>   od
>> >> >>   kx += 1
>> >> >> od
>> >> >>
>> >> >> On Thu, Jan 21, 2016 at 10:44 AM, Steven Yi 
>> >> >> wrote:
>> >> >>> I haven't looked at the code in depth, but in general for this kind
>> >> >>> of
>> >> >>> 2-dimensional data, I think it'd be more common to use nested
>> >> >>> loops,
>> >> >>> i.e.:
>> >> >>>
>> >> >>> kx = 0
>> >> >>>
>> >> >>> until (kx >= imaxX) do
>> >> >>>   ky = 0
>> >> >>>   until (ky >= imaxY) do
>> >> >>>   ... do code ...
>> >> >>>   od
>> >> >>> od
>> >> >>>
>> >> >>> That should read as "for each x location, read each y location and
>> >> >>> "do
>> >> >>> code". I would also suggest using the until-looping structure over
>> >> >>> goto's of any sort.
>> >> >>>
>> >> >>>
>> >> >>> On Thu, Jan 21, 2016 at 6:05 AM, Kevin Welsh 
>> >> >>> wrote:
>> >> >>>> Hello Menno,
>> >> >>>>
>> >> >>>> I had taken a look at your imageplayer instrument a month or two
>> >> >>>> ago
>> >> >>>> when I was considering "porting" it to cabbage.  I noticed it
>> >> >>>> wasn't
>> >> >>>> looping on the y axis as well, so I had taken a crack at
>> >> >>>> re-writing
>> >> >>>> it.  I've been way too busy with life to really put too much
>> >> >>>> effort
>> >> >>>> into continuing the imageplayer port, I'm hoping I'll get more
>> >> >>>> free
>> >> >>>> time soon to work on it.
>> >> >>>>
>> >> >>>> This loop snippet starts both X and Y at 0, reads the data (insert
>> >> >>>> your own code for this where the comment is in the middle),
>> >> >>>> increments
>> >> >>>> X, returns to the "loopx" label to read again as long as it hasn't
>> >> >>>> reached maxX, in which case is continues... increments y, and
>> >> >>>> returns
>> >> >>>> to loopy label which in turn resets X to 0 to start reading the
>> >> >>>> next
>> >> >>>> row.  This continues until Y reaches it's max as well.
>> >> >>>>
>> >> >>>> The code can't be copy/pasted right in as a replacement, but it
>> >> >>>> hopefully it gives you an idea to get you moving forward.
>> >> >>>>
>> >> >>>>   iimage imageload Sfile
>> >> >>>>   imaxX, imaxY imagesize iimage
>> >> >>>>
>> >> >>>>   kxindex init 0
>> >> >>>>   kyindex init 0
>> >> >>>>
>> >> >>>>   loopy:
>> >> >>>>     kxindex = 0
>> >> >>>>   loopx:
>> >> >>>>
>> >> >>>> ;    imagegetpixel and the rest of what you want to do in the
>> >> >>>> "meat"
>> >> >>>> of the loop goes here
>> >> >>>>
>> >> >>>>     kxindex=kxindex+1
>> >> >>>>     cggoto (kxindex> >> >>>>     kyindex=kyindex+1
>> >> >>>>     cggoto (kyindex> >> >>>>
>> >> >>>> On Thu, Jan 21, 2016 at 5:26 AM, Menno Knevel
>> >> >>>> 
>> >> >>>> wrote:
>> >> >>>>> Hi,
>> >> >>>>> i have an image that i want to convert to sound.
>> >> >>>>> 
>> >> >>>>> This image example is 100 pixels x 3 pixels.
>> >> >>>>>
>> >> >>>>> I get it to scan from left to right but not from left to right
>> >> >>>>> while
>> >> >>>>> scanning the y axis. Somehow my loop is not correct but i don't
>> >> >>>>> see
>> >> >>>>> how.
>> >> >>>>> Perhaps someone can help here?
>> >> >>>>>
>> >> >>>>> loop:
>> >> >>>>>         ky = kindex / imageh
>> >> >>>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>> >> >>>>> ;printk 0, ky
>> >> >>>>> ;printk 0, kblue
>> >> >>>>>         printk 0, kindex
>> >> >>>>>         tablew (kgreen + kblue)*.5 , kindex, giamps
>> >> >>>>> ;write as amps to table
>> >> >>>>>         tablew imageh*1000 , kindex, gifrqs
>> >> >>>>> ;write as freqs to another table
>> >> >>>>>         kres tablei kindex, gifrqs
>> >> >>>>>         kindex = kindex + 1
>> >> >>>>> if (kindex < imageh) kgoto loop
>> >> >>>>>
>> >> >>>>> and in a greater context:
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>         instr 1
>> >> >>>>>
>> >> >>>>> ;===========load
>> >> >>>>> image==============================================
>> >> >>>>> image imageload
>> >> >>>>> "/home/menno/onderzoek/imageopcodes/px3greenblue.png"
>> >> >>>>> imagew, imageh imagesize image
>> >> >>>>> printf "width and height of image = %d x %d\n", 1, imagew, imageh
>> >> >>>>> ;show width and height of image
>> >> >>>>>
>> >> >>>>> giamps ftgen 0, 0, -imageh, 10, 1
>> >> >>>>> gifrqs ftgen 0, 0, imagew, -7, 0, imagew, 2
>> >> >>>>>
>> >> >>>>> kindex = 1
>> >> >>>>> kx linseg 0, p3, 1                                      ;X-axis
>> >> >>>>> range
>> >> >>>>>
>> >> >>>>> loop:
>> >> >>>>>         ky = kindex / imageh
>> >> >>>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>> >> >>>>> ;printk 0, ky
>> >> >>>>> ;printk 0, kblue
>> >> >>>>>         printk 0, kindex
>> >> >>>>>         tablew (kgreen + kblue)*.5 , kindex, giamps
>> >> >>>>> ;write as amps to table
>> >> >>>>>         tablew imageh*1000 , kindex, gifrqs
>> >> >>>>> ;write as freqs to another table
>> >> >>>>>         kres tablei kindex, gifrqs
>> >> >>>>>         kindex = kindex + 1
>> >> >>>>> if (kindex < imageh) kgoto loop
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>
>> >> >>>>> --
>> >> >>>>> View this message in context:
>> >> >>>>> http://csound.1045644.n5.nabble.com/no-looping-tp5746506.html
>> >> >>>>> Sent from the Csound - General mailing list archive at
>> >> >>>>> Nabble.com.
>> >> >>>>>
>> >> >>>>> Csound mailing list
>> >> >>>>> Csound@listserv.heanet.ie
>> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>>>> Send bugs reports to
>> >> >>>>>         https://github.com/csound/csound/issues
>> >> >>>>> Discussions of bugs and features can be posted here
>> >> >>>>
>> >> >>>> Csound mailing list
>> >> >>>> Csound@listserv.heanet.ie
>> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>>> Send bugs reports to
>> >> >>>>         https://github.com/csound/csound/issues
>> >> >>>> Discussions of bugs and features can be posted here
>> >> >>
>> >> >> Csound mailing list
>> >> >> Csound@listserv.heanet.ie
>> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >> Send bugs reports to
>> >> >>         https://github.com/csound/csound/issues
>> >> >> Discussions of bugs and features can be posted here
>> >> >
>> >> > Csound mailing list
>> >> > Csound@listserv.heanet.ie
>> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> > Send bugs reports to
>> >> >         https://github.com/csound/csound/issues
>> >> > Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list
>> >> Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> Send bugs reports to
>> >>         https://github.com/csound/csound/issues
>> >> Discussions of bugs and features can be posted here
>> >
>> >
>> > Csound mailing list Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features
>> > can
>> > be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-01-25 17:09
Fromthorin kerr
SubjectRe: no looping
Hi Steven

Functional tools like apply would be fantastic. 
Also, the ability to pass opcodes/functions as arguments (to more opcodes/functions).

... while I'm here... again... here's some more code, using in-line arrays as arguments.

This time, I've live coded it. The example is here:

Thorin













On Tue, Jan 26, 2016 at 2:42 AM, Steven Yi <stevenyi@gmail.com> wrote:
Hi Thorin,

Thanks for sharing that. I still prefer to avoid gotos/labels myself,
but the posted code is certainly clear to me and I can see why you'd
prefer that style too.  Like you said, different tastes. :)

One thing about the example is that it makes me think we should look
at implementing a few functional programming approaches to array/list
processing (particularly an apply operator, in-line lambdas as UDO's,
a more generic map opcode).  That might simplify the event generation
code there.  Something to think about for CS7.

steven



On Fri, Jan 22, 2016 at 12:26 AM, thorin kerr <thorin.kerr@gmail.com> wrote:
> OK, while I'm here, I'll share some code... it mixes all of the above, and
> has a ckgoto
>
> I'm not being argumentative. It really is just a matter of taste. I just
> felt like an excuse to share some code.
>
> opcode chordal, 0, k[]k[]opO
> ;quick chords. koriginal holds the pfields on an event. (limit of 10
> pfields)
> ;koriginal is an array, holding pfields for an event
> ;kintervals specifies concurrant pitches with that event.
> ;idur specifies durations of the new events
> ;iampfac is a multiplier for p4 (assumed to be amplitude)
> ;uses cpstun for pitches, with scale specified by kscale (defaults to
> gi_CurrentScale)
> koriginal[],kintervals[],idur,iampfac,kscale xin
>   kndx      init      0
>   konce     init      0
>
>   ckgoto    (konce == 1), terminate     ; one pass
>
>   kscale    =  (kscale == 0 ? gi_CurrentScale : kscale)
>   kpitval init 0
>   ilen lenarray kintervals
>   iplen lenarray koriginal
>
>   kdur    =  (idur == 0 ? koriginal[2] : idur)
>
>   until     (kndx >= ilen) do
>     kpitval   =  koriginal[4] + kintervals[kndx]
>     if (iplen == 5) then
>       event     "i", koriginal[0], tempodur_k(koriginal[1]),
> tempodur_k(kdur), koriginal[3]*iampfac,\
>                       cpstun(1,kpitval,kscale)
>     elseif (iplen == 6) then
>       event     "i", koriginal[0], tempodur_k(koriginal[1]),
> tempodur_k(kdur), koriginal[3]*iampfac,\
>                       cpstun(1,kpitval,kscale), koriginal[5]
>     elseif (iplen == 7) then
>       event     "i", koriginal[0], tempodur_k(koriginal[1]),
> tempodur_k(kdur), koriginal[3]*iampfac,\
>                       cpstun(1,kpitval,kscale), koriginal[5], koriginal[6]
>     elseif (iplen == 8) then
>       event     "i", koriginal[0], tempodur_k(koriginal[1]),
> tempodur_k(kdur), koriginal[3]*iampfac,\
>                       cpstun(1,kpitval,kscale), koriginal[5], koriginal[6],
> koriginal[7]
>     elseif (iplen == 9) then
>       event     "i", koriginal[0], tempodur_k(koriginal[1]),
> tempodur_k(kdur), koriginal[3]*iampfac,\
>                       cpstun(1,kpitval,kscale), koriginal[5], koriginal[6],
> koriginal[7], koriginal[8]
>     elseif (iplen == 10) then
>       event     "i", koriginal[0], tempodur_k(koriginal[1]),
> tempodur_k(kdur), koriginal[3]*iampfac,\
>                       cpstun(1,kpitval,kscale), koriginal[5], koriginal[6],
> koriginal[7], koriginal[8], koriginal[9]
>     endif
>
>   kndx      +=        1
>   od
>
>   konce = 1
>   terminate:
> endop
>
>
> ;Can be used in an instrument like this. Fires instrument 1 chords, every 2
> seconds.
>
> instr 10
>
> chordal array(1, 0, 2, 0.5, 0), array(0,2,4,8,10, -7, -14)
>
> schedule p1, 2, 1, p4 + 1
> turnoff
> endin
>
> instr 1
> ares fmrhode p4, p5, 3, 2, 0.3, 3, -1, -1, -1, -1, -1
> outs ares, ares
> endin
>
>
>
>
> On Fri, Jan 22, 2016 at 2:07 PM, Steven Yi <stevenyi@gmail.com> wrote:
>>
>> I don't really think of Csound as being all that peculiar. ;)
>>
>> For my own code, I tend to use init-time code (e.g., use event_i
>> instead of event) and turnoff rather than do a single k-rate pass.
>> Even then, you could use turnoff at perf-time for an early exit with a
>> conditional block:
>>
>> kcount init 0
>> if (kcount == 1) then
>>   turnoff  ;; early exit, done on 2nd k-pass
>> endif
>>
>> ... krate stuff ...
>> kcount += 1
>>
>> For example, this instrument:
>>
>> instr 1
>> kcount init 0
>>
>> printk2 kcount
>>
>> if (kcount == 1) then
>>   turnoff
>> endif
>> kcount += 1
>> printk2 kcount, 2
>>
>> endin
>>
>> produces:
>>
>>  i1     0.00000
>>  i1       1.00000
>>  i1     1.00000
>>
>> before it exits. I personally think the if-statement is a bit clearer
>> on the intention of the code than the ckgoto version.  It's a little
>> more verbose but removes the use of a label to look for and keep track
>> of, which is worth the trade off for my tastes.
>>
>>
>>
>> On Thu, Jan 21, 2016 at 10:15 PM, thorin kerr <thorin.kerr@gmail.com>
>> wrote:
>> > Yes.... but.... Csound is peculiar.
>> > For example, I use ckgoto a lot to do stuff on a single control pass,
>> > which
>> > I think is more useful than stuffing it all into a conditional block.
>> >
>> > konce init 0
>> > ckgoto (konce == 1), terminate
>> >
>> > ... krate stuff, usually on arrays or k-rate opcodes like event
>> >
>> > konce = 1
>> >
>> > terminate:
>> >
>> >
>> >
>> >
>> >
>> > On Fri, Jan 22, 2016 at 7:04 AM, Steven Yi <stevenyi@gmail.com> wrote:
>> >>
>> >> Hi Kevin,
>> >>
>> >> Using until-loops will compile down to gotos and labels and the loops
>> >> will process each value per k-rate loop and is as efficient as using
>> >> gotos and labels directly. Usage of until-loops is for clarity and
>> >> falls under the category of "control structures" within "structured
>> >> programming" (see [1] for background info). Dijkstra's [2] argument
>> >> against gotos and Knuth's [3] discussion of it and structured
>> >> programming are worthwhile reads, IMO, to get an idea of what happened
>> >> from the early days of programming as programming language design
>> >> evolved.  I think all of the same arguments against gotos/labels still
>> >> apply to Csound programming today.
>> >>
>> >> For my own Csound programming, since the introduction of if-then in CS
>> >> 4.23 and until- and while-loops in CS5/6, I have not had a need for
>> >> labels and gotos anymore. I'd generally encourage others to stop using
>> >> gotos/labels as well.
>> >>
>> >> steven
>> >>
>> >> [1] - https://en.wikipedia.org/wiki/Structured_programming
>> >> [2] -
>> >>
>> >> http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html
>> >> [3] -
>> >> http://www.cs.sjsu.edu/~mak/CS185C/KnuthStructuredProgrammingGoTo.pdf
>> >>
>> >> On Thu, Jan 21, 2016 at 2:33 PM, Kevin Welsh <tgrey1@gmail.com> wrote:
>> >> > Steven, is there a performance reason until is preferred over if/goto
>> >> > or cggoto?  I haven't tested it, but I believe in Menno's case (from
>> >> > having looked at the imageplayer before) he needs k-rate loops
>> >> > operating more than one pass per control rate.  Does using until
>> >> > achieve this too?
>> >> >
>> >> > Sorry if they're stupid questions... as evidenced by my last thread
>> >> > about loops and my replies to Rory's thread about loops, it's
>> >> > probably
>> >> > obvious looping in k-rate is fairly new to me.
>> >> >
>> >> > On Thu, Jan 21, 2016 at 1:20 PM, Steven Yi <stevenyi@gmail.com>
>> >> > wrote:
>> >> >> Sorry, I realized I should have added increments, so the basic form
>> >> >> should be:
>> >> >>
>> >> >> kx = 0
>> >> >>
>> >> >> until (kx >= imaxX) do
>> >> >>   ky = 0
>> >> >>   until (ky >= imaxY) do
>> >> >>     ... do code ...
>> >> >>     ky += 1
>> >> >>   od
>> >> >>   kx += 1
>> >> >> od
>> >> >>
>> >> >> On Thu, Jan 21, 2016 at 10:44 AM, Steven Yi <stevenyi@gmail.com>
>> >> >> wrote:
>> >> >>> I haven't looked at the code in depth, but in general for this kind
>> >> >>> of
>> >> >>> 2-dimensional data, I think it'd be more common to use nested
>> >> >>> loops,
>> >> >>> i.e.:
>> >> >>>
>> >> >>> kx = 0
>> >> >>>
>> >> >>> until (kx >= imaxX) do
>> >> >>>   ky = 0
>> >> >>>   until (ky >= imaxY) do
>> >> >>>   ... do code ...
>> >> >>>   od
>> >> >>> od
>> >> >>>
>> >> >>> That should read as "for each x location, read each y location and
>> >> >>> "do
>> >> >>> code". I would also suggest using the until-looping structure over
>> >> >>> goto's of any sort.
>> >> >>>
>> >> >>>
>> >> >>> On Thu, Jan 21, 2016 at 6:05 AM, Kevin Welsh <tgrey1@gmail.com>
>> >> >>> wrote:
>> >> >>>> Hello Menno,
>> >> >>>>
>> >> >>>> I had taken a look at your imageplayer instrument a month or two
>> >> >>>> ago
>> >> >>>> when I was considering "porting" it to cabbage.  I noticed it
>> >> >>>> wasn't
>> >> >>>> looping on the y axis as well, so I had taken a crack at
>> >> >>>> re-writing
>> >> >>>> it.  I've been way too busy with life to really put too much
>> >> >>>> effort
>> >> >>>> into continuing the imageplayer port, I'm hoping I'll get more
>> >> >>>> free
>> >> >>>> time soon to work on it.
>> >> >>>>
>> >> >>>> This loop snippet starts both X and Y at 0, reads the data (insert
>> >> >>>> your own code for this where the comment is in the middle),
>> >> >>>> increments
>> >> >>>> X, returns to the "loopx" label to read again as long as it hasn't
>> >> >>>> reached maxX, in which case is continues... increments y, and
>> >> >>>> returns
>> >> >>>> to loopy label which in turn resets X to 0 to start reading the
>> >> >>>> next
>> >> >>>> row.  This continues until Y reaches it's max as well.
>> >> >>>>
>> >> >>>> The code can't be copy/pasted right in as a replacement, but it
>> >> >>>> hopefully it gives you an idea to get you moving forward.
>> >> >>>>
>> >> >>>>   iimage imageload Sfile
>> >> >>>>   imaxX, imaxY imagesize iimage
>> >> >>>>
>> >> >>>>   kxindex init 0
>> >> >>>>   kyindex init 0
>> >> >>>>
>> >> >>>>   loopy:
>> >> >>>>     kxindex = 0
>> >> >>>>   loopx:
>> >> >>>>
>> >> >>>> ;    imagegetpixel and the rest of what you want to do in the
>> >> >>>> "meat"
>> >> >>>> of the loop goes here
>> >> >>>>
>> >> >>>>     kxindex=kxindex+1
>> >> >>>>     cggoto (kxindex<imaxX), loopx
>> >> >>>>     kyindex=kyindex+1
>> >> >>>>     cggoto (kyindex<imaxY), loopy
>> >> >>>>
>> >> >>>> On Thu, Jan 21, 2016 at 5:26 AM, Menno Knevel
>> >> >>>> <magknevel@gmail.com>
>> >> >>>> wrote:
>> >> >>>>> Hi,
>> >> >>>>> i have an image that i want to convert to sound.
>> >> >>>>> <http://csound.1045644.n5.nabble.com/file/n5746506/30.png>
>> >> >>>>> This image example is 100 pixels x 3 pixels.
>> >> >>>>>
>> >> >>>>> I get it to scan from left to right but not from left to right
>> >> >>>>> while
>> >> >>>>> scanning the y axis. Somehow my loop is not correct but i don't
>> >> >>>>> see
>> >> >>>>> how.
>> >> >>>>> Perhaps someone can help here?
>> >> >>>>>
>> >> >>>>> loop:
>> >> >>>>>         ky = kindex / imageh
>> >> >>>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>> >> >>>>> ;printk 0, ky
>> >> >>>>> ;printk 0, kblue
>> >> >>>>>         printk 0, kindex
>> >> >>>>>         tablew (kgreen + kblue)*.5 , kindex, giamps
>> >> >>>>> ;write as amps to table
>> >> >>>>>         tablew imageh*1000 , kindex, gifrqs
>> >> >>>>> ;write as freqs to another table
>> >> >>>>>         kres tablei kindex, gifrqs
>> >> >>>>>         kindex = kindex + 1
>> >> >>>>> if (kindex < imageh) kgoto loop
>> >> >>>>>
>> >> >>>>> and in a greater context:
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>         instr 1
>> >> >>>>>
>> >> >>>>> ;===========load
>> >> >>>>> image==============================================
>> >> >>>>> image imageload
>> >> >>>>> "/home/menno/onderzoek/imageopcodes/px3greenblue.png"
>> >> >>>>> imagew, imageh imagesize image
>> >> >>>>> printf "width and height of image = %d x %d\n", 1, imagew, imageh
>> >> >>>>> ;show width and height of image
>> >> >>>>>
>> >> >>>>> giamps ftgen 0, 0, -imageh, 10, 1
>> >> >>>>> gifrqs ftgen 0, 0, imagew, -7, 0, imagew, 2
>> >> >>>>>
>> >> >>>>> kindex = 1
>> >> >>>>> kx linseg 0, p3, 1                                      ;X-axis
>> >> >>>>> range
>> >> >>>>>
>> >> >>>>> loop:
>> >> >>>>>         ky = kindex / imageh
>> >> >>>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>> >> >>>>> ;printk 0, ky
>> >> >>>>> ;printk 0, kblue
>> >> >>>>>         printk 0, kindex
>> >> >>>>>         tablew (kgreen + kblue)*.5 , kindex, giamps
>> >> >>>>> ;write as amps to table
>> >> >>>>>         tablew imageh*1000 , kindex, gifrqs
>> >> >>>>> ;write as freqs to another table
>> >> >>>>>         kres tablei kindex, gifrqs
>> >> >>>>>         kindex = kindex + 1
>> >> >>>>> if (kindex < imageh) kgoto loop
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>
>> >> >>>>> --
>> >> >>>>> View this message in context:
>> >> >>>>> http://csound.1045644.n5.nabble.com/no-looping-tp5746506.html
>> >> >>>>> Sent from the Csound - General mailing list archive at
>> >> >>>>> Nabble.com.
>> >> >>>>>
>> >> >>>>> Csound mailing list
>> >> >>>>> Csound@listserv.heanet.ie
>> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>>>> Send bugs reports to
>> >> >>>>>         https://github.com/csound/csound/issues
>> >> >>>>> Discussions of bugs and features can be posted here
>> >> >>>>
>> >> >>>> Csound mailing list
>> >> >>>> Csound@listserv.heanet.ie
>> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >>>> Send bugs reports to
>> >> >>>>         https://github.com/csound/csound/issues
>> >> >>>> Discussions of bugs and features can be posted here
>> >> >>
>> >> >> Csound mailing list
>> >> >> Csound@listserv.heanet.ie
>> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >> Send bugs reports to
>> >> >>         https://github.com/csound/csound/issues
>> >> >> Discussions of bugs and features can be posted here
>> >> >
>> >> > Csound mailing list
>> >> > Csound@listserv.heanet.ie
>> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> > Send bugs reports to
>> >> >         https://github.com/csound/csound/issues
>> >> > Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list
>> >> Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> Send bugs reports to
>> >>         https://github.com/csound/csound/issues
>> >> Discussions of bugs and features can be posted here
>> >
>> >
>> > Csound mailing list Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features
>> > can
>> > be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-01-26 18:44
FromSteven Yi
SubjectRe: no looping
Thanks for sharing the video, great to see how others are working with Csound!

On Mon, Jan 25, 2016 at 12:09 PM, thorin kerr  wrote:
> Hi Steven
>
> Functional tools like apply would be fantastic.
> Also, the ability to pass opcodes/functions as arguments (to more
> opcodes/functions).
>
> ... while I'm here... again... here's some more code, using in-line arrays
> as arguments.
>
> This time, I've live coded it. The example is here:
> https://vimeo.com/152973336
>
> Thorin
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Tue, Jan 26, 2016 at 2:42 AM, Steven Yi  wrote:
>>
>> Hi Thorin,
>>
>> Thanks for sharing that. I still prefer to avoid gotos/labels myself,
>> but the posted code is certainly clear to me and I can see why you'd
>> prefer that style too.  Like you said, different tastes. :)
>>
>> One thing about the example is that it makes me think we should look
>> at implementing a few functional programming approaches to array/list
>> processing (particularly an apply operator, in-line lambdas as UDO's,
>> a more generic map opcode).  That might simplify the event generation
>> code there.  Something to think about for CS7.
>>
>> steven
>>
>>
>>
>> On Fri, Jan 22, 2016 at 12:26 AM, thorin kerr 
>> wrote:
>> > OK, while I'm here, I'll share some code... it mixes all of the above,
>> > and
>> > has a ckgoto
>> >
>> > I'm not being argumentative. It really is just a matter of taste. I just
>> > felt like an excuse to share some code.
>> >
>> > opcode chordal, 0, k[]k[]opO
>> > ;quick chords. koriginal holds the pfields on an event. (limit of 10
>> > pfields)
>> > ;koriginal is an array, holding pfields for an event
>> > ;kintervals specifies concurrant pitches with that event.
>> > ;idur specifies durations of the new events
>> > ;iampfac is a multiplier for p4 (assumed to be amplitude)
>> > ;uses cpstun for pitches, with scale specified by kscale (defaults to
>> > gi_CurrentScale)
>> > koriginal[],kintervals[],idur,iampfac,kscale xin
>> >   kndx      init      0
>> >   konce     init      0
>> >
>> >   ckgoto    (konce == 1), terminate     ; one pass
>> >
>> >   kscale    =  (kscale == 0 ? gi_CurrentScale : kscale)
>> >   kpitval init 0
>> >   ilen lenarray kintervals
>> >   iplen lenarray koriginal
>> >
>> >   kdur    =  (idur == 0 ? koriginal[2] : idur)
>> >
>> >   until     (kndx >= ilen) do
>> >     kpitval   =  koriginal[4] + kintervals[kndx]
>> >     if (iplen == 5) then
>> >       event     "i", koriginal[0], tempodur_k(koriginal[1]),
>> > tempodur_k(kdur), koriginal[3]*iampfac,\
>> >                       cpstun(1,kpitval,kscale)
>> >     elseif (iplen == 6) then
>> >       event     "i", koriginal[0], tempodur_k(koriginal[1]),
>> > tempodur_k(kdur), koriginal[3]*iampfac,\
>> >                       cpstun(1,kpitval,kscale), koriginal[5]
>> >     elseif (iplen == 7) then
>> >       event     "i", koriginal[0], tempodur_k(koriginal[1]),
>> > tempodur_k(kdur), koriginal[3]*iampfac,\
>> >                       cpstun(1,kpitval,kscale), koriginal[5],
>> > koriginal[6]
>> >     elseif (iplen == 8) then
>> >       event     "i", koriginal[0], tempodur_k(koriginal[1]),
>> > tempodur_k(kdur), koriginal[3]*iampfac,\
>> >                       cpstun(1,kpitval,kscale), koriginal[5],
>> > koriginal[6],
>> > koriginal[7]
>> >     elseif (iplen == 9) then
>> >       event     "i", koriginal[0], tempodur_k(koriginal[1]),
>> > tempodur_k(kdur), koriginal[3]*iampfac,\
>> >                       cpstun(1,kpitval,kscale), koriginal[5],
>> > koriginal[6],
>> > koriginal[7], koriginal[8]
>> >     elseif (iplen == 10) then
>> >       event     "i", koriginal[0], tempodur_k(koriginal[1]),
>> > tempodur_k(kdur), koriginal[3]*iampfac,\
>> >                       cpstun(1,kpitval,kscale), koriginal[5],
>> > koriginal[6],
>> > koriginal[7], koriginal[8], koriginal[9]
>> >     endif
>> >
>> >   kndx      +=        1
>> >   od
>> >
>> >   konce = 1
>> >   terminate:
>> > endop
>> >
>> >
>> > ;Can be used in an instrument like this. Fires instrument 1 chords,
>> > every 2
>> > seconds.
>> >
>> > instr 10
>> >
>> > chordal array(1, 0, 2, 0.5, 0), array(0,2,4,8,10, -7, -14)
>> >
>> > schedule p1, 2, 1, p4 + 1
>> > turnoff
>> > endin
>> >
>> > instr 1
>> > ares fmrhode p4, p5, 3, 2, 0.3, 3, -1, -1, -1, -1, -1
>> > outs ares, ares
>> > endin
>> >
>> >
>> >
>> >
>> > On Fri, Jan 22, 2016 at 2:07 PM, Steven Yi  wrote:
>> >>
>> >> I don't really think of Csound as being all that peculiar. ;)
>> >>
>> >> For my own code, I tend to use init-time code (e.g., use event_i
>> >> instead of event) and turnoff rather than do a single k-rate pass.
>> >> Even then, you could use turnoff at perf-time for an early exit with a
>> >> conditional block:
>> >>
>> >> kcount init 0
>> >> if (kcount == 1) then
>> >>   turnoff  ;; early exit, done on 2nd k-pass
>> >> endif
>> >>
>> >> ... krate stuff ...
>> >> kcount += 1
>> >>
>> >> For example, this instrument:
>> >>
>> >> instr 1
>> >> kcount init 0
>> >>
>> >> printk2 kcount
>> >>
>> >> if (kcount == 1) then
>> >>   turnoff
>> >> endif
>> >> kcount += 1
>> >> printk2 kcount, 2
>> >>
>> >> endin
>> >>
>> >> produces:
>> >>
>> >>  i1     0.00000
>> >>  i1       1.00000
>> >>  i1     1.00000
>> >>
>> >> before it exits. I personally think the if-statement is a bit clearer
>> >> on the intention of the code than the ckgoto version.  It's a little
>> >> more verbose but removes the use of a label to look for and keep track
>> >> of, which is worth the trade off for my tastes.
>> >>
>> >>
>> >>
>> >> On Thu, Jan 21, 2016 at 10:15 PM, thorin kerr 
>> >> wrote:
>> >> > Yes.... but.... Csound is peculiar.
>> >> > For example, I use ckgoto a lot to do stuff on a single control pass,
>> >> > which
>> >> > I think is more useful than stuffing it all into a conditional block.
>> >> >
>> >> > konce init 0
>> >> > ckgoto (konce == 1), terminate
>> >> >
>> >> > ... krate stuff, usually on arrays or k-rate opcodes like event
>> >> >
>> >> > konce = 1
>> >> >
>> >> > terminate:
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > On Fri, Jan 22, 2016 at 7:04 AM, Steven Yi 
>> >> > wrote:
>> >> >>
>> >> >> Hi Kevin,
>> >> >>
>> >> >> Using until-loops will compile down to gotos and labels and the
>> >> >> loops
>> >> >> will process each value per k-rate loop and is as efficient as using
>> >> >> gotos and labels directly. Usage of until-loops is for clarity and
>> >> >> falls under the category of "control structures" within "structured
>> >> >> programming" (see [1] for background info). Dijkstra's [2] argument
>> >> >> against gotos and Knuth's [3] discussion of it and structured
>> >> >> programming are worthwhile reads, IMO, to get an idea of what
>> >> >> happened
>> >> >> from the early days of programming as programming language design
>> >> >> evolved.  I think all of the same arguments against gotos/labels
>> >> >> still
>> >> >> apply to Csound programming today.
>> >> >>
>> >> >> For my own Csound programming, since the introduction of if-then in
>> >> >> CS
>> >> >> 4.23 and until- and while-loops in CS5/6, I have not had a need for
>> >> >> labels and gotos anymore. I'd generally encourage others to stop
>> >> >> using
>> >> >> gotos/labels as well.
>> >> >>
>> >> >> steven
>> >> >>
>> >> >> [1] - https://en.wikipedia.org/wiki/Structured_programming
>> >> >> [2] -
>> >> >>
>> >> >>
>> >> >> http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html
>> >> >> [3] -
>> >> >>
>> >> >> http://www.cs.sjsu.edu/~mak/CS185C/KnuthStructuredProgrammingGoTo.pdf
>> >> >>
>> >> >> On Thu, Jan 21, 2016 at 2:33 PM, Kevin Welsh 
>> >> >> wrote:
>> >> >> > Steven, is there a performance reason until is preferred over
>> >> >> > if/goto
>> >> >> > or cggoto?  I haven't tested it, but I believe in Menno's case
>> >> >> > (from
>> >> >> > having looked at the imageplayer before) he needs k-rate loops
>> >> >> > operating more than one pass per control rate.  Does using until
>> >> >> > achieve this too?
>> >> >> >
>> >> >> > Sorry if they're stupid questions... as evidenced by my last
>> >> >> > thread
>> >> >> > about loops and my replies to Rory's thread about loops, it's
>> >> >> > probably
>> >> >> > obvious looping in k-rate is fairly new to me.
>> >> >> >
>> >> >> > On Thu, Jan 21, 2016 at 1:20 PM, Steven Yi 
>> >> >> > wrote:
>> >> >> >> Sorry, I realized I should have added increments, so the basic
>> >> >> >> form
>> >> >> >> should be:
>> >> >> >>
>> >> >> >> kx = 0
>> >> >> >>
>> >> >> >> until (kx >= imaxX) do
>> >> >> >>   ky = 0
>> >> >> >>   until (ky >= imaxY) do
>> >> >> >>     ... do code ...
>> >> >> >>     ky += 1
>> >> >> >>   od
>> >> >> >>   kx += 1
>> >> >> >> od
>> >> >> >>
>> >> >> >> On Thu, Jan 21, 2016 at 10:44 AM, Steven Yi 
>> >> >> >> wrote:
>> >> >> >>> I haven't looked at the code in depth, but in general for this
>> >> >> >>> kind
>> >> >> >>> of
>> >> >> >>> 2-dimensional data, I think it'd be more common to use nested
>> >> >> >>> loops,
>> >> >> >>> i.e.:
>> >> >> >>>
>> >> >> >>> kx = 0
>> >> >> >>>
>> >> >> >>> until (kx >= imaxX) do
>> >> >> >>>   ky = 0
>> >> >> >>>   until (ky >= imaxY) do
>> >> >> >>>   ... do code ...
>> >> >> >>>   od
>> >> >> >>> od
>> >> >> >>>
>> >> >> >>> That should read as "for each x location, read each y location
>> >> >> >>> and
>> >> >> >>> "do
>> >> >> >>> code". I would also suggest using the until-looping structure
>> >> >> >>> over
>> >> >> >>> goto's of any sort.
>> >> >> >>>
>> >> >> >>>
>> >> >> >>> On Thu, Jan 21, 2016 at 6:05 AM, Kevin Welsh 
>> >> >> >>> wrote:
>> >> >> >>>> Hello Menno,
>> >> >> >>>>
>> >> >> >>>> I had taken a look at your imageplayer instrument a month or
>> >> >> >>>> two
>> >> >> >>>> ago
>> >> >> >>>> when I was considering "porting" it to cabbage.  I noticed it
>> >> >> >>>> wasn't
>> >> >> >>>> looping on the y axis as well, so I had taken a crack at
>> >> >> >>>> re-writing
>> >> >> >>>> it.  I've been way too busy with life to really put too much
>> >> >> >>>> effort
>> >> >> >>>> into continuing the imageplayer port, I'm hoping I'll get more
>> >> >> >>>> free
>> >> >> >>>> time soon to work on it.
>> >> >> >>>>
>> >> >> >>>> This loop snippet starts both X and Y at 0, reads the data
>> >> >> >>>> (insert
>> >> >> >>>> your own code for this where the comment is in the middle),
>> >> >> >>>> increments
>> >> >> >>>> X, returns to the "loopx" label to read again as long as it
>> >> >> >>>> hasn't
>> >> >> >>>> reached maxX, in which case is continues... increments y, and
>> >> >> >>>> returns
>> >> >> >>>> to loopy label which in turn resets X to 0 to start reading the
>> >> >> >>>> next
>> >> >> >>>> row.  This continues until Y reaches it's max as well.
>> >> >> >>>>
>> >> >> >>>> The code can't be copy/pasted right in as a replacement, but it
>> >> >> >>>> hopefully it gives you an idea to get you moving forward.
>> >> >> >>>>
>> >> >> >>>>   iimage imageload Sfile
>> >> >> >>>>   imaxX, imaxY imagesize iimage
>> >> >> >>>>
>> >> >> >>>>   kxindex init 0
>> >> >> >>>>   kyindex init 0
>> >> >> >>>>
>> >> >> >>>>   loopy:
>> >> >> >>>>     kxindex = 0
>> >> >> >>>>   loopx:
>> >> >> >>>>
>> >> >> >>>> ;    imagegetpixel and the rest of what you want to do in the
>> >> >> >>>> "meat"
>> >> >> >>>> of the loop goes here
>> >> >> >>>>
>> >> >> >>>>     kxindex=kxindex+1
>> >> >> >>>>     cggoto (kxindex> >> >> >>>>     kyindex=kyindex+1
>> >> >> >>>>     cggoto (kyindex> >> >> >>>>
>> >> >> >>>> On Thu, Jan 21, 2016 at 5:26 AM, Menno Knevel
>> >> >> >>>> 
>> >> >> >>>> wrote:
>> >> >> >>>>> Hi,
>> >> >> >>>>> i have an image that i want to convert to sound.
>> >> >> >>>>> 
>> >> >> >>>>> This image example is 100 pixels x 3 pixels.
>> >> >> >>>>>
>> >> >> >>>>> I get it to scan from left to right but not from left to right
>> >> >> >>>>> while
>> >> >> >>>>> scanning the y axis. Somehow my loop is not correct but i
>> >> >> >>>>> don't
>> >> >> >>>>> see
>> >> >> >>>>> how.
>> >> >> >>>>> Perhaps someone can help here?
>> >> >> >>>>>
>> >> >> >>>>> loop:
>> >> >> >>>>>         ky = kindex / imageh
>> >> >> >>>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>> >> >> >>>>> ;printk 0, ky
>> >> >> >>>>> ;printk 0, kblue
>> >> >> >>>>>         printk 0, kindex
>> >> >> >>>>>         tablew (kgreen + kblue)*.5 , kindex, giamps
>> >> >> >>>>> ;write as amps to table
>> >> >> >>>>>         tablew imageh*1000 , kindex, gifrqs
>> >> >> >>>>> ;write as freqs to another table
>> >> >> >>>>>         kres tablei kindex, gifrqs
>> >> >> >>>>>         kindex = kindex + 1
>> >> >> >>>>> if (kindex < imageh) kgoto loop
>> >> >> >>>>>
>> >> >> >>>>> and in a greater context:
>> >> >> >>>>>
>> >> >> >>>>>
>> >> >> >>>>>         instr 1
>> >> >> >>>>>
>> >> >> >>>>> ;===========load
>> >> >> >>>>> image==============================================
>> >> >> >>>>> image imageload
>> >> >> >>>>> "/home/menno/onderzoek/imageopcodes/px3greenblue.png"
>> >> >> >>>>> imagew, imageh imagesize image
>> >> >> >>>>> printf "width and height of image = %d x %d\n", 1, imagew,
>> >> >> >>>>> imageh
>> >> >> >>>>> ;show width and height of image
>> >> >> >>>>>
>> >> >> >>>>> giamps ftgen 0, 0, -imageh, 10, 1
>> >> >> >>>>> gifrqs ftgen 0, 0, imagew, -7, 0, imagew, 2
>> >> >> >>>>>
>> >> >> >>>>> kindex = 1
>> >> >> >>>>> kx linseg 0, p3, 1
>> >> >> >>>>> ;X-axis
>> >> >> >>>>> range
>> >> >> >>>>>
>> >> >> >>>>> loop:
>> >> >> >>>>>         ky = kindex / imageh
>> >> >> >>>>>         kred, kgreen, kblue imagegetpixel image, kx, ky
>> >> >> >>>>> ;printk 0, ky
>> >> >> >>>>> ;printk 0, kblue
>> >> >> >>>>>         printk 0, kindex
>> >> >> >>>>>         tablew (kgreen + kblue)*.5 , kindex, giamps
>> >> >> >>>>> ;write as amps to table
>> >> >> >>>>>         tablew imageh*1000 , kindex, gifrqs
>> >> >> >>>>> ;write as freqs to another table
>> >> >> >>>>>         kres tablei kindex, gifrqs
>> >> >> >>>>>         kindex = kindex + 1
>> >> >> >>>>> if (kindex < imageh) kgoto loop
>> >> >> >>>>>
>> >> >> >>>>>
>> >> >> >>>>>
>> >> >> >>>>> --
>> >> >> >>>>> View this message in context:
>> >> >> >>>>> http://csound.1045644.n5.nabble.com/no-looping-tp5746506.html
>> >> >> >>>>> Sent from the Csound - General mailing list archive at
>> >> >> >>>>> Nabble.com.
>> >> >> >>>>>
>> >> >> >>>>> Csound mailing list
>> >> >> >>>>> Csound@listserv.heanet.ie
>> >> >> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >> >>>>> Send bugs reports to
>> >> >> >>>>>         https://github.com/csound/csound/issues
>> >> >> >>>>> Discussions of bugs and features can be posted here
>> >> >> >>>>
>> >> >> >>>> Csound mailing list
>> >> >> >>>> Csound@listserv.heanet.ie
>> >> >> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >> >>>> Send bugs reports to
>> >> >> >>>>         https://github.com/csound/csound/issues
>> >> >> >>>> Discussions of bugs and features can be posted here
>> >> >> >>
>> >> >> >> Csound mailing list
>> >> >> >> Csound@listserv.heanet.ie
>> >> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >> >> Send bugs reports to
>> >> >> >>         https://github.com/csound/csound/issues
>> >> >> >> Discussions of bugs and features can be posted here
>> >> >> >
>> >> >> > Csound mailing list
>> >> >> > Csound@listserv.heanet.ie
>> >> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >> > Send bugs reports to
>> >> >> >         https://github.com/csound/csound/issues
>> >> >> > Discussions of bugs and features can be posted here
>> >> >>
>> >> >> Csound mailing list
>> >> >> Csound@listserv.heanet.ie
>> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> >> Send bugs reports to
>> >> >>         https://github.com/csound/csound/issues
>> >> >> Discussions of bugs and features can be posted here
>> >> >
>> >> >
>> >> > Csound mailing list Csound@listserv.heanet.ie
>> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> > https://github.com/csound/csound/issues Discussions of bugs and
>> >> > features
>> >> > can
>> >> > be posted here
>> >>
>> >> Csound mailing list
>> >> Csound@listserv.heanet.ie
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >> Send bugs reports to
>> >>         https://github.com/csound/csound/issues
>> >> Discussions of bugs and features can be posted here
>> >
>> >
>> > Csound mailing list Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features
>> > can
>> > be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here