[Csnd] SetChannel value not received by CSound?
Date | 2020-11-29 06:41 |
From | Jarrad Hope |
Subject | [Csnd] SetChannel value not received by CSound? |
I'm using the c++ api and embedding CSound into a software application. I have been attempting to pass a control parameter to Csound under a channel named "param1", but it is returning 0. However reading the string channel is fine, with the oscillator it also returns expected values over time. Furthermore if I read
csound->GetChannel("param1"), I see the value I set. It's unclear to me what I am doing wrong? //
csound->SetControlChannel("param1", (MYFLT)0.5);
csound->SetChannel("param1", (MYFLT)0.5); csound->PerformKsmps(); char tmp_string[4096] = { 0 }; csound->GetStringChannel("stringChannel", tmp_string); my csd file is something like the following <CsoundSynthesizer> <CsOptions> </CsOptions> <CsInstruments> sr = 44100 ; samplerate ksmps = 512 ; number of samples per control period nchnls = 2 ; number of I/O channels instr 1 kParam chnget "param1" ; kParam oscil 1000, 1 SText sprintfk "param1(\"%d\")", kParam chnset SText, "stringChannel" endin </CsInstruments> <CsScore> i1 0 10000 ; switch on instrument 1 for 10000 seconds ; f0 z ; run for 7000 years? e </CsScore> </CsoundSynthesizer> |
Date | 2020-11-29 08:05 |
From | Eduardo Moguillansky |
Subject | Re: [Csnd] SetChannel value not received by CSound? |
Why do you use %d to receive 0.5? On Sun, Nov 29, 2020, 07:51 Jarrad Hope <me@jarradhope.com> wrote:
|