[Csnd] Detecting string change
| Date | 2020-11-22 13:59 |
| From | Richard |
| Subject | [Csnd] Detecting string change |
I am using the following code:
instr 11
Sgm chnget "GM"
kgm changed Sgm
printk2 kgm
if (kgm==1) then
prints "%s", Sgm
endif
endin
When the string changes the output shows that kgm becomes 1, but
immediately becomes 0 again.
Printing of the string in the if block is not executed.
Why?
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 |
| Date | 2020-11-22 14:16 |
| From | Dave Seidel |
| Subject | Re: [Csnd] Detecting string change |
I think because you're using prints, which is I-rate, but it's a k-rate if statement. Try using prints. On Sun, Nov 22, 2020, 8:59 AM Richard <zappfinger@gmail.com> wrote: I am using the following code: |
| Date | 2020-11-22 15:02 |
| From | Richard |
| Subject | Re: [Csnd] Detecting string change |
|
Yes of course. I am using printks now and that works. BTW, it would be nice if printks could also accept -1 for the
itime, indicating that it only prints one time... On 22/11/2020 15:16, Dave Seidel wrote:
|
| Date | 2020-11-22 16:25 |
| From | Richard |
| Subject | Re: [Csnd] Detecting string change |
|
It only works correctly if I put a delay after the chnget other
wise the previous value is printed. It looks like the change after
the chnget comes too soon. instr 11 On 22/11/2020 15:16, Dave Seidel wrote:
|