[Csnd] Strtodk won't convert string from OSCraw
Date | 2020-06-09 20:30 |
From | Andreas Bergsland |
Subject | [Csnd] Strtodk won't convert string from OSCraw |
Hi I am trying to understand how I can use OSCraw to receive floats. I started out from the manual example and can see that OSCraw receives all messages nicely, but when I try to convert my float numbers, I get an error saying INIT ERROR in instr 1 line 16: strtodk: empty string I am on OSX 10.14.6 with Csound 6.14. Best, Andreas instr 1 Smess[] init 3 top: Smess,ka OSCraw 6160 kn = 0 ktrig init 0 while kn < ka do if strcmpk(Smess[kn],"/my/OSC/address")==0 then printf "%s\n", ktrig, Smess[kn+2] klen strlenk Smess[kn+2] if klen > 0 then kval strtodk Smess[kn+2] endif endif kn += 1 ktrig += 1 od ;printf "%d items\n", ka, kn if ka > 0 kgoto top endin -- Andreas Bergsland
Associate professor - førsteamanuensis Study Programme Leader - studieprogramleder Music Technology Programme - Musikkteknologiseksjonen Department of Music - Institutt for musikk Olavskvartalet NTNU (Norwegian University of Science and Technology) 7491 Trondheim, NORWAY
Visiting address/besøksadresse: Fjordgt.1 (3.etg.) e-mail: andreas.bergsland@ntnu.no Office phone (Skype for business):7359 0096 Mobil: 4566 3316 |
Date | 2020-06-09 21:08 |
From | Eduardo Moguillansky |
Subject | Re: [Csnd] Strtodk won't convert string from OSCraw |
This is because strtodk, like many string opcodes, was badly
thought, and executes both at init and k time. So you put your
strtodk very wisely inside an if-clause, but the init part of
strtodk executes nevertheless, to find an empty string. On 09.06.20 21:30, Andreas Bergsland
wrote:
|
Date | 2020-06-10 08:35 |
From | Victor Lazzarini |
Subject | Re: [Csnd] [EXTERNAL] Re: [Csnd] Strtodk won't convert string from OSCraw |
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
On 9 Jun 2020, at 21:09, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:
|