Csound Csound-dev Csound-tekno Search About

chnget and arrays...

Date2019-11-07 13:44
FromRory Walsh
Subjectchnget 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, 

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?  

 
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

Date2019-11-07 14:56
FromSteven Yi
SubjectRe: 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:
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, 

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?  

 
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

Date2019-11-07 15:05
FromRory Walsh
SubjectRe: 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:
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:
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, 

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?  

 
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

Date2019-11-07 15:07
FromRory Walsh
SubjectRe: 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:
No, because it doesn't work at run time. 

On Thu, 7 Nov 2019 at 14:57, Steven Yi <stevenyi@gmail.com> wrote:
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:
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, 

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?  

 
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

Date2019-11-07 15:20
FromSteven Yi
SubjectRe: 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:
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:
No, because it doesn't work at run time. 

On Thu, 7 Nov 2019 at 14:57, Steven Yi <stevenyi@gmail.com> wrote:
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:
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, 

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?  

 
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

Date2019-11-07 15:22
FromVictor Lazzarini
SubjectRe: 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  wrote:
> 
> 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  wrote:
> 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  wrote:
> No, because it doesn't work at run time. 
> 
> On Thu, 7 Nov 2019 at 14:57, Steven Yi  wrote:
> 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  wrote:
> 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, 
> 
> 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?  
> 
>  
> 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

Date2019-11-07 16:15
FromRory Walsh
SubjectRe: 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.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 7 Nov 2019, at 15:20, Steven Yi <stevenyi@gmail.com> wrote:
>
> 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:
> 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:
> No, because it doesn't work at run time.
>
> On Thu, 7 Nov 2019 at 14:57, Steven Yi <stevenyi@gmail.com> wrote:
> 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:
> 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,
>
> 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? 
>

> 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

Date2019-11-07 18:58
FromVictor Lazzarini
SubjectRe: chnget and arrays...
Of course a C opcode is always more efficient than a UDO.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 7 Nov 2019, at 16:15, Rory Walsh <rorywalsh@ear.ie> wrote:

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.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 7 Nov 2019, at 15:20, Steven Yi <stevenyi@gmail.com> wrote:
>
> 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:
> 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:
> No, because it doesn't work at run time.
>
> On Thu, 7 Nov 2019 at 14:57, Steven Yi <stevenyi@gmail.com> wrote:
> 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:
> 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,
>
> 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? 
>

> 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