After a bit of investigation, it seems the problem is not related to strtolk, but to strsubk in Jacopo’s example.
In the following MVCE, the first and last call to strsubk are not working.
Jacopo told me his use case (Sub5 in my example) worked in Csound 6.16.
I don’t know what is exactly the expected behavior. Is it supposed to work with k variables that are not initialized with “init” but only with “=” assignment ?
I’m also thinking it could not be related to strsubk at all, but rather to initialization of k variables with “=” assignment ?
Thanks
-odac
sr = 48000
ksmps = 16
nchnls = 2
0dbfs = 1
instr 1
/* Strsubk should work at init and k */
// Here it does not work at k rate
kbeg = 0
kend = 1
Str = “8”
Sub = strsubk(Str, kbeg, kend)
prints “Sub = %s\n”, Sub
// Here it works with literals
Sub2 = strsubk(Str, 0, 1)
prints “Sub2_literal = %s\n”, Sub2
// Works with init only
ibeg init 0
iend init 1
Sub3 = strsubk(Str, ibeg, iend)
prints “Sub3_i_rate = %s\n”, Sub3
// works with initialized k variables
kbeg2 init 0
kend2 init 1
Sub4 = strsubk(Str, kbeg2, kend2)
prints “Sub4_k_init = %s\n”, Sub4
// Doesn’t work with an initialized variable incremented
Sub5 = strsubk(Str, kbeg2, kbeg2 + 1)
prints “Sub5_K_add = %s\n”, Sub5
endin
i 1 0 25
I looked and strtolk works as expected, and the other string opcodes. I think the issue might be elsewhere. If you have a simple but full example using the UDO that works in 6.16 and not 6.17 we can try to diagnose it,
Prof. Victor Lazzarini
Maynooth University
Ireland
Ok, thank you Victor.
I tried something.. but I cannot figure out why in 6.16 it works and in 6.17 it doesnt!
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=04%7C01%7CVictor.Lazzarini%40mu.ie%7Cc5cda0281e0740fca2b008d9ef003657%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637803606531009616%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=lBTv0Qq56jcRl0scZos%2BhEc1RbSTzcoPDmopXULQ%2FZM%3D&reserved=0
Send bugs reports to
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=04%7C01%7CVictor.Lazzarini%40mu.ie%7Cc5cda0281e0740fca2b008d9ef003657%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637803606531009616%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=5%2BdqjN1wpdsjWHPAEgMQwUDIzanVUIs6QaL%2BavONuoI%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
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