Csound Csound-dev Csound-tekno Search About

[Csnd] initialize channel variables

Date2017-12-24 13:39
FromRichard
Subject[Csnd] initialize channel variables
I always struggle with this: how to initialize a variable that gets a 
value via chnget?

Say:

         ktempo init     120

         ktempo chnget "tempo"

In my experience, when there is no value coming via chnget, the value of 
ktempo is 0

Richard

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

Date2017-12-24 14:39
FromRory Walsh
SubjectRe: [Csnd] initialize channel variables
Can you use chnset instead of init? 

On 24 December 2017 at 13:39, Richard <zappfinger@gmail.com> wrote:
I always struggle with this: how to initialize a variable that gets a value via chnget?

Say:

        ktempo init     120

        ktempo chnget "tempo"

In my experience, when there is no value coming via chnget, the value of ktempo is 0

Richard

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

Date2017-12-24 15:07
FromRichard
SubjectRe: [Csnd] initialize channel variables

I have a csd controlled by some sliders, so I have to use chnget.
The csd only starts to work when I have moved all the sliders, since init apparenly gets 'overruled' by chnget...

Richard


On 24/12/17 15:39, Rory Walsh wrote:
Can you use chnset instead of init? 

On 24 December 2017 at 13:39, Richard <zappfinger@gmail.com> wrote:
I always struggle with this: how to initialize a variable that gets a value via chnget?

Say:

        ktempo init     120

        ktempo chnget "tempo"

In my experience, when there is no value coming via chnget, the value of ktempo is 0

Richard

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


Date2017-12-24 15:10
FromRory Walsh
SubjectRe: [Csnd] initialize channel variables
I'm not suggesting you don't use chnget, but use chnset instead of init. That will set the initial value of the channel until it's overwritten by some slider movement.    

On 24 December 2017 at 15:07, Richard <zappfinger@gmail.com> wrote:

I have a csd controlled by some sliders, so I have to use chnget.
The csd only starts to work when I have moved all the sliders, since init apparenly gets 'overruled' by chnget...

Richard


On 24/12/17 15:39, Rory Walsh wrote:
Can you use chnset instead of init? 

On 24 December 2017 at 13:39, Richard <zappfinger@gmail.com> wrote:
I always struggle with this: how to initialize a variable that gets a value via chnget?

Say:

        ktempo init     120

        ktempo chnget "tempo"

In my experience, when there is no value coming via chnget, the value of ktempo is 0

Richard

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

Date2017-12-24 15:18
FromRichard
SubjectRe: [Csnd] initialize channel variables

Ok I see. Will try that...


On 24/12/17 16:10, Rory Walsh wrote:
I'm not suggesting you don't use chnget, but use chnset instead of init. That will set the initial value of the channel until it's overwritten by some slider movement.    

On 24 December 2017 at 15:07, Richard <zappfinger@gmail.com> wrote:

I have a csd controlled by some sliders, so I have to use chnget.
The csd only starts to work when I have moved all the sliders, since init apparenly gets 'overruled' by chnget...

Richard


On 24/12/17 15:39, Rory Walsh wrote:
Can you use chnset instead of init? 

On 24 December 2017 at 13:39, Richard <zappfinger@gmail.com> wrote:
I always struggle with this: how to initialize a variable that gets a value via chnget?

Say:

        ktempo init     120

        ktempo chnget "tempo"

In my experience, when there is no value coming via chnget, the value of ktempo is 0

Richard

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


Date2017-12-24 15:44
FromRichard
SubjectRe: [Csnd] initialize channel variables

Yes, that seems to work. But it's a bit clumsy. Maybe we could make a version of chnget with an extra optional parameter with the init value?

ktempo chnget "tempo", 120

On 24/12/17 16:10, Rory Walsh wrote:
I'm not suggesting you don't use chnget, but use chnset instead of init. That will set the initial value of the channel until it's overwritten by some slider movement.    

On 24 December 2017 at 15:07, Richard <zappfinger@gmail.com> wrote:

I have a csd controlled by some sliders, so I have to use chnget.
The csd only starts to work when I have moved all the sliders, since init apparenly gets 'overruled' by chnget...

Richard


On 24/12/17 15:39, Rory Walsh wrote:
Can you use chnset instead of init? 

On 24 December 2017 at 13:39, Richard <zappfinger@gmail.com> wrote:
I always struggle with this: how to initialize a variable that gets a value via chnget?

Say:

        ktempo init     120

        ktempo chnget "tempo"

In my experience, when there is no value coming via chnget, the value of ktempo is 0

Richard

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


Date2017-12-24 16:09
FromRory Walsh
SubjectRe: [Csnd] initialize channel variables
Take a look at the chnexport opcode. I think that night have an optional default value? 

On 24 Dec 2017 4:44 p.m., "Richard" <zappfinger@gmail.com> wrote:

Yes, that seems to work. But it's a bit clumsy. Maybe we could make a version of chnget with an extra optional parameter with the init value?

ktempo chnget "tempo", 120

On 24/12/17 16:10, Rory Walsh wrote:
I'm not suggesting you don't use chnget, but use chnset instead of init. That will set the initial value of the channel until it's overwritten by some slider movement.    

On 24 December 2017 at 15:07, Richard <zappfinger@gmail.com> wrote:

I have a csd controlled by some sliders, so I have to use chnget.
The csd only starts to work when I have moved all the sliders, since init apparenly gets 'overruled' by chnget...

Richard


On 24/12/17 15:39, Rory Walsh wrote:
Can you use chnset instead of init? 

On 24 December 2017 at 13:39, Richard <zappfinger@gmail.com> wrote:
I always struggle with this: how to initialize a variable that gets a value via chnget?

