Re: [Csnd] [EXTERNAL] Re: [Csnd] Strtodk won't convert string from OSCraw
Date | 2020-06-10 11:00 |
From | Andreas Bergsland |
Subject | Re: [Csnd] [EXTERNAL] Re: [Csnd] Strtodk won't convert string from OSCraw |
Thanks for filling me in on the background and why it doesn’t work. I found a workaround that solved my problem, to use sprintfk to add a 0 at the end of the string and thereby prevent an empty string (and I guess it also does the same i+k-rate execution): Smess[] init 3 top: Smess,ka OSCraw 6160 kn = 0 ktrig init 0 while kn < ka do if strcmpk(Smess[kn],"/player/0/activity/normal/body/all")==0 then printf "%s\n", ktrig, Smess[kn+2] klen strlenk Smess[kn+2] if klen > 0 then Sfloat sprintfk "%s0", Smess[kn+2] kval strtodk Sfloat endif endif kn += 1 ktrig += 1 printk2 kval, 20 od printf "%d items\n", ka, kn if ka > 0 kgoto top endin
From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of Victor Lazzarini <Victor.Lazzarini@MU.IE>
you're absolutely right. Strings were hacked into Csound sometime back and we have spent the last fifteen years trying to fix it. I think it's another area that will need another pass and redesign in Csound 7 (further to what we had already done in 6). In particular, these reallocations at perf time have to go.
Prof. Victor Lazzarini Maynooth University Ireland
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 |