[Csnd] initialize channel variables
Date | 2017-12-24 13:39 |
From | Richard |
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 |
Date | 2017-12-24 14:39 |
From | Rory Walsh |
Subject | Re: [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? |
Date | 2017-12-24 15:07 |
From | Richard |
Subject | Re: [Csnd] initialize channel variables |
I have a csd controlled by some sliders, so I have to use chnget.
Richard On 24/12/17 15:39, Rory Walsh wrote:
|
Date | 2017-12-24 15:10 |
From | Rory Walsh |
Subject | Re: [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:
|
Date | 2017-12-24 15:18 |
From | Richard |
Subject | Re: [Csnd] initialize channel variables |
Ok I see. Will try that... On 24/12/17 16:10, Rory Walsh wrote:
|
Date | 2017-12-24 15:44 |
From | Richard |
Subject | Re: [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:
|
Date | 2017-12-24 16:09 |
From | Rory Walsh |
Subject | Re: [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:
|
Date | 2017-12-24 16:17 |
From | Steven Yi |
Subject | Re: [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 |
Date | 2017-12-24 16:56 |
From | Richard |
Subject | Re: [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:
|
Date | 2017-12-24 17:20 |
From | Richard |
Subject | Re: [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 |