Csound Csound-dev Csound-tekno Search About

[Csnd] Strange behavior of chnget to a string variable

Date2020-11-02 18:24
FromRichard
Subject[Csnd] Strange behavior of chnget to a string variable

Why does the following code does not work: ( in Qt I have widget called "gm", the string only prints '' at the start, but changes are not seen. The kidx works for any change )

<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

; Initialize the global variables.

ksmps = 32

nchnls = 2

0dbfs = 1

gSgm init "blank"

instr 1

kEnv madsr .1, .2, .6, .4

aOut vco2 p5, p4

outs aOut*kEnv, aOut*kEnv

endin

instr 10

gSgm chnget "gm"

prints "'%s'\n",gSgm

;kidx chnget "gm"

;printk2 kidx

endin

</CsInstruments>

<CsScore>

;causes Csound to run for about 7000 years...

f0 z

i10 0 5000

</CsScore>

</CsoundSynthesizer>


Date2020-11-02 18:44
FromEduardo Moguillansky
SubjectRe: [Csnd] Strange behavior of chnget to a string variable

my guess: chnget queries the channel at perf-time, prints prints the content of the S-variable at init-time. Try printsk instead, and test it without any external code

On 02.11.20 19:24, Richard wrote:

Why does the following code does not work: ( in Qt I have widget called "gm", the string only prints '' at the start, but changes are not seen. The kidx works for any change )

<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

; Initialize the global variables.

ksmps = 32

nchnls = 2

0dbfs = 1

gSgm init "blank"

instr 1

kEnv madsr .1, .2, .6, .4

aOut vco2 p5, p4

outs aOut*kEnv, aOut*kEnv

endin

instr 10

gSgm chnget "gm"

prints "'%s'\n",gSgm

;kidx chnget "gm"

;printk2 kidx

endin

</CsInstruments>

<CsScore>

;causes Csound to run for about 7000 years...

f0 z

i10 0 5000

</CsScore>

</CsoundSynthesizer>

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

Date2020-11-02 19:35
Fromjoachim heintz
SubjectRe: [Csnd] Strange behavior of chnget to a string variable
and it might be necessary to declare the string channel in advance:
chn_S "gm", 1


On 02/11/2020 19:44, Eduardo Moguillansky wrote:
> my guess: chnget queries the channel at perf-time, prints prints the 
> content of the S-variable at init-time. Try printsk instead, and test it 
> without any external code
> 
> On 02.11.20 19:24, Richard wrote:
>>
>> Why does the following code does not work: ( in Qt I have widget 
>> called "gm", the string only prints '' at the start, but changes are 
>> not seen. The kidx works for any change )
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> ; Initialize the global variables.
>>
>> ksmps = 32
>>
>> nchnls = 2
>>
>> 0dbfs = 1
>>
>> gSgm init "blank"
>>
>> instr 1
>>
>> kEnv madsr .1, .2, .6, .4
>>
>> aOut vco2 p5, p4
>>
>> outs aOut*kEnv, aOut*kEnv
>>
>> endin
>>
>> instr 10
>>
>> gSgm chnget "gm"
>>
>> prints "'%s'\n",gSgm
>>
>> ;kidx chnget "gm"
>>
>> ;printk2 kidx
>>
>> endin
>>
>> 
>>
>> 
>>
>> ;causes Csound to run for about 7000 years...
>>
>> f0 z
>>
>> i10 0 5000
>>
>> 
>>
>> 
>>
>> 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

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

Date2020-11-03 16:56
FromRichard
SubjectRe: [Csnd] Strange behavior of chnget to a string variable

I tried with

printks "'%s'\n",1, gSgm

Nothing changed, every second the empty string was printed and I changed selection in the widget.

On 02/11/2020 19:44, Eduardo Moguillansky wrote:

my guess: chnget queries the channel at perf-time, prints prints the content of the S-variable at init-time. Try printsk instead, and test it without any external code

On 02.11.20 19:24, Richard wrote:

Why does the following code does not work: ( in Qt I have widget called "gm", the string only prints '' at the start, but changes are not seen. The kidx works for any change )

<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

; Initialize the global variables.

ksmps = 32

nchnls = 2

0dbfs = 1