Say:

        ktempo init     120

        ktempo chnget "tempo"

In my experience, when there is no value coming via chnget, the value of ktempo is 0

Richard

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

Date2017-12-24 16:17
FromSteven Yi
SubjectRe: [Csnd] initialize channel variables
I posted a UDO here recently called xchan that operates to have a
default value for channels:

https://github.com/kunstmusik/csound-live-code/blob/master/livecode.orc#L217-L248

You could search for xchan in that file to see examples of its use.

On Sun, Dec 24, 2017 at 11:09 AM, Rory Walsh  wrote:
> Take a look at the chnexport opcode. I think that night have an optional
> default value?
>
> On 24 Dec 2017 4:44 p.m., "Richard"  wrote:
>>
>> Yes, that seems to work. But it's a bit clumsy. Maybe we could make a
>> version of chnget with an extra optional parameter with the init value?
>>
>> ktempo chnget "tempo", 120
>>
>>
>> On 24/12/17 16:10, Rory Walsh wrote:
>>
>> I'm not suggesting you don't use chnget, but use chnset instead of init.
>> That will set the initial value of the channel until it's overwritten by
>> some slider movement.
>>
>> On 24 December 2017 at 15:07, Richard  wrote:
>>>
>>> I have a csd controlled by some sliders, so I have to use chnget.
>>> The csd only starts to work when I have moved all the sliders, since init
>>> apparenly gets 'overruled' by chnget...
>>>
>>> Richard
>>>
>>>
>>> On 24/12/17 15:39, Rory Walsh wrote:
>>>
>>> Can you use chnset instead of init?
>>>
>>> On 24 December 2017 at 13:39, Richard  wrote:
>>>>
>>>> I always struggle with this: how to initialize a variable that gets a
>>>> value via chnget?
>>>>
>>>> Say:
>>>>
>>>>         ktempo init     120
>>>>
>>>>         ktempo chnget "tempo"
>>>>
>>>> In my experience, when there is no value coming via chnget, the value of
>>>> ktempo is 0
>>>>
>>>> Richard
>>>>
>>>> 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

Date2017-12-24 16:56
FromRichard
SubjectRe: [Csnd] initialize channel variables

I tried it, but that opcode does not work at all for me. Even when I move all sliders, I do not get a sound...


On 24/12/17 17:09, Rory Walsh wrote:
Take a look at the chnexport opcode. I think that night have an optional default value? 

On 24 Dec 2017 4:44 p.m., "Richard" <zappfinger@gmail.com> wrote:

Yes, that seems to work. But it's a bit clumsy. Maybe we could make a version of chnget with an extra optional parameter with the init value?

ktempo chnget "tempo", 120

On 24/12/17 16:10, Rory Walsh wrote:
I'm not suggesting you don't use chnget, but use chnset instead of init. That will set the initial value of the channel until it's overwritten by some slider movement.    

On 24 December 2017 at 15:07, Richard <zappfinger@gmail.com> wrote:

I have a csd controlled by some sliders, so I have to use chnget.
The csd only starts to work when I have moved all the sliders, since init apparenly gets 'overruled' by chnget...

Richard


On 24/12/17 15:39, Rory Walsh wrote:
Can you use chnset instead of init? 

On 24 December 2017 at 13:39, Richard <zappfinger@gmail.com> wrote:
I always struggle with this: how to initialize a variable that gets a value via chnget?

Say:

        ktempo init     120

        ktempo chnget "tempo"

In my experience, when there is no value coming via chnget, the value of ktempo is 0

Richard

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


Date2017-12-24 17:20
FromRichard
SubjectRe: [Csnd] initialize channel variables
Interesting stuff in that csd, Steven...


On 24/12/17 17:17, Steven Yi wrote:
> I posted a UDO here recently called xchan that operates to have a
> default value for channels:
>
> https://github.com/kunstmusik/csound-live-code/blob/master/livecode.orc#L217-L248
>
> You could search for xchan in that file to see examples of its use.
>
> On Sun, Dec 24, 2017 at 11:09 AM, Rory Walsh  wrote:
>> Take a look at the chnexport opcode. I think that night have an optional
>> default value?
>>
>> On 24 Dec 2017 4:44 p.m., "Richard"  wrote:
>>> Yes, that seems to work. But it's a bit clumsy. Maybe we could make a
>>> version of chnget with an extra optional parameter with the init value?
>>>
>>> ktempo chnget "tempo", 120
>>>
>>>
>>> On 24/12/17 16:10, Rory Walsh wrote:
>>>
>>> I'm not suggesting you don't use chnget, but use chnset instead of init.
>>> That will set the initial value of the channel until it's overwritten by
>>> some slider movement.
>>>
>>> On 24 December 2017 at 15:07, Richard  wrote:
>>>> I have a csd controlled by some sliders, so I have to use chnget.
>>>> The csd only starts to work when I have moved all the sliders, since init
>>>> apparenly gets 'overruled' by chnget...
>>>>
>>>> Richard
>>>>
>>>>
>>>> On 24/12/17 15:39, Rory Walsh wrote:
>>>>
>>>> Can you use chnset instead of init?
>>>>
>>>> On 24 December 2017 at 13:39, Richard  wrote:
>>>>> I always struggle with this: how to initialize a variable that gets a
>>>>> value via chnget?
>>>>>
>>>>> Say:
>>>>>
>>>>>          ktempo init     120
>>>>>
>>>>>          ktempo chnget "tempo"
>>>>>
>>>>> In my experience, when there is no value coming via chnget, the value of
>>>>> ktempo is 0
>>>>>
>>>>> Richard
>>>>>
>>>>> 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