chnget and arrays...
Date | 2019-11-07 13:44 |
From | Rory Walsh |
Subject | chnget and arrays... |
This is kind of a follow-on from Eduardo's post about immutable strings but would it be a lot of work to allow arrays of channel names to be passed to chnget? i.e,
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
SChannels init 3 SChannels[0] = "gain"
SChannels[0] = "freq"
SChannels[0] = "bling"
kChannelData[] chnget SChannels This would allow people to use check multiple channels with a single chnget, without the need for k-rate strings? |
Date | 2019-11-07 14:56 |
From | Steven Yi |
Subject | Re: chnget and arrays... |
Is this what you are talking about? chnset(1, "gain") chnset(2, "freq")chnset(3, "bling") opcode rory_chnget, k[], S[] Svals[] xin ilen = lenarray(Svals) kout[] init ilen indx = 0 while (indx < ilen) do kout[indx] init chnget:i(Svals[indx]) indx += 1 od xout kout endop gkvals[] = rory_chnget(fillarray("gain", "freq", "bling")) print i(gkvals, 0) print i(gkvals, 1) print i(gkvals, 2) On Thu, Nov 7, 2019 at 8:44 AM Rory Walsh <rorywalsh@ear.ie> wrote:
|
Date | 2019-11-07 15:05 |
From | Rory Walsh |
Subject | Re: chnget and arrays... |
No, because it doesn't work at run time. On Thu, 7 Nov 2019 at 14:57, Steven Yi <stevenyi@gmail.com> wrote:
|
Date | 2019-11-07 15:07 |
From | Rory Walsh |
Subject | Re: chnget and arrays... |
One could probably do it with a recursive UDO. But still, I think it would be nice to have a way to do it out of the box. On Thu, 7 Nov 2019 at 15:05, Rory Walsh <rorywalsh@ear.ie> wrote:
|
Date | 2019-11-07 15:20 |
From | Steven Yi |
Subject | Re: chnget and arrays... |
Okay, file an issue for a new opcode that takes in S[] and outputs k[] and updates at perf-time. (I can't think of an efficient way to do it with user-code with CS6.) On Thu, Nov 7, 2019 at 10:08 AM Rory Walsh <rorywalsh@ear.ie> wrote:
|
Date | 2019-11-07 15:22 |
From | Victor Lazzarini |
Subject | Re: chnget and arrays... |
I think it can be done recursively. ======================== Prof. Victor Lazzarini Maynooth University Ireland > On 7 Nov 2019, at 15:20, Steven Yi |
Date | 2019-11-07 16:15 |
From | Rory Walsh |
Subject | Re: chnget and arrays... |
Yes, but it would be less efficient than simply making a separate call to chnget for each channel. On Thu, 7 Nov 2019 at 15:22, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote: I think it can be done recursively. |
Date | 2019-11-07 18:58 |
From | Victor Lazzarini |
Subject | Re: chnget and arrays... |
Of course a C opcode is always more efficient than a UDO. Prof. Victor Lazzarini
Maynooth University
Ireland
|