Csound Csound-dev Csound-tekno Search About

[Csnd] Question re: while loop not working

Date2023-02-16 09:18
FromScott Daughtrey
Subject[Csnd] Question re: while loop not working
I've set up various other while loops that worked ok. I'm probably doing something silly but: 

instr 1

kTime   init 0
kTime   timeinsts
;    while kTime<10 do
        printk 1, kTime
;    od

endin 


;================================

i1 0 12



works fine. However if I uncomment the loop Csound freezes & has to be restarted. I'm not sure why. Is it possible to have loops that use time as a condition? 

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

Date2023-02-16 09:25
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Question re: while loop not working
you are not updating kTime inside the loop, so you have a never-ending loop. Csound is stuck in the first k-cycle.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 16 Feb 2023, at 09:15, Scott Daughtrey  wrote:
> 
> *Warning*
> 
> This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> 
> I've set up various other while loops that worked ok. I'm probably doing something silly but:
> 
> instr 1
> 
> kTime   init 0
> kTime   timeinsts
> ;    while kTime<10 do
>        printk 1, kTime
> ;    od
> 
> endin
> 
> 
> ;================================
> 
> i1 0 12
> 
> 
> 
> works fine. However if I uncomment the loop Csound freezes & has to be restarted. I'm not sure why. Is it possible to have loops that use time as a condition?
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C872aeea1ecf04423251708db0ffe53e6%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638121357220972595%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ng4FV4rJ47K1V0YQ8SuD0ZOPxzG3ye37hCvfpZGlOZo%3D&reserved=0
> Send bugs reports to
>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C872aeea1ecf04423251708db0ffe53e6%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638121357220972595%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Lg2KCv3dPp6LlHDz8qmfdCZz0ZpSXase2Wu%2B7qrG7fY%3D&reserved=0
> 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