Is it possible to init a named channel with an initial value?
I’ve tried to use chnset with i-rate value,
but when later I try to write a-rate signal to it, the compiler
complains that thisname is already used at a different rate.
instr Test
aBla = chnget:a(“bla”)
printk2(k(aBla))
endin
schedule(“Test”,0,1)
perhaps on the long run init could be extended to do this job.
best -
joachim
Hi, there)
Is it possible to init a named channel with an initial value?
I’ve tried to use chnset with i-rate value,
but when later I try to write a-rate signal to it, the compiler
complains that thisname is already used at a different rate.
Actually I can not use this trick because I don’t know in advance the name of the channel.
I use them to pass signals between instruments and to keep the channels unique between several instances
of the same instrument. I use an ever increasing counter to generate fresh names for channels.
instr Test
aBla = chnget:a(“bla”)
printk2(k(aBla))
endin
schedule(“Test”,0,1)
perhaps on the long run init could be extended to do this job.
best -
joachim
Hi, there)
Is it possible to init a named channel with an initial value?
I’ve tried to use chnset with i-rate value,
but when later I try to write a-rate signal to it, the compiler
complains that thisname is already used at a different rate.
but how do you want to set an initial value to a channel whichs name you don't know?
if you create the names dynamically, it should be possible to do it in a similar way, with sprintf.
Thanks, I see it’s nice ide with i-rate update on 0 value, maybe I can use it.
And also explicit query of chnget to work at rate.
I was not aware of that feature. I mean this chnget:rate that Steven uses in the code
Actually I can not use this trick because I don’t know in advance the name of the channel.
I use them to pass signals between instruments and to keep the channels unique between several instances
of the same instrument. I use an ever increasing counter to generate fresh names for channels.
instr Test
aBla = chnget:a(“bla”)
printk2(k(aBla))
endin
schedule(“Test”,0,1)
perhaps on the long run init could be extended to do this job.
best -
joachim
Hi, there)
Is it possible to init a named channel with an initial value?
I’ve tried to use chnset with i-rate value,
but when later I try to write a-rate signal to it, the compiler
complains that thisname is already used at a different rate.