gSgm init "blank"

instr 1

kEnv madsr .1, .2, .6, .4

aOut vco2 p5, p4

outs aOut*kEnv, aOut*kEnv

endin

instr 10

gSgm chnget "gm"

prints "'%s'\n",gSgm

;kidx chnget "gm"

;printk2 kidx

endin

</CsInstruments>

<CsScore>

;causes Csound to run for about 7000 years...

f0 z

i10 0 5000

</CsScore>

</CsoundSynthesizer>

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

Date2020-11-03 17:00
FromRichard
SubjectRe: [Csnd] Strange behavior of chnget to a string variable
I also tried that, to no avail

I would say there is something wrong with chnget to a string...

I am on OS X now, csound version 6.15


On 02/11/2020 20:35, joachim heintz wrote:
> and it might be necessary to declare the string channel in advance:
> chn_S "gm", 1
>
>
> On 02/11/2020 19:44, Eduardo Moguillansky wrote:
>> my guess: chnget queries the channel at perf-time, prints prints the 
>> content of the S-variable at init-time. Try printsk instead, and test 
>> it without any external code
>>
>> On 02.11.20 19:24, Richard wrote:
>>>
>>> Why does the following code does not work: ( in Qt I have widget 
>>> called "gm", the string only prints '' at the start, but changes are 
>>> not seen. The kidx works for any change )
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> ; Initialize the global variables.
>>>
>>> ksmps = 32
>>>
>>> nchnls = 2
>>>
>>> 0dbfs = 1
>>>
>>> gSgm init "blank"
>>>
>>> instr 1
>>>
>>> kEnv madsr .1, .2, .6, .4
>>>
>>> aOut vco2 p5, p4
>>>
>>> outs aOut*kEnv, aOut*kEnv
>>>
>>> endin
>>>
>>> instr 10
>>>
>>> gSgm chnget "gm"
>>>
>>> prints "'%s'\n",gSgm
>>>
>>> ;kidx chnget "gm"
>>>
>>> ;printk2 kidx
>>>
>>> endin
>>>
>>> 
>>>
>>> 
>>>
>>> ;causes Csound to run for about 7000 years...
>>>
>>> f0 z
>>>
>>> i10 0 5000
>>>
>>> 
>>>
>>> 
>>>
>>> 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
>
> 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

Date2020-11-03 17:53
FromSteven Yi
SubjectRe: [Csnd] Strange behavior of chnget to a string variable
I don't think it's chnget, if you use chnset within Csound it'll work fine:

gSgm init "blank"
chnset gSgm, "gm"

Maybe there's either an issue in CsoundQt with setting channels
(whether a bug or how it's being used in your particular project)?  Do
you have an example that runs with CsoundQt that has the widgets in
the project?

On Tue, Nov 3, 2020 at 12:00 PM Richard  wrote:
>
> I also tried that, to no avail
>
> I would say there is something wrong with chnget to a string...
>
> I am on OS X now, csound version 6.15
>
>
> On 02/11/2020 20:35, joachim heintz wrote:
> > and it might be necessary to declare the string channel in advance:
> > chn_S "gm", 1
> >
> >
> > On 02/11/2020 19:44, Eduardo Moguillansky wrote:
> >> my guess: chnget queries the channel at perf-time, prints prints the
> >> content of the S-variable at init-time. Try printsk instead, and test
> >> it without any external code
> >>
> >> On 02.11.20 19:24, Richard wrote:
> >>>
> >>> Why does the following code does not work: ( in Qt I have widget
> >>> called "gm", the string only prints '' at the start, but changes are
> >>> not seen. The kidx works for any change )
> >>>
> >>> 
> >>>
> >>> 
> >>>
> >>> 
> >>>
> >>> 
> >>>
> >>> ; Initialize the global variables.
> >>>
> >>> ksmps = 32
> >>>
> >>> nchnls = 2
> >>>
> >>> 0dbfs = 1
> >>>
> >>> gSgm init "blank"
> >>>
> >>> instr 1
> >>>
> >>> kEnv madsr .1, .2, .6, .4
> >>>
> >>> aOut vco2 p5, p4
> >>>
> >>> outs aOut*kEnv, aOut*kEnv
> >>>
> >>> endin
> >>>
> >>> instr 10
> >>>
> >>> gSgm chnget "gm"
> >>>
> >>> prints "'%s'\n",gSgm
> >>>
> >>> ;kidx chnget "gm"
> >>>
> >>> ;printk2 kidx
> >>>
> >>> endin
> >>>
> >>> 
> >>>
> >>> 
> >>>
> >>> ;causes Csound to run for about 7000 years...
> >>>
> >>> f0 z
> >>>
> >>> i10 0 5000
> >>>
> >>> 
> >>>
> >>> 
> >>>
> >>> 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
> >
> > 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

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

Date2020-11-03 18:18
Fromjoachim heintz
SubjectRe: [Csnd] Strange behavior of chnget to a string variable
i think you are right.  chnget is only reading the string at init-time 
(at least in csoundqt with a widget).  using invalue instead works for me.


On 03/11/2020 18:00, Richard wrote:
> I also tried that, to no avail
> 
> I would say there is something wrong with chnget to a string...
> 
> I am on OS X now, csound version 6.15
> 
> 
> On 02/11/2020 20:35, joachim heintz wrote:
>> and it might be necessary to declare the string channel in advance:
>> chn_S "gm", 1
>>
>>
>> On 02/11/2020 19:44, Eduardo Moguillansky wrote:
>>> my guess: chnget queries the channel at perf-time, prints prints the 
>>> content of the S-variable at init-time. Try printsk instead, and test 
>>> it without any external code
>>>
>>> On 02.11.20 19:24, Richard wrote:
>>>>
>>>> Why does the following code does not work: ( in Qt I have widget 
>>>> called "gm", the string only prints '' at the start, but changes are 
>>>> not seen. The kidx works for any change )
>>>>
>>>> 
>>>>
>>>> 
>>>>
>>>> 
>>>>
>>>> 
>>>>
>>>> ; Initialize the global variables.
>>>>
>>>> ksmps = 32
>>>>
>>>> nchnls = 2
>>>>
>>>> 0dbfs = 1
>>>>
>>>> gSgm init "blank"
>>>>
>>>> instr 1
>>>>
>>>> kEnv madsr .1, .2, .6, .4
>>>>
>>>> aOut vco2 p5, p4
>>>>
>>>> outs aOut*kEnv, aOut*kEnv
>>>>
>>>> endin
>>>>
>>>> instr 10
>>>>
>>>> gSgm chnget "gm"
>>>>
>>>> prints "'%s'\n",gSgm
>>>>
>>>> ;kidx chnget "gm"
>>>>
>>>> ;printk2 kidx
>>>>
>>>> endin
>>>>
>>>> 
>>>>
>>>> 
>>>>
>>>> ;causes Csound to run for about 7000 years...
>>>>
>>>> f0 z
>>>>
>>>> i10 0 5000
>>>>
>>>> 
>>>>
>>>> 
>>>>
>>>> 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
>>
>> 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

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

Date2020-11-03 18:38
FromEduardo Moguillansky
SubjectRe: [Csnd] Strange behavior of chnget to a string variable
On 03.11.20 18:53, Steven Yi wrote:
> I don't think it's chnget, if you use chnset within Csound it'll work fine:
>
> gSgm init "blank"
> chnset gSgm, "gm"
>
> Maybe there's either an issue in CsoundQt with setting channels
> (whether a bug or how it's being used in your particular project)?  Do
> you have an example that runs with CsoundQt that has the widgets in
> the project?

The OP did not mention using csoundqt.

>
> On Tue, Nov 3, 2020 at 12:00 PM Richard  wrote:
>> I also tried that, to no avail
>>
>> I would say there is something wrong with chnget to a string...
>>
>> I am on OS X now, csound version 6.15
>>
>>
>> On 02/11/2020 20:35, joachim heintz wrote:
>>> and it might be necessary to declare the string channel in advance:
>>> chn_S "gm", 1
>>>
>>>
>>> On 02/11/2020 19:44, Eduardo Moguillansky wrote:
>>>> my guess: chnget queries the channel at perf-time, prints prints the
>>>> content of the S-variable at init-time. Try printsk instead, and test
>>>> it without any external code
>>>>
>>>> On 02.11.20 19:24, Richard wrote:
>>>>> Why does the following code does not work: ( in Qt I have widget
>>>>> called "gm", the string only prints '' at the start, but changes are
>>>>> not seen. The kidx works for any change )
>>>>>
>>>>> 
>>>>>
>>>>> 
>>>>>
>>>>> 
>>>>>
>>>>> 
>>>>>
>>>>> ; Initialize the global variables.
>>>>>
>>>>> ksmps = 32
>>>>>
>>>>> nchnls = 2
>>>>>
>>>>> 0dbfs = 1
>>>>>
>>>>> gSgm init "blank"
>>>>>
>>>>> instr 1
>>>>>
>>>>> kEnv madsr .1, .2, .6, .4
>>>>>
>>>>> aOut vco2 p5, p4
>>>>>
>>>>> outs aOut*kEnv, aOut*kEnv
>>>>>
>>>>> endin
>>>>>
>>>>> instr 10
>>>>>
>>>>> gSgm chnget "gm"
>>>>>
>>>>> prints "'%s'\n",gSgm
>>>>>
>>>>> ;kidx chnget "gm"
>>>>>
>>>>> ;printk2 kidx
>>>>>
>>>>> endin
>>>>>
>>>>> 
>>>>>
>>>>> 
>>>>>
>>>>> ;causes Csound to run for about 7000 years...
>>>>>
>>>>> f0 z
>>>>>
>>>>> i10 0 5000
>>>>>
>>>>> 
>>>>>
>>>>> 
>>>>>
>>>>> 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
>>> 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
> 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

Date2020-11-03 18:38
FromRichard
SubjectRe: [Csnd] Strange behavior of chnget to a string variable
AttachmentschngetStr.csd  
Here's the csd with widgets..

On 03/11/2020 18:53, Steven Yi wrote:
> I don't think it's chnget, if you use chnset within Csound it'll work fine:
>
> gSgm init "blank"
> chnset gSgm, "gm"
>
> Maybe there's either an issue in CsoundQt with setting channels
> (whether a bug or how it's being used in your particular project)?  Do
> you have an example that runs with CsoundQt that has the widgets in
> the project?
>
> On Tue, Nov 3, 2020 at 12:00 PM Richard  wrote:
>> I also tried that, to no avail
>>
>> I would say there is something wrong with chnget to a string...
>>
>> I am on OS X now, csound version 6.15
>>
>>
>> On 02/11/2020 20:35, joachim heintz wrote:
>>> and it might be necessary to declare the string channel in advance:
>>> chn_S "gm", 1
>>>
>>>
>>> On 02/11/2020 19:44, Eduardo Moguillansky wrote:
>>>> my guess: chnget queries the channel at perf-time, prints prints the
>>>> content of the S-variable at init-time. Try printsk instead, and test
>>>> it without any external code
>>>>
>>>> On 02.11.20 19:24, Richard wrote:
>>>>> Why does the following code does not work: ( in Qt I have widget
>>>>> called "gm", the string only prints '' at the start, but changes are
>>>>> not seen. The kidx works for any change )
>>>>>
>>>>> 
>>>>>
>>>>> 
>>>>>
>>>>> 
>>>>>
>>>>> 
>>>>>
>>>>> ; Initialize the global variables.
>>>>>
>>>>> ksmps = 32
>>>>>
>>>>> nchnls = 2
>>>>>
>>>>> 0dbfs = 1
>>>>>
>>>>> gSgm init "blank"
>>>>>
>>>>> instr 1
>>>>>
>>>>> kEnv madsr .1, .2, .6, .4
>>>>>
>>>>> aOut vco2 p5, p4
>>>>>
>>>>> outs aOut*kEnv, aOut*kEnv
>>>>>
>>>>> endin
>>>>>
>>>>> instr 10
>>>>>
>>>>> gSgm chnget "gm"
>>>>>
>>>>> prints "'%s'\n",gSgm
>>>>>
>>>>> ;kidx chnget "gm"
>>>>>
>>>>> ;printk2 kidx
>>>>>
>>>>> endin
>>>>>
>>>>> 
>>>>>
>>>>> 
>>>>>
>>>>> ;causes Csound to run for about 7000 years...
>>>>>
>>>>> f0 z
>>>>>
>>>>> i10 0 5000
>>>>>
>>>>> 
>>>>>
>>>>> 
>>>>>
>>>>> 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
>>> 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
> 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

Date2020-11-03 18:44
FromRichard
SubjectRe: [Csnd] Strange behavior of chnget to a string variable
invalue did not work for me either...

On 03/11/2020 19:18, joachim heintz wrote:
> i think you are right.  chnget is only reading the string at init-time 
> (at least in csoundqt with a widget).  using invalue instead works for 
> me.
>
>
> On 03/11/2020 18:00, Richard wrote:
>> I also tried that, to no avail
>>
>> I would say there is something wrong with chnget to a string...
>>
>> I am on OS X now, csound version 6.15
>>
>>
>> On 02/11/2020 20:35, joachim heintz wrote:
>>> and it might be necessary to declare the string channel in advance:
>>> chn_S "gm", 1
>>>
>>>
>>> On 02/11/2020 19:44, Eduardo Moguillansky wrote:
>>>> my guess: chnget queries the channel at perf-time, prints prints 
>>>> the content of the S-variable at init-time. Try printsk instead, 
>>>> and test it without any external code
>>>>
>>>> On 02.11.20 19:24, Richard wrote:
>>>>>
>>>>> Why does the following code does not work: ( in Qt I have widget 
>>>>> called "gm", the string only prints '' at the start, but changes 
>>>>> are not seen. The kidx works for any change )
>>>>>
>>>>> 
>>>>>
>>>>> 
>>>>>
>>>>> 
>>>>>
>>>>> 
>>>>>
>>>>> ; Initialize the global variables.
>>>>>
>>>>> ksmps = 32
>>>>>
>>>>> nchnls = 2
>>>>>
>>>>> 0dbfs = 1
>>>>>
>>>>> gSgm init "blank"
>>>>>
>>>>> instr 1
>>>>>
>>>>> kEnv madsr .1, .2, .6, .4
>>>>>
>>>>> aOut vco2 p5, p4
>>>>>
>>>>> outs aOut*kEnv, aOut*kEnv
>>>>>
>>>>> endin
>>>>>
>>>>> instr 10
>>>>>
>>>>> gSgm chnget "gm"
>>>>>
>>>>> prints "'%s'\n",gSgm
>>>>>
>>>>> ;kidx chnget "gm"
>>>>>
>>>>> ;printk2 kidx
>>>>>
>>>>> endin
>>>>>
>>>>> 
>>>>>
>>>>> 
>>>>>
>>>>> ;causes Csound to run for about 7000 years...
>>>>>
>>>>> f0 z
>>>>>
>>>>> i10 0 5000
>>>>>
>>>>> 
>>>>>
>>>>> 
>>>>>
>>>>> 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
>>>
>>> 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
>
> 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

Date2020-11-03 18:47
FromRichard
SubjectRe: [Csnd] Strange behavior of chnget to a string variable

I am sorry, but I think this was clear enough when I wrote: in Qt I have widget called "gm"

On 03/11/2020 19:38, Eduardo Moguillansky wrote:
On 03.11.20 18:53, Steven Yi wrote:
I don't think it's chnget, if you use chnset within Csound it'll work fine:

gSgm init "blank"
chnset gSgm, "gm"

Maybe there's either an issue in CsoundQt with setting channels
(whether a bug or how it's being used in your particular project)?  Do
you have an example that runs with CsoundQt that has the widgets in
the project?

The OP did not mention using csoundqt.


On Tue, Nov 3, 2020 at 12:00 PM Richard <zappfinger@gmail.com> wrote:
I also tried that, to no avail

I would say there is something wrong with chnget to a string...

I am on OS X now, csound version 6.15


On 02/11/2020 20:35, joachim heintz wrote:
and it might be necessary to declare the string channel in advance:
chn_S "gm", 1


On 02/11/2020 19:44, Eduardo Moguillansky wrote:
my guess: chnget queries the channel at perf-time, prints prints the
content of the S-variable at init-time. Try printsk instead, and test
it without any external code

On 02.11.20 19:24, Richard wrote:
Why does the following code does not work: ( in Qt I have widget
called "gm", the string only prints '' at the start, but changes are
not seen. The kidx works for any change )

<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

; Initialize the global variables.

ksmps = 32

nchnls = 2

0dbfs = 1

gSgm init "blank"

instr 1

kEnv madsr .1, .2, .6, .4

aOut vco2 p5, p4

outs aOut*kEnv, aOut*kEnv

endin

instr 10

gSgm chnget "gm"

prints "'%s'\n",gSgm

;kidx chnget "gm"

;printk2 kidx

endin

</CsInstruments>

<CsScore>

;causes Csound to run for about 7000 years...

f0 z

i10 0 5000

</CsScore>

</CsoundSynthesizer>

Csound mailing list Csound@listserv.heanet.ie
<mailto: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
<mailto: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
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

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

Date2020-11-03 19:10
FromSteven Yi
SubjectRe: [Csnd] Strange behavior of chnget to a string variable
I think it might be a misunderstanding of how the menu widget works in
CsoundQt. I see the information mentioned at:

https://csoundqt.github.io/pages/widgets.html

That it just sends an index value and not the string. I didn't see any
options in the widget properties to send string values either.  (That
all said, I don't use CsoundQt so someone else could provide better
feedback.)

On Tue, Nov 3, 2020 at 1:38 PM Richard  wrote:
>
> Here's the csd with widgets..
>
> On 03/11/2020 18:53, Steven Yi wrote:
> > I don't think it's chnget, if you use chnset within Csound it'll work fine:
> >
> > gSgm init "blank"
> > chnset gSgm, "gm"
> >
> > Maybe there's either an issue in CsoundQt with setting channels
> > (whether a bug or how it's being used in your particular project)?  Do
> > you have an example that runs with CsoundQt that has the widgets in
> > the project?
> >
> > On Tue, Nov 3, 2020 at 12:00 PM Richard  wrote:
> >> I also tried that, to no avail
> >>
> >> I would say there is something wrong with chnget to a string...
> >>
> >> I am on OS X now, csound version 6.15
> >>
> >>
> >> On 02/11/2020 20:35, joachim heintz wrote:
> >>> and it might be necessary to declare the string channel in advance:
> >>> chn_S "gm", 1
> >>>
> >>>
> >>> On 02/11/2020 19:44, Eduardo Moguillansky wrote:
> >>>> my guess: chnget queries the channel at perf-time, prints prints the
> >>>> content of the S-variable at init-time. Try printsk instead, and test
> >>>> it without any external code
> >>>>
> >>>> On 02.11.20 19:24, Richard wrote:
> >>>>> Why does the following code does not work: ( in Qt I have widget
> >>>>> called "gm", the string only prints '' at the start, but changes are
> >>>>> not seen. The kidx works for any change )
> >>>>>
> >>>>> 
> >>>>>
> >>>>> 
> >>>>>
> >>>>> 
> >>>>>
> >>>>> 
> >>>>>
> >>>>> ; Initialize the global variables.
> >>>>>
> >>>>> ksmps = 32
> >>>>>
> >>>>> nchnls = 2
> >>>>>
> >>>>> 0dbfs = 1
> >>>>>
> >>>>> gSgm init "blank"
> >>>>>
> >>>>> instr 1
> >>>>>
> >>>>> kEnv madsr .1, .2, .6, .4
> >>>>>
> >>>>> aOut vco2 p5, p4
> >>>>>
> >>>>> outs aOut*kEnv, aOut*kEnv
> >>>>>
> >>>>> endin
> >>>>>
> >>>>> instr 10
> >>>>>
> >>>>> gSgm chnget "gm"
> >>>>>
> >>>>> prints "'%s'\n",gSgm
> >>>>>
> >>>>> ;kidx chnget "gm"
> >>>>>
> >>>>> ;printk2 kidx
> >>>>>
> >>>>> endin
> >>>>>
> >>>>> 
> >>>>>
> >>>>> 
> >>>>>
> >>>>> ;causes Csound to run for about 7000 years...
> >>>>>
> >>>>> f0 z
> >>>>>
> >>>>> i10 0 5000
> >>>>>
> >>>>> 
> >>>>>
> >>>>> 
> >>>>>
> >>>>> 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
> >>> 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
> > 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

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

Date2020-11-03 19:21
Fromjoachim heintz
SubjectRe: [Csnd] Strange behavior of chnget to a string variable
right.  the menu widget will not at all send a string.  so this is solved.

the comparison i mentioned between chnget:S and invalue in csoundqt was 
with a line edit widget.  i think only invalue is updating the string if 
changed during performance.


On 03/11/2020 20:10, Steven Yi wrote:
> I think it might be a misunderstanding of how the menu widget works in
> CsoundQt. I see the information mentioned at:
> 
> https://csoundqt.github.io/pages/widgets.html
> 
> That it just sends an index value and not the string. I didn't see any
> options in the widget properties to send string values either.  (That
> all said, I don't use CsoundQt so someone else could provide better
> feedback.)
> 
> On Tue, Nov 3, 2020 at 1:38 PM Richard  wrote:
>>
>> Here's the csd with widgets..
>>
>> On 03/11/2020 18:53, Steven Yi wrote:
>>> I don't think it's chnget, if you use chnset within Csound it'll work fine:
>>>
>>> gSgm init "blank"
>>> chnset gSgm, "gm"
>>>
>>> Maybe there's either an issue in CsoundQt with setting channels
>>> (whether a bug or how it's being used in your particular project)?  Do
>>> you have an example that runs with CsoundQt that has the widgets in
>>> the project?
>>>
>>> On Tue, Nov 3, 2020 at 12:00 PM Richard  wrote:
>>>> I also tried that, to no avail
>>>>
>>>> I would say there is something wrong with chnget to a string...
>>>>
>>>> I am on OS X now, csound version 6.15
>>>>
>>>>
>>>> On 02/11/2020 20:35, joachim heintz wrote:
>>>>> and it might be necessary to declare the string channel in advance:
>>>>> chn_S "gm", 1
>>>>>
>>>>>
>>>>> On 02/11/2020 19:44, Eduardo Moguillansky wrote:
>>>>>> my guess: chnget queries the channel at perf-time, prints prints the
>>>>>> content of the S-variable at init-time. Try printsk instead, and test
>>>>>> it without any external code
>>>>>>
>>>>>> On 02.11.20 19:24, Richard wrote:
>>>>>>> Why does the following code does not work: ( in Qt I have widget
>>>>>>> called "gm", the string only prints '' at the start, but changes are
>>>>>>> not seen. The kidx works for any change )
>>>>>>>
>>>>>>> 
>>>>>>>
>>>>>>> 
>>>>>>>
>>>>>>> 
>>>>>>>
>>>>>>> 
>>>>>>>
>>>>>>> ; Initialize the global variables.
>>>>>>>
>>>>>>> ksmps = 32
>>>>>>>
>>>>>>> nchnls = 2
>>>>>>>
>>>>>>> 0dbfs = 1
>>>>>>>
>>>>>>> gSgm init "blank"
>>>>>>>
>>>>>>> instr 1
>>>>>>>
>>>>>>> kEnv madsr .1, .2, .6, .4
>>>>>>>
>>>>>>> aOut vco2 p5, p4
>>>>>>>
>>>>>>> outs aOut*kEnv, aOut*kEnv
>>>>>>>
>>>>>>> endin
>>>>>>>
>>>>>>> instr 10
>>>>>>>
>>>>>>> gSgm chnget "gm"
>>>>>>>
>>>>>>> prints "'%s'\n",gSgm
>>>>>>>
>>>>>>> ;kidx chnget "gm"
>>>>>>>
>>>>>>> ;printk2 kidx
>>>>>>>
>>>>>>> endin
>>>>>>>
>>>>>>> 
>>>>>>>
>>>>>>> 
>>>>>>>
>>>>>>> ;causes Csound to run for about 7000 years...
>>>>>>>
>>>>>>> f0 z
>>>>>>>
>>>>>>> i10 0 5000
>>>>>>>
>>>>>>> 
>>>>>>>
>>>>>>> 
>>>>>>>
>>>>>>> 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
>>>>> 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
>>> 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
> 
> 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