[Csnd] issue with channels..

classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Csnd] issue with channels..

rorywalsh
As far as I can see, the following code should set the values of two channels to 1, but only manages to set the first channel? The value of the second channels remains at 0 even after chnset is called. I vaguely remember coming across this issue before, but can't for the life of me remember how I resolved it...  

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1


instr 100
kChan init 1
kVal init 1

    if metro(1) == 1 && kChan < 3 then
         Schannel sprintfk "rslider%d", kChan
         chnset k(1), Schannel
         printks "Slider%dVal:%f\n", 0, kChan, chnget:k(Schannel)
         kChan+=1
    endif

endin

</CsInstruments>
<CsScore>
i100 0 z
</CsScore>
</CsoundSynthesizer>
Csound mailing list [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

Tarmo Johannes-3
I think chnget takes string only in init time so all later k-time operations are void.
This is of course quite a problem in many cases...
Tarmo

05.07.2017 13:08 kirjutas kuupäeval "Rory Walsh" <[hidden email]>:
As far as I can see, the following code should set the values of two channels to 1, but only manages to set the first channel? The value of the second channels remains at 0 even after chnset is called. I vaguely remember coming across this issue before, but can't for the life of me remember how I resolved it...  

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1


instr 100
kChan init 1
kVal init 1

    if metro(1) == 1 && kChan < 3 then
         Schannel sprintfk "rslider%d", kChan
         chnset k(1), Schannel
         printks "Slider%dVal:%f\n", 0, kChan, chnget:k(Schannel)
         kChan+=1
    endif

endin

</CsInstruments>
<CsScore>
i100 0 z
</CsScore>
</CsoundSynthesizer>
Csound mailing list [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

rorywalsh
Thanks Tarmo. This sounds familiar now! I think to avoid this in the past I used arrays, and then used the strings from the arrays to query my channels. That should work.  

On 5 July 2017 at 11:51, Tarmo Johannes <[hidden email]> wrote:
I think chnget takes string only in init time so all later k-time operations are void.
This is of course quite a problem in many cases...
Tarmo

05.07.2017 13:08 kirjutas kuupäeval "Rory Walsh" <[hidden email]>:
As far as I can see, the following code should set the values of two channels to 1, but only manages to set the first channel? The value of the second channels remains at 0 even after chnset is called. I vaguely remember coming across this issue before, but can't for the life of me remember how I resolved it...  

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1


instr 100
kChan init 1
kVal init 1

    if metro(1) == 1 && kChan < 3 then
         Schannel sprintfk "rslider%d", kChan
         chnset k(1), Schannel
         printks "Slider%dVal:%f\n", 0, kChan, chnget:k(Schannel)
         kChan+=1
    endif

endin

</CsInstruments>
<CsScore>
i100 0 z
</CsScore>
</CsoundSynthesizer>
Csound mailing list [hidden email] 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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

rorywalsh
Hmm. I thought the following would work, but I get an invalid channel name error?

instr 100
kChan init 0
iCnt init 0
SChannels[] init 4

while iCnt < 2 do
   SChannels[iCnt] sprintf "rslider%d", iCnt+1
   iCnt+=1
od

    if metro(1) == 1 && kChan < 2 then
    printks SChannels[kChan], 0
        chnset k(1), SChannels[kChan]
        ;printks "Value of slider channel: %f", 0, chnget:k(SChannels[kChan])
        kChan+=1
    endif

endin

On 5 July 2017 at 12:05, Rory Walsh <[hidden email]> wrote:
Thanks Tarmo. This sounds familiar now! I think to avoid this in the past I used arrays, and then used the strings from the arrays to query my channels. That should work.  

On 5 July 2017 at 11:51, Tarmo Johannes <[hidden email]> wrote:
I think chnget takes string only in init time so all later k-time operations are void.
This is of course quite a problem in many cases...
Tarmo

05.07.2017 13:08 kirjutas kuupäeval "Rory Walsh" <[hidden email]>:
As far as I can see, the following code should set the values of two channels to 1, but only manages to set the first channel? The value of the second channels remains at 0 even after chnset is called. I vaguely remember coming across this issue before, but can't for the life of me remember how I resolved it...  

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1


instr 100
kChan init 1
kVal init 1

    if metro(1) == 1 && kChan < 3 then
         Schannel sprintfk "rslider%d", kChan
         chnset k(1), Schannel
         printks "Slider%dVal:%f\n", 0, kChan, chnget:k(Schannel)
         kChan+=1
    endif

endin

</CsInstruments>
<CsScore>
i100 0 z
</CsScore>
</CsoundSynthesizer>
Csound mailing list [hidden email] 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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

Tarmo Johannes-3
String from array witk k-index is still a k-time string and chget does not get it at i-time.
Very annoying. I think I needed to write another instrument to do the work on i-time but I agree it should not be that unconfortable.
Tarmo

05.07.2017 14:50 kirjutas kuupäeval "Rory Walsh" <[hidden email]>:
Hmm. I thought the following would work, but I get an invalid channel name error?

instr 100
kChan init 0
iCnt init 0
SChannels[] init 4

while iCnt < 2 do
   SChannels[iCnt] sprintf "rslider%d", iCnt+1
   iCnt+=1
od

    if metro(1) == 1 && kChan < 2 then
    printks SChannels[kChan], 0
        chnset k(1), SChannels[kChan]
        ;printks "Value of slider channel: %f", 0, chnget:k(SChannels[kChan])
        kChan+=1
    endif

endin

On 5 July 2017 at 12:05, Rory Walsh <[hidden email]> wrote:
Thanks Tarmo. This sounds familiar now! I think to avoid this in the past I used arrays, and then used the strings from the arrays to query my channels. That should work.  

On 5 July 2017 at 11:51, Tarmo Johannes <[hidden email]> wrote:
I think chnget takes string only in init time so all later k-time operations are void.
This is of course quite a problem in many cases...
Tarmo

05.07.2017 13:08 kirjutas kuupäeval "Rory Walsh" <[hidden email]>:
As far as I can see, the following code should set the values of two channels to 1, but only manages to set the first channel? The value of the second channels remains at 0 even after chnset is called. I vaguely remember coming across this issue before, but can't for the life of me remember how I resolved it...  

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1


instr 100
kChan init 1
kVal init 1

    if metro(1) == 1 && kChan < 3 then
         Schannel sprintfk "rslider%d", kChan
         chnset k(1), Schannel
         printks "Slider%dVal:%f\n", 0, kChan, chnget:k(Schannel)
         kChan+=1
    endif

endin

</CsInstruments>
<CsScore>
i100 0 z
</CsScore>
</CsoundSynthesizer>
Csound mailing list [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

rorywalsh
Ouch. That sounds like a nightmare. Was it always this way? I can't seem to remember having those issues before. 

On 5 July 2017 at 13:08, Tarmo Johannes <[hidden email]> wrote:
String from array witk k-index is still a k-time string and chget does not get it at i-time.
Very annoying. I think I needed to write another instrument to do the work on i-time but I agree it should not be that unconfortable.
Tarmo

05.07.2017 14:50 kirjutas kuupäeval "Rory Walsh" <[hidden email]>:
Hmm. I thought the following would work, but I get an invalid channel name error?

instr 100
kChan init 0
iCnt init 0
SChannels[] init 4

while iCnt < 2 do
   SChannels[iCnt] sprintf "rslider%d", iCnt+1
   iCnt+=1
od

    if metro(1) == 1 && kChan < 2 then
    printks SChannels[kChan], 0
        chnset k(1), SChannels[kChan]
        ;printks "Value of slider channel: %f", 0, chnget:k(SChannels[kChan])
        kChan+=1
    endif

endin

On 5 July 2017 at 12:05, Rory Walsh <[hidden email]> wrote:
Thanks Tarmo. This sounds familiar now! I think to avoid this in the past I used arrays, and then used the strings from the arrays to query my channels. That should work.  

On 5 July 2017 at 11:51, Tarmo Johannes <[hidden email]> wrote:
I think chnget takes string only in init time so all later k-time operations are void.
This is of course quite a problem in many cases...
Tarmo

05.07.2017 13:08 kirjutas kuupäeval "Rory Walsh" <[hidden email]>:
As far as I can see, the following code should set the values of two channels to 1, but only manages to set the first channel? The value of the second channels remains at 0 even after chnset is called. I vaguely remember coming across this issue before, but can't for the life of me remember how I resolved it...  

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1


instr 100
kChan init 1
kVal init 1

    if metro(1) == 1 && kChan < 3 then
         Schannel sprintfk "rslider%d", kChan
         chnset k(1), Schannel
         printks "Slider%dVal:%f\n", 0, kChan, chnget:k(Schannel)
         kChan+=1
    endif

endin

</CsInstruments>
<CsScore>
i100 0 z
</CsScore>
</CsoundSynthesizer>
Csound mailing list [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

Oeyvind Brandtsegg-3
Could you do:

if metro(1) == 1 && kChan < 3 then
  if changed(kChan) then
    reinit chan_name
  endif
  chan_name:
  Schannel sprintf "rslider%d", i(kChan)
  chnset k(1), Schannel
  rireturn

?

2017-07-05 14:45 GMT+02:00 Rory Walsh <[hidden email]>:
Ouch. That sounds like a nightmare. Was it always this way? I can't seem to remember having those issues before. 

On 5 July 2017 at 13:08, Tarmo Johannes <[hidden email]> wrote:
String from array witk k-index is still a k-time string and chget does not get it at i-time.
Very annoying. I think I needed to write another instrument to do the work on i-time but I agree it should not be that unconfortable.
Tarmo

05.07.2017 14:50 kirjutas kuupäeval "Rory Walsh" <[hidden email]>:
Hmm. I thought the following would work, but I get an invalid channel name error?

instr 100
kChan init 0
iCnt init 0
SChannels[] init 4

while iCnt < 2 do
   SChannels[iCnt] sprintf "rslider%d", iCnt+1
   iCnt+=1
od

    if metro(1) == 1 && kChan < 2 then
    printks SChannels[kChan], 0
        chnset k(1), SChannels[kChan]
        ;printks "Value of slider channel: %f", 0, chnget:k(SChannels[kChan])
        kChan+=1
    endif

endin

On 5 July 2017 at 12:05, Rory Walsh <[hidden email]> wrote:
Thanks Tarmo. This sounds familiar now! I think to avoid this in the past I used arrays, and then used the strings from the arrays to query my channels. That should work.  

On 5 July 2017 at 11:51, Tarmo Johannes <[hidden email]> wrote:
I think chnget takes string only in init time so all later k-time operations are void.
This is of course quite a problem in many cases...
Tarmo

05.07.2017 13:08 kirjutas kuupäeval "Rory Walsh" <[hidden email]>:
As far as I can see, the following code should set the values of two channels to 1, but only manages to set the first channel? The value of the second channels remains at 0 even after chnset is called. I vaguely remember coming across this issue before, but can't for the life of me remember how I resolved it...  

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1


instr 100
kChan init 1
kVal init 1

    if metro(1) == 1 && kChan < 3 then
         Schannel sprintfk "rslider%d", kChan
         chnset k(1), Schannel
         printks "Slider%dVal:%f\n", 0, kChan, chnget:k(Schannel)
         kChan+=1
    endif

endin

</CsInstruments>
<CsScore>
i100 0 z
</CsScore>
</CsoundSynthesizer>
Csound mailing list [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

Oeyvind Brandtsegg-3
(not tested here, beware of typos)

2017-07-05 15:16 GMT+02:00 Oeyvind Brandtsegg <[hidden email]>:
Could you do:

if metro(1) == 1 && kChan < 3 then
  if changed(kChan) then
    reinit chan_name
  endif
  chan_name:
  Schannel sprintf "rslider%d", i(kChan)
  chnset k(1), Schannel
  rireturn

?

2017-07-05 14:45 GMT+02:00 Rory Walsh <[hidden email]>:
Ouch. That sounds like a nightmare. Was it always this way? I can't seem to remember having those issues before. 

On 5 July 2017 at 13:08, Tarmo Johannes <[hidden email]> wrote:
String from array witk k-index is still a k-time string and chget does not get it at i-time.
Very annoying. I think I needed to write another instrument to do the work on i-time but I agree it should not be that unconfortable.
Tarmo

05.07.2017 14:50 kirjutas kuupäeval "Rory Walsh" <[hidden email]>:
Hmm. I thought the following would work, but I get an invalid channel name error?

instr 100
kChan init 0
iCnt init 0
SChannels[] init 4

while iCnt < 2 do
   SChannels[iCnt] sprintf "rslider%d", iCnt+1
   iCnt+=1
od

    if metro(1) == 1 && kChan < 2 then
    printks SChannels[kChan], 0
        chnset k(1), SChannels[kChan]
        ;printks "Value of slider channel: %f", 0, chnget:k(SChannels[kChan])
        kChan+=1
    endif

endin

On 5 July 2017 at 12:05, Rory Walsh <[hidden email]> wrote:
Thanks Tarmo. This sounds familiar now! I think to avoid this in the past I used arrays, and then used the strings from the arrays to query my channels. That should work.  

On 5 July 2017 at 11:51, Tarmo Johannes <[hidden email]> wrote:
I think chnget takes string only in init time so all later k-time operations are void.
This is of course quite a problem in many cases...
Tarmo

05.07.2017 13:08 kirjutas kuupäeval "Rory Walsh" <[hidden email]>:
As far as I can see, the following code should set the values of two channels to 1, but only manages to set the first channel? The value of the second channels remains at 0 even after chnset is called. I vaguely remember coming across this issue before, but can't for the life of me remember how I resolved it...  

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1


instr 100
kChan init 1
kVal init 1

    if metro(1) == 1 && kChan < 3 then
         Schannel sprintfk "rslider%d", kChan
         chnset k(1), Schannel
         printks "Slider%dVal:%f\n", 0, kChan, chnget:k(Schannel)
         kChan+=1
    endif

endin

</CsInstruments>
<CsScore>
i100 0 z
</CsScore>
</CsoundSynthesizer>
Csound mailing list [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

rorywalsh
Probably, to it seems very cumbersome. I wonder is there any way chnget can be updated to deal with k-time strings? 

On 5 July 2017 at 14:16, Oeyvind Brandtsegg <[hidden email]> wrote:
(not tested here, beware of typos)

2017-07-05 15:16 GMT+02:00 Oeyvind Brandtsegg <[hidden email]>:
Could you do:

if metro(1) == 1 && kChan < 3 then
  if changed(kChan) then
    reinit chan_name
  endif
  chan_name:
  Schannel sprintf "rslider%d", i(kChan)
  chnset k(1), Schannel
  rireturn

?

2017-07-05 14:45 GMT+02:00 Rory Walsh <[hidden email]>:
Ouch. That sounds like a nightmare. Was it always this way? I can't seem to remember having those issues before. 

On 5 July 2017 at 13:08, Tarmo Johannes <[hidden email]> wrote:
String from array witk k-index is still a k-time string and chget does not get it at i-time.
Very annoying. I think I needed to write another instrument to do the work on i-time but I agree it should not be that unconfortable.
Tarmo

05.07.2017 14:50 kirjutas kuupäeval "Rory Walsh" <[hidden email]>:
Hmm. I thought the following would work, but I get an invalid channel name error?

instr 100
kChan init 0
iCnt init 0
SChannels[] init 4

while iCnt < 2 do
   SChannels[iCnt] sprintf "rslider%d", iCnt+1
   iCnt+=1
od

    if metro(1) == 1 && kChan < 2 then
    printks SChannels[kChan], 0
        chnset k(1), SChannels[kChan]
        ;printks "Value of slider channel: %f", 0, chnget:k(SChannels[kChan])
        kChan+=1
    endif

endin

On 5 July 2017 at 12:05, Rory Walsh <[hidden email]> wrote:
Thanks Tarmo. This sounds familiar now! I think to avoid this in the past I used arrays, and then used the strings from the arrays to query my channels. That should work.  

On 5 July 2017 at 11:51, Tarmo Johannes <[hidden email]> wrote:
I think chnget takes string only in init time so all later k-time operations are void.
This is of course quite a problem in many cases...
Tarmo

05.07.2017 13:08 kirjutas kuupäeval "Rory Walsh" <[hidden email]>:
As far as I can see, the following code should set the values of two channels to 1, but only manages to set the first channel? The value of the second channels remains at 0 even after chnset is called. I vaguely remember coming across this issue before, but can't for the life of me remember how I resolved it...  

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1


instr 100
kChan init 1
kVal init 1

    if metro(1) == 1 && kChan < 3 then
         Schannel sprintfk "rslider%d", kChan
         chnset k(1), Schannel
         printks "Slider%dVal:%f\n", 0, kChan, chnget:k(Schannel)
         kChan+=1
    endif

endin

</CsInstruments>
<CsScore>
i100 0 z
</CsScore>
</CsoundSynthesizer>
Csound mailing list [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

joachim-3
i think what you could do is to call an instrument which does the job at
i-time:

instr 100
kChan init 1
kVal init 1

     if metro(1) == 1 && kChan < 3 then
          event "i", "Reset", 0, 1, kChan, kVal
          kChan+=1
     endif

endin

instr Reset

  Schannel sprintf "rslider%d", p4
          chnset p5, Schannel
          prints "Slider%dVal:%f\n", p4, chnget:i(Schannel)
  turnoff

endin


would this work for you?
        joachim



On 05/07/17 15:24, Rory Walsh wrote:

> Probably, to it seems very cumbersome. I wonder is there any way chnget
> can be updated to deal with k-time strings?
>
> On 5 July 2017 at 14:16, Oeyvind Brandtsegg <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     (not tested here, beware of typos)
>
>     2017-07-05 15:16 GMT+02:00 Oeyvind Brandtsegg
>     <[hidden email] <mailto:[hidden email]>>:
>
>         Could you do:
>
>         if metro(1) == 1 && kChan < 3 then
>           if changed(kChan) then
>             reinit chan_name
>           endif
>           chan_name:
>           Schannel sprintf "rslider%d", i(kChan)
>           chnset k(1), Schannel
>           rireturn
>
>         ?
>
>         2017-07-05 14:45 GMT+02:00 Rory Walsh <[hidden email]
>         <mailto:[hidden email]>>:
>
>             Ouch. That sounds like a nightmare. Was it always this way?
>             I can't seem to remember having those issues before.
>
>             On 5 July 2017 at 13:08, Tarmo Johannes <[hidden email]
>             <mailto:[hidden email]>> wrote:
>
>                 String from array witk k-index is still a k-time string
>                 and chget does not get it at i-time.
>                 Very annoying. I think I needed to write another
>                 instrument to do the work on i-time but I agree it
>                 should not be that unconfortable.
>                 Tarmo
>
>                 05.07.2017 14:50 kirjutas kuupäeval "Rory Walsh"
>                 <[hidden email] <mailto:[hidden email]>>:
>
>                     Hmm. I thought the following would work, but I get
>                     an invalid channel name error?
>
>                     instr 100
>                     kChan init 0
>                     iCnt init 0
>                     SChannels[] init 4
>
>                     while iCnt < 2 do
>                        SChannels[iCnt] sprintf "rslider%d", iCnt+1
>                        iCnt+=1
>                     od
>
>                         if metro(1) == 1 && kChan < 2 then
>                         printks SChannels[kChan], 0
>                             chnset k(1), SChannels[kChan]
>                             ;printks "Value of slider channel: %f", 0,
>                     chnget:k(SChannels[kChan])
>                             kChan+=1
>                         endif
>
>                     endin
>
>                     On 5 July 2017 at 12:05, Rory Walsh
>                     <[hidden email] <mailto:[hidden email]>> wrote:
>
>                         Thanks Tarmo. This sounds familiar now! I think
>                         to avoid this in the past I used arrays, and
>                         then used the strings from the arrays to query
>                         my channels. That should work.
>
>                         On 5 July 2017 at 11:51, Tarmo Johannes
>                         <[hidden email] <mailto:[hidden email]>>
>                         wrote:
>
>                             I think chnget takes string only in init
>                             time so all later k-time operations are void.
>                             This is of course quite a problem in many
>                             cases...
>                             Tarmo
>
>                             05.07.2017 13:08 kirjutas kuupäeval "Rory
>                             Walsh" <[hidden email]
>                             <mailto:[hidden email]>>:
>
>                                 As far as I can see, the following code
>                                 should set the values of two channels to
>                                 1, but only manages to set the first
>                                 channel? The value of the second
>                                 channels remains at 0 even after chnset
>                                 is called. I vaguely remember coming
>                                 across this issue before, but can't for
>                                 the life of me remember how I resolved
>                                 it...
>
>                                 <CsoundSynthesizer>
>                                 <CsOptions>
>                                 -odac
>                                 </CsOptions>
>                                 <CsInstruments>
>                                 sr = 44100
>                                 ksmps = 32
>                                 nchnls = 2
>                                 0dbfs = 1
>
>
>                                 instr 100
>                                 kChan init 1
>                                 kVal init 1
>
>                                     if metro(1) == 1 && kChan < 3 then
>                                          Schannel sprintfk "rslider%d",
>                                 kChan
>                                          chnset k(1), Schannel
>                                          printks "Slider%dVal:%f\n", 0,
>                                 kChan, chnget:k(Schannel)
>                                          kChan+=1
>                                     endif
>
>                                 endin
>
>                                 </CsInstruments>
>                                 <CsScore>
>                                 i100 0 z
>                                 </CsScore>
>                                 </CsoundSynthesizer>
>                                 Csound mailing list
>                                 [hidden email]
>                                 <mailto:[hidden email]>
>                                 https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>                                 <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>                                 Send bugs reports to
>                                 https://github.com/csound/csound/issues
>                                 <https://github.com/csound/csound/issues> Discussions
>                                 of bugs and features can be posted here
>
>
>                             Csound mailing list
>                             [hidden email]
>                             <mailto:[hidden email]>
>                             https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>                             <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>                             Send bugs reports to
>                             https://github.com/csound/csound/issues
>                             <https://github.com/csound/csound/issues>
>                             Discussions of bugs and features can be
>                             posted here
>
>
>
>                     Csound mailing list [hidden email]
>                     <mailto:[hidden email]>
>                     https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>                     <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>                     Send bugs reports to
>                     https://github.com/csound/csound/issues
>                     <https://github.com/csound/csound/issues>
>                     Discussions of bugs and features can be posted here
>
>                 Csound mailing list [hidden email]
>                 <mailto:[hidden email]>
>                 https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>                 <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send
>                 bugs reports to https://github.com/csound/csound/issues
>                 <https://github.com/csound/csound/issues> Discussions of
>                 bugs and features can be posted here
>
>
>             Csound mailing list [hidden email]
>             <mailto:[hidden email]>
>             https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>             <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs
>             reports to https://github.com/csound/csound/issues
>             <https://github.com/csound/csound/issues> Discussions of
>             bugs and features can be posted here
>
>
>
>
>         --
>
>         Oeyvind Brandtsegg
>         Professor of Music Technology
>         NTNU
>         7491 Trondheim
>         Norway
>         Cell: +47 92 203 205
>
>         http://www.partikkelaudio.com/
>         http://crossadaptive.hf.ntnu.no <http://crossadaptive.hf.ntnu.no>
>         http://gdsp.hf.ntnu.no/
>         http://soundcloud.com/brandtsegg <http://soundcloud.com/brandtsegg>
>         http://flyndresang.no/
>         http://soundcloud.com/t-emp
>
>
>
>
>
>     --
>
>     Oeyvind Brandtsegg
>     Professor of Music Technology
>     NTNU
>     7491 Trondheim
>     Norway
>     Cell: +47 92 203 205
>
>     http://www.partikkelaudio.com/
>     http://crossadaptive.hf.ntnu.no <http://crossadaptive.hf.ntnu.no>
>     http://gdsp.hf.ntnu.no/
>     http://soundcloud.com/brandtsegg <http://soundcloud.com/brandtsegg>
>     http://flyndresang.no/
>     http://soundcloud.com/t-emp
>
>     Csound mailing list [hidden email]
>     <mailto:[hidden email]>
>     https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>     <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs reports
>     to https://github.com/csound/csound/issues
>     <https://github.com/csound/csound/issues> Discussions of bugs and
>     features can be posted here
>
>
> Csound mailing list [hidden email]
> <mailto:[hidden email]>
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

rorywalsh
I think both of these solutions would work. I think it would be nice though if we could do it straight out of the box. 

On 5 July 2017 at 17:37, joachim heintz <[hidden email]> wrote:
i think what you could do is to call an instrument which does the job at i-time:

instr 100
kChan init 1
kVal init 1

    if metro(1) == 1 && kChan < 3 then
         event "i", "Reset", 0, 1, kChan, kVal
         kChan+=1
    endif

endin

instr Reset

 Schannel sprintf "rslider%d", p4
         chnset p5, Schannel
         prints "Slider%dVal:%f\n", p4, chnget:i(Schannel)
 turnoff

endin


would this work for you?
        joachim



On 05/07/17 15:24, Rory Walsh wrote:
Probably, to it seems very cumbersome. I wonder is there any way chnget
can be updated to deal with k-time strings?

On 5 July 2017 at 14:16, Oeyvind Brandtsegg <[hidden email]
<mailto:[hidden email]>> wrote:

    (not tested here, beware of typos)

    2017-07-05 15:16 GMT+02:00 Oeyvind Brandtsegg
    <[hidden email] <mailto:[hidden email]>>:

        Could you do:

        if metro(1) == 1 && kChan < 3 then
          if changed(kChan) then
            reinit chan_name
          endif
          chan_name:
          Schannel sprintf "rslider%d", i(kChan)
          chnset k(1), Schannel
          rireturn

        ?

        2017-07-05 14:45 GMT+02:00 Rory Walsh <[hidden email]
        <mailto:[hidden email]>>:

            Ouch. That sounds like a nightmare. Was it always this way?
            I can't seem to remember having those issues before.

            On 5 July 2017 at 13:08, Tarmo Johannes <[hidden email]
            <mailto:[hidden email]>> wrote:

                String from array witk k-index is still a k-time string
                and chget does not get it at i-time.
                Very annoying. I think I needed to write another
                instrument to do the work on i-time but I agree it
                should not be that unconfortable.
                Tarmo

                05.07.2017 14:50 kirjutas kuupäeval "Rory Walsh"
                <[hidden email] <mailto:[hidden email]>>:

                    Hmm. I thought the following would work, but I get
                    an invalid channel name error?

                    instr 100
                    kChan init 0
                    iCnt init 0
                    SChannels[] init 4

                    while iCnt < 2 do
                       SChannels[iCnt] sprintf "rslider%d", iCnt+1
                       iCnt+=1
                    od

                        if metro(1) == 1 && kChan < 2 then
                        printks SChannels[kChan], 0
                            chnset k(1), SChannels[kChan]
                            ;printks "Value of slider channel: %f", 0,
                    chnget:k(SChannels[kChan])
                            kChan+=1
                        endif

                    endin

                    On 5 July 2017 at 12:05, Rory Walsh
                    <[hidden email] <mailto:[hidden email]>> wrote:

                        Thanks Tarmo. This sounds familiar now! I think
                        to avoid this in the past I used arrays, and
                        then used the strings from the arrays to query
                        my channels. That should work.

                        On 5 July 2017 at 11:51, Tarmo Johannes
                        <[hidden email] <mailto:[hidden email]>>
                        wrote:

                            I think chnget takes string only in init
                            time so all later k-time operations are void.
                            This is of course quite a problem in many
                            cases...
                            Tarmo

                            05.07.2017 13:08 kirjutas kuupäeval "Rory
                            Walsh" <[hidden email]
                            <mailto:[hidden email]>>:


                                As far as I can see, the following code
                                should set the values of two channels to
                                1, but only manages to set the first
                                channel? The value of the second
                                channels remains at 0 even after chnset
                                is called. I vaguely remember coming
                                across this issue before, but can't for
                                the life of me remember how I resolved
                                it...

                                <CsoundSynthesizer>
                                <CsOptions>
                                -odac
                                </CsOptions>
                                <CsInstruments>
                                sr = 44100
                                ksmps = 32
                                nchnls = 2
                                0dbfs = 1


                                instr 100
                                kChan init 1
                                kVal init 1

                                    if metro(1) == 1 && kChan < 3 then
                                         Schannel sprintfk "rslider%d",
                                kChan
                                         chnset k(1), Schannel
                                         printks "Slider%dVal:%f\n", 0,
                                kChan, chnget:k(Schannel)
                                         kChan+=1
                                    endif

                                endin

                                </CsInstruments>
                                <CsScore>
                                i100 0 z
                                </CsScore>
                                </CsoundSynthesizer>
                                Csound mailing list
                                [hidden email]
                                <mailto:[hidden email]>
                                https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                                <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
                                Send bugs reports to
                                https://github.com/csound/csound/issues
                                <https://github.com/csound/csound/issues> Discussions
                                of bugs and features can be posted here


                            Csound mailing list
                            [hidden email]
                            <mailto:[hidden email]>
                            https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                            <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
                            Send bugs reports to
                            https://github.com/csound/csound/issues
                            <https://github.com/csound/csound/issues>
                            Discussions of bugs and features can be
                            posted here



                    Csound mailing list [hidden email]
                    <mailto:[hidden email]>
                    https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                    <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
                    Send bugs reports to
                    https://github.com/csound/csound/issues
                    <https://github.com/csound/csound/issues>
                    Discussions of bugs and features can be posted here

                Csound mailing list [hidden email]
                <mailto:[hidden email]>
                https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send
                bugs reports to https://github.com/csound/csound/issues
                <https://github.com/csound/csound/issues> Discussions of
                bugs and features can be posted here


            Csound mailing list [hidden email]
            <mailto:[hidden email]>
            https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
            <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs
            reports to https://github.com/csound/csound/issues
            <https://github.com/csound/csound/issues> Discussions of
            bugs and features can be posted here




        --

        Oeyvind Brandtsegg
        Professor of Music Technology
        NTNU
        7491 Trondheim
        Norway
        Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205" target="_blank">+47 92 203 205

        http://www.partikkelaudio.com/
        http://crossadaptive.hf.ntnu.no <http://crossadaptive.hf.ntnu.no>
        http://gdsp.hf.ntnu.no/
        http://soundcloud.com/brandtsegg <http://soundcloud.com/brandtsegg>
        http://flyndresang.no/
        http://soundcloud.com/t-emp





    --

    Oeyvind Brandtsegg
    Professor of Music Technology
    NTNU
    7491 Trondheim
    Norway
    Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205" target="_blank">+47 92 203 205

    http://www.partikkelaudio.com/
    http://crossadaptive.hf.ntnu.no <http://crossadaptive.hf.ntnu.no>
    http://gdsp.hf.ntnu.no/
    http://soundcloud.com/brandtsegg <http://soundcloud.com/brandtsegg>
    http://flyndresang.no/
    http://soundcloud.com/t-emp

    Csound mailing list [hidden email]
    <mailto:[hidden email]>
    https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
    <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs reports
    to https://github.com/csound/csound/issues
    <https://github.com/csound/csound/issues> Discussions of bugs and
    features can be posted here


Csound mailing list [hidden email]
<mailto:[hidden email]>
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
[hidden email]
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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

Tarmo Johannes-3
Yes, it would be more than welcome. Also for OSCsend and similar opcodes. I e if opcode operates at k-time it should be capable to read string constructed at k-time.

Tarmo.


05.07.2017 20:09 kirjutas kuupäeval "Rory Walsh" <[hidden email]>:
I think both of these solutions would work. I think it would be nice though if we could do it straight out of the box. 

On 5 July 2017 at 17:37, joachim heintz <[hidden email]> wrote:
i think what you could do is to call an instrument which does the job at i-time:

instr 100
kChan init 1
kVal init 1

    if metro(1) == 1 && kChan < 3 then
         event "i", "Reset", 0, 1, kChan, kVal
         kChan+=1
    endif

endin

instr Reset

 Schannel sprintf "rslider%d", p4
         chnset p5, Schannel
         prints "Slider%dVal:%f\n", p4, chnget:i(Schannel)
 turnoff

endin


would this work for you?
        joachim



On 05/07/17 15:24, Rory Walsh wrote:
Probably, to it seems very cumbersome. I wonder is there any way chnget
can be updated to deal with k-time strings?

On 5 July 2017 at 14:16, Oeyvind Brandtsegg <[hidden email]
<mailto:[hidden email]>> wrote:

    (not tested here, beware of typos)

    2017-07-05 15:16 GMT+02:00 Oeyvind Brandtsegg
    <[hidden email] <mailto:[hidden email]>>:

        Could you do:

        if metro(1) == 1 && kChan < 3 then
          if changed(kChan) then
            reinit chan_name
          endif
          chan_name:
          Schannel sprintf "rslider%d", i(kChan)
          chnset k(1), Schannel
          rireturn

        ?

        2017-07-05 14:45 GMT+02:00 Rory Walsh <[hidden email]
        <mailto:[hidden email]>>:

            Ouch. That sounds like a nightmare. Was it always this way?
            I can't seem to remember having those issues before.

            On 5 July 2017 at 13:08, Tarmo Johannes <[hidden email]
            <mailto:[hidden email]>> wrote:

                String from array witk k-index is still a k-time string
                and chget does not get it at i-time.
                Very annoying. I think I needed to write another
                instrument to do the work on i-time but I agree it
                should not be that unconfortable.
                Tarmo

                05.07.2017 14:50 kirjutas kuupäeval "Rory Walsh"
                <[hidden email] <mailto:[hidden email]>>:

                    Hmm. I thought the following would work, but I get
                    an invalid channel name error?

                    instr 100
                    kChan init 0
                    iCnt init 0
                    SChannels[] init 4

                    while iCnt < 2 do
                       SChannels[iCnt] sprintf "rslider%d", iCnt+1
                       iCnt+=1
                    od

                        if metro(1) == 1 && kChan < 2 then
                        printks SChannels[kChan], 0
                            chnset k(1), SChannels[kChan]
                            ;printks "Value of slider channel: %f", 0,
                    chnget:k(SChannels[kChan])
                            kChan+=1
                        endif

                    endin

                    On 5 July 2017 at 12:05, Rory Walsh
                    <[hidden email] <mailto:[hidden email]>> wrote:

                        Thanks Tarmo. This sounds familiar now! I think
                        to avoid this in the past I used arrays, and
                        then used the strings from the arrays to query
                        my channels. That should work.

                        On 5 July 2017 at 11:51, Tarmo Johannes
                        <[hidden email] <mailto:[hidden email]>>
                        wrote:

                            I think chnget takes string only in init
                            time so all later k-time operations are void.
                            This is of course quite a problem in many
                            cases...
                            Tarmo

                            05.07.2017 13:08 kirjutas kuupäeval "Rory
                            Walsh" <[hidden email]
                            <mailto:[hidden email]>>:


                                As far as I can see, the following code
                                should set the values of two channels to
                                1, but only manages to set the first
                                channel? The value of the second
                                channels remains at 0 even after chnset
                                is called. I vaguely remember coming
                                across this issue before, but can't for
                                the life of me remember how I resolved
                                it...

                                <CsoundSynthesizer>
                                <CsOptions>
                                -odac
                                </CsOptions>
                                <CsInstruments>
                                sr = 44100
                                ksmps = 32
                                nchnls = 2
                                0dbfs = 1


                                instr 100
                                kChan init 1
                                kVal init 1

                                    if metro(1) == 1 && kChan < 3 then
                                         Schannel sprintfk "rslider%d",
                                kChan
                                         chnset k(1), Schannel
                                         printks "Slider%dVal:%f\n", 0,
                                kChan, chnget:k(Schannel)
                                         kChan+=1
                                    endif

                                endin

                                </CsInstruments>
                                <CsScore>
                                i100 0 z
                                </CsScore>
                                </CsoundSynthesizer>
                                Csound mailing list
                                [hidden email]
                                <mailto:[hidden email]>
                                https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                                <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
                                Send bugs reports to
                                https://github.com/csound/csound/issues
                                <https://github.com/csound/csound/issues> Discussions
                                of bugs and features can be posted here


                            Csound mailing list
                            [hidden email]
                            <mailto:[hidden email]>
                            https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                            <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
                            Send bugs reports to
                            https://github.com/csound/csound/issues
                            <https://github.com/csound/csound/issues>
                            Discussions of bugs and features can be
                            posted here



                    Csound mailing list [hidden email]
                    <mailto:[hidden email]>
                    https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                    <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
                    Send bugs reports to
                    https://github.com/csound/csound/issues
                    <https://github.com/csound/csound/issues>
                    Discussions of bugs and features can be posted here

                Csound mailing list [hidden email]
                <mailto:[hidden email]>
                https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send
                bugs reports to https://github.com/csound/csound/issues
                <https://github.com/csound/csound/issues> Discussions of
                bugs and features can be posted here


            Csound mailing list [hidden email]
            <mailto:[hidden email]>
            https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
            <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs
            reports to https://github.com/csound/csound/issues
            <https://github.com/csound/csound/issues> Discussions of
            bugs and features can be posted here




        --

        Oeyvind Brandtsegg
        Professor of Music Technology
        NTNU
        7491 Trondheim
        Norway
        Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205" target="_blank">+47 92 203 205

        http://www.partikkelaudio.com/
        http://crossadaptive.hf.ntnu.no <http://crossadaptive.hf.ntnu.no>
        http://gdsp.hf.ntnu.no/
        http://soundcloud.com/brandtsegg <http://soundcloud.com/brandtsegg>
        http://flyndresang.no/
        http://soundcloud.com/t-emp





    --

    Oeyvind Brandtsegg
    Professor of Music Technology
    NTNU
    7491 Trondheim
    Norway
    Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205" target="_blank">+47 92 203 205

    http://www.partikkelaudio.com/
    http://crossadaptive.hf.ntnu.no <http://crossadaptive.hf.ntnu.no>
    http://gdsp.hf.ntnu.no/
    http://soundcloud.com/brandtsegg <http://soundcloud.com/brandtsegg>
    http://flyndresang.no/
    http://soundcloud.com/t-emp

    Csound mailing list [hidden email]
    <mailto:[hidden email]>
    https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
    <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs reports
    to https://github.com/csound/csound/issues
    <https://github.com/csound/csound/issues> Discussions of bugs and
    features can be posted here


Csound mailing list [hidden email]
<mailto:[hidden email]>
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
[hidden email]
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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

Oeyvind Brandtsegg-2
Hmm, but this could make the opcodes more CPU intensive. I guess k rate strings are more expensive than k rate floats. 

On Jul 5, 2017 8:08 PM, "Tarmo Johannes" <[hidden email]> wrote:
Yes, it would be more than welcome. Also for OSCsend and similar opcodes. I e if opcode operates at k-time it should be capable to read string constructed at k-time.

Tarmo.


05.07.2017 20:09 kirjutas kuupäeval "Rory Walsh" <[hidden email]>:
I think both of these solutions would work. I think it would be nice though if we could do it straight out of the box. 

On 5 July 2017 at 17:37, joachim heintz <[hidden email]> wrote:
i think what you could do is to call an instrument which does the job at i-time:

instr 100
kChan init 1
kVal init 1

    if metro(1) == 1 && kChan < 3 then
         event "i", "Reset", 0, 1, kChan, kVal
         kChan+=1
    endif

endin

instr Reset

 Schannel sprintf "rslider%d", p4
         chnset p5, Schannel
         prints "Slider%dVal:%f\n", p4, chnget:i(Schannel)
 turnoff

endin


would this work for you?
        joachim



On 05/07/17 15:24, Rory Walsh wrote:
Probably, to it seems very cumbersome. I wonder is there any way chnget
can be updated to deal with k-time strings?

On 5 July 2017 at 14:16, Oeyvind Brandtsegg <[hidden email]
<mailto:[hidden email]>> wrote:

    (not tested here, beware of typos)

    2017-07-05 15:16 GMT+02:00 Oeyvind Brandtsegg
    <[hidden email] <mailto:[hidden email]>>:

        Could you do:

        if metro(1) == 1 && kChan < 3 then
          if changed(kChan) then
            reinit chan_name
          endif
          chan_name:
          Schannel sprintf "rslider%d", i(kChan)
          chnset k(1), Schannel
          rireturn

        ?

        2017-07-05 14:45 GMT+02:00 Rory Walsh <[hidden email]
        <mailto:[hidden email]>>:

            Ouch. That sounds like a nightmare. Was it always this way?
            I can't seem to remember having those issues before.

            On 5 July 2017 at 13:08, Tarmo Johannes <[hidden email]
            <mailto:[hidden email]>> wrote:

                String from array witk k-index is still a k-time string
                and chget does not get it at i-time.
                Very annoying. I think I needed to write another
                instrument to do the work on i-time but I agree it
                should not be that unconfortable.
                Tarmo

                05.07.2017 14:50 kirjutas kuupäeval "Rory Walsh"
                <[hidden email] <mailto:[hidden email]>>:

                    Hmm. I thought the following would work, but I get
                    an invalid channel name error?

                    instr 100
                    kChan init 0
                    iCnt init 0
                    SChannels[] init 4

                    while iCnt < 2 do
                       SChannels[iCnt] sprintf "rslider%d", iCnt+1
                       iCnt+=1
                    od

                        if metro(1) == 1 && kChan < 2 then
                        printks SChannels[kChan], 0
                            chnset k(1), SChannels[kChan]
                            ;printks "Value of slider channel: %f", 0,
                    chnget:k(SChannels[kChan])
                            kChan+=1
                        endif

                    endin

                    On 5 July 2017 at 12:05, Rory Walsh
                    <[hidden email] <mailto:[hidden email]>> wrote:

                        Thanks Tarmo. This sounds familiar now! I think
                        to avoid this in the past I used arrays, and
                        then used the strings from the arrays to query
                        my channels. That should work.

                        On 5 July 2017 at 11:51, Tarmo Johannes
                        <[hidden email] <mailto:[hidden email]>>
                        wrote:

                            I think chnget takes string only in init
                            time so all later k-time operations are void.
                            This is of course quite a problem in many
                            cases...
                            Tarmo

                            05.07.2017 13:08 kirjutas kuupäeval "Rory
                            Walsh" <[hidden email]
                            <mailto:[hidden email]>>:


                                As far as I can see, the following code
                                should set the values of two channels to
                                1, but only manages to set the first
                                channel? The value of the second
                                channels remains at 0 even after chnset
                                is called. I vaguely remember coming
                                across this issue before, but can't for
                                the life of me remember how I resolved
                                it...

                                <CsoundSynthesizer>
                                <CsOptions>
                                -odac
                                </CsOptions>
                                <CsInstruments>
                                sr = 44100
                                ksmps = 32
                                nchnls = 2
                                0dbfs = 1


                                instr 100
                                kChan init 1
                                kVal init 1

                                    if metro(1) == 1 && kChan < 3 then
                                         Schannel sprintfk "rslider%d",
                                kChan
                                         chnset k(1), Schannel
                                         printks "Slider%dVal:%f\n", 0,
                                kChan, chnget:k(Schannel)
                                         kChan+=1
                                    endif

                                endin

                                </CsInstruments>
                                <CsScore>
                                i100 0 z
                                </CsScore>
                                </CsoundSynthesizer>
                                Csound mailing list
                                [hidden email]
                                <mailto:[hidden email]>
                                https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                                <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
                                Send bugs reports to
                                https://github.com/csound/csound/issues
                                <https://github.com/csound/csound/issues> Discussions
                                of bugs and features can be posted here


                            Csound mailing list
                            [hidden email]
                            <mailto:[hidden email]>
                            https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                            <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
                            Send bugs reports to
                            https://github.com/csound/csound/issues
                            <https://github.com/csound/csound/issues>
                            Discussions of bugs and features can be
                            posted here



                    Csound mailing list [hidden email]
                    <mailto:[hidden email]>
                    https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                    <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
                    Send bugs reports to
                    https://github.com/csound/csound/issues
                    <https://github.com/csound/csound/issues>
                    Discussions of bugs and features can be posted here

                Csound mailing list [hidden email]
                <mailto:[hidden email]>
                https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send
                bugs reports to https://github.com/csound/csound/issues
                <https://github.com/csound/csound/issues> Discussions of
                bugs and features can be posted here


            Csound mailing list [hidden email]
            <mailto:[hidden email]>
            https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
            <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs
            reports to https://github.com/csound/csound/issues
            <https://github.com/csound/csound/issues> Discussions of
            bugs and features can be posted here




        --

        Oeyvind Brandtsegg
        Professor of Music Technology
        NTNU
        7491 Trondheim
        Norway
        Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205" target="_blank">+47 92 203 205

        http://www.partikkelaudio.com/
        http://crossadaptive.hf.ntnu.no <http://crossadaptive.hf.ntnu.no>
        http://gdsp.hf.ntnu.no/
        http://soundcloud.com/brandtsegg <http://soundcloud.com/brandtsegg>
        http://flyndresang.no/
        http://soundcloud.com/t-emp





    --

    Oeyvind Brandtsegg
    Professor of Music Technology
    NTNU
    7491 Trondheim
    Norway
    Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205" target="_blank">+47 92 203 205

    http://www.partikkelaudio.com/
    http://crossadaptive.hf.ntnu.no <http://crossadaptive.hf.ntnu.no>
    http://gdsp.hf.ntnu.no/
    http://soundcloud.com/brandtsegg <http://soundcloud.com/brandtsegg>
    http://flyndresang.no/
    http://soundcloud.com/t-emp

    Csound mailing list [hidden email]
    <mailto:[hidden email]>
    https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
    <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs reports
    to https://github.com/csound/csound/issues
    <https://github.com/csound/csound/issues> Discussions of bugs and
    features can be posted here


Csound mailing list [hidden email]
<mailto:[hidden email]>
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
[hidden email]
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 [hidden email] 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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

gsenna
But there doesn't seem to be a string-copy operation involved in the
code. It would only cost more to user because of "Schannel sprintfk
"rslider%d", kChan".


On 05/07/17 15:17, Oeyvind Brandtsegg wrote:

> Hmm, but this could make the opcodes more CPU intensive. I guess k rate
> strings are more expensive than k rate floats.
>
> On Jul 5, 2017 8:08 PM, "Tarmo Johannes" <[hidden email]> wrote:
>
>> Yes, it would be more than welcome. Also for OSCsend and similar opcodes.
>> I e if opcode operates at k-time it should be capable to read string
>> constructed at k-time.
>>
>> Tarmo.
>>
>>
>> 05.07.2017 20:09 kirjutas kuupäeval "Rory Walsh" <[hidden email]>:
>>
>> I think both of these solutions would work. I think it would be nice
>> though if we could do it straight out of the box.
>>
>> On 5 July 2017 at 17:37, joachim heintz <[hidden email]> wrote:
>>
>>> i think what you could do is to call an instrument which does the job at
>>> i-time:
>>>
>>> instr 100
>>> kChan init 1
>>> kVal init 1
>>>
>>>     if metro(1) == 1 && kChan < 3 then
>>>          event "i", "Reset", 0, 1, kChan, kVal
>>>          kChan+=1
>>>     endif
>>>
>>> endin
>>>
>>> instr Reset
>>>
>>>  Schannel sprintf "rslider%d", p4
>>>          chnset p5, Schannel
>>>          prints "Slider%dVal:%f\n", p4, chnget:i(Schannel)
>>>  turnoff
>>>
>>> endin
>>>
>>>
>>> would this work for you?
>>>         joachim
>>>
>>>
>>>
>>> On 05/07/17 15:24, Rory Walsh wrote:
>>>
>>>> Probably, to it seems very cumbersome. I wonder is there any way chnget
>>>> can be updated to deal with k-time strings?
>>>>
>>>> On 5 July 2017 at 14:16, Oeyvind Brandtsegg <[hidden email]
>>>> <mailto:[hidden email]>> wrote:
>>>>
>>>>     (not tested here, beware of typos)
>>>>
>>>>     2017-07-05 15:16 GMT+02:00 Oeyvind Brandtsegg
>>>>     <[hidden email] <mailto:[hidden email]>>:
>>>>
>>>>         Could you do:
>>>>
>>>>         if metro(1) == 1 && kChan < 3 then
>>>>           if changed(kChan) then
>>>>             reinit chan_name
>>>>           endif
>>>>           chan_name:
>>>>           Schannel sprintf "rslider%d", i(kChan)
>>>>           chnset k(1), Schannel
>>>>           rireturn
>>>>
>>>>         ?
>>>>
>>>>         2017-07-05 14:45 GMT+02:00 Rory Walsh <[hidden email]
>>>>         <mailto:[hidden email]>>:
>>>>
>>>>             Ouch. That sounds like a nightmare. Was it always this way?
>>>>             I can't seem to remember having those issues before.
>>>>
>>>>             On 5 July 2017 at 13:08, Tarmo Johannes <[hidden email]
>>>>             <mailto:[hidden email]>> wrote:
>>>>
>>>>                 String from array witk k-index is still a k-time string
>>>>                 and chget does not get it at i-time.
>>>>                 Very annoying. I think I needed to write another
>>>>                 instrument to do the work on i-time but I agree it
>>>>                 should not be that unconfortable.
>>>>                 Tarmo
>>>>
>>>>                 05.07.2017 14:50 kirjutas kuupäeval "Rory Walsh"
>>>>                 <[hidden email] <mailto:[hidden email]>>:
>>>>
>>>>                     Hmm. I thought the following would work, but I get
>>>>                     an invalid channel name error?
>>>>
>>>>                     instr 100
>>>>                     kChan init 0
>>>>                     iCnt init 0
>>>>                     SChannels[] init 4
>>>>
>>>>                     while iCnt < 2 do
>>>>                        SChannels[iCnt] sprintf "rslider%d", iCnt+1
>>>>                        iCnt+=1
>>>>                     od
>>>>
>>>>                         if metro(1) == 1 && kChan < 2 then
>>>>                         printks SChannels[kChan], 0
>>>>                             chnset k(1), SChannels[kChan]
>>>>                             ;printks "Value of slider channel: %f", 0,
>>>>                     chnget:k(SChannels[kChan])
>>>>                             kChan+=1
>>>>                         endif
>>>>
>>>>                     endin
>>>>
>>>>                     On 5 July 2017 at 12:05, Rory Walsh
>>>>                     <[hidden email] <mailto:[hidden email]>> wrote:
>>>>
>>>>                         Thanks Tarmo. This sounds familiar now! I think
>>>>                         to avoid this in the past I used arrays, and
>>>>                         then used the strings from the arrays to query
>>>>                         my channels. That should work.
>>>>
>>>>                         On 5 July 2017 at 11:51, Tarmo Johannes
>>>>                         <[hidden email] <mailto:[hidden email]>>
>>>>                         wrote:
>>>>
>>>>                             I think chnget takes string only in init
>>>>                             time so all later k-time operations are void.
>>>>                             This is of course quite a problem in many
>>>>                             cases...
>>>>                             Tarmo
>>>>
>>>>                             05.07.2017 13:08 kirjutas kuupäeval "Rory
>>>>                             Walsh" <[hidden email]
>>>>                             <mailto:[hidden email]>>:
>>>>
>>>>
>>>>                                 As far as I can see, the following code
>>>>                                 should set the values of two channels to
>>>>                                 1, but only manages to set the first
>>>>                                 channel? The value of the second
>>>>                                 channels remains at 0 even after chnset
>>>>                                 is called. I vaguely remember coming
>>>>                                 across this issue before, but can't for
>>>>                                 the life of me remember how I resolved
>>>>                                 it...
>>>>
>>>>                                 <CsoundSynthesizer>
>>>>                                 <CsOptions>
>>>>                                 -odac
>>>>                                 </CsOptions>
>>>>                                 <CsInstruments>
>>>>                                 sr = 44100
>>>>                                 ksmps = 32
>>>>                                 nchnls = 2
>>>>                                 0dbfs = 1
>>>>
>>>>
>>>>                                 instr 100
>>>>                                 kChan init 1
>>>>                                 kVal init 1
>>>>
>>>>                                     if metro(1) == 1 && kChan < 3 then
>>>>                                          Schannel sprintfk "rslider%d",
>>>>                                 kChan
>>>>                                          chnset k(1), Schannel
>>>>                                          printks "Slider%dVal:%f\n", 0,
>>>>                                 kChan, chnget:k(Schannel)
>>>>                                          kChan+=1
>>>>                                     endif
>>>>
>>>>                                 endin
>>>>
>>>>                                 </CsInstruments>
>>>>                                 <CsScore>
>>>>                                 i100 0 z
>>>>                                 </CsScore>
>>>>                                 </CsoundSynthesizer>
>>>>                                 Csound mailing list
>>>>                                 [hidden email]
>>>>                                 <mailto:[hidden email]>
>>>>                                 https://listserv.heanet.ie/cgi
>>>> -bin/wa?A0=CSOUND
>>>>                                 <https://listserv.heanet.ie/cg
>>>> i-bin/wa?A0=CSOUND>
>>>>                                 Send bugs reports to
>>>>                                 https://github.com/csound/csound/issues
>>>>                                 <https://github.com/csound/csound/issues>
>>>> Discussions
>>>>                                 of bugs and features can be posted here
>>>>
>>>>
>>>>                             Csound mailing list
>>>>                             [hidden email]
>>>>                             <mailto:[hidden email]>
>>>>                             https://listserv.heanet.ie/cgi
>>>> -bin/wa?A0=CSOUND
>>>>                             <https://listserv.heanet.ie/cg
>>>> i-bin/wa?A0=CSOUND>
>>>>                             Send bugs reports to
>>>>                             https://github.com/csound/csound/issues
>>>>                             <https://github.com/csound/csound/issues>
>>>>                             Discussions of bugs and features can be
>>>>                             posted here
>>>>
>>>>
>>>>
>>>>                     Csound mailing list [hidden email]
>>>>                     <mailto:[hidden email]>
>>>>                     https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>                     <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>>>>                     Send bugs reports to
>>>>                     https://github.com/csound/csound/issues
>>>>                     <https://github.com/csound/csound/issues>
>>>>                     Discussions of bugs and features can be posted here
>>>>
>>>>                 Csound mailing list [hidden email]
>>>>                 <mailto:[hidden email]>
>>>>                 https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>                 <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send
>>>>                 bugs reports to https://github.com/csound/csound/issues
>>>>                 <https://github.com/csound/csound/issues> Discussions of
>>>>                 bugs and features can be posted here
>>>>
>>>>
>>>>             Csound mailing list [hidden email]
>>>>             <mailto:[hidden email]>
>>>>             https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>             <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs
>>>>             reports to https://github.com/csound/csound/issues
>>>>             <https://github.com/csound/csound/issues> Discussions of
>>>>             bugs and features can be posted here
>>>>
>>>>
>>>>
>>>>
>>>>         --
>>>>
>>>>         Oeyvind Brandtsegg
>>>>         Professor of Music Technology
>>>>         NTNU
>>>>         7491 Trondheim
>>>>         Norway
>>>>         Cell: +47 92 203 205
>>>>
>>>>         http://www.partikkelaudio.com/
>>>>         http://crossadaptive.hf.ntnu.no <http://crossadaptive.hf.ntnu.no
>>>>         http://gdsp.hf.ntnu.no/
>>>>         http://soundcloud.com/brandtsegg <http://soundcloud.com/brandts
>>>> egg>
>>>>         http://flyndresang.no/
>>>>         http://soundcloud.com/t-emp
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>     --
>>>>
>>>>     Oeyvind Brandtsegg
>>>>     Professor of Music Technology
>>>>     NTNU
>>>>     7491 Trondheim
>>>>     Norway
>>>>     Cell: +47 92 203 205
>>>>
>>>>     http://www.partikkelaudio.com/
>>>>     http://crossadaptive.hf.ntnu.no <http://crossadaptive.hf.ntnu.no>
>>>>     http://gdsp.hf.ntnu.no/
>>>>     http://soundcloud.com/brandtsegg <http://soundcloud.com/brandtsegg>
>>>>     http://flyndresang.no/
>>>>     http://soundcloud.com/t-emp
>>>>
>>>>     Csound mailing list [hidden email]
>>>>     <mailto:[hidden email]>
>>>>     https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>     <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs reports
>>>>     to https://github.com/csound/csound/issues
>>>>     <https://github.com/csound/csound/issues> Discussions of bugs and
>>>>     features can be posted here
>>>>
>>>>
>>>> Csound mailing list [hidden email]
>>>> <mailto:[hidden email]>
>>>> 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
>>> [hidden email]
>>> 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 [hidden email]
>> 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 [hidden email] 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
> [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

jpff
In reply to this post by Oeyvind Brandtsegg-2
The problem is more to do with the calling of the init code again.  This could be a big hit in some cases.

Sent from TypeApp
On 5 Jul 2017, at 19:18, Oeyvind Brandtsegg <[hidden email]> wrote:
Hmm, but this could make the opcodes more CPU intensive. I guess k rate strings are more expensive than k rate floats. 

On Jul 5, 2017 8:08 PM, "Tarmo Johannes" < [hidden email]> wrote:
Yes, it would be more than welcome. Also for OSCsend and similar opcodes. I e if opcode operates at k-time it should be capable to read string constructed at k-time.

Tarmo.


05.07.2017 20:09 kirjutas kuupäeval "Rory Walsh" < [hidden email]>:
I think both of these solutions would work. I think it would be nice though if we could do it straight out of the box. 

On 5 July 2017 at 17:37, joachim heintz <[hidden email]> wrote:
i think what you could do is to call an instrument which does the job at i-time:

instr 100
kChan init 1
kVal init 1

    if metro(1) == 1 && kChan < 3 then
         event "i", "Reset", 0, 1, kChan, kVal
         kChan+=1
    endif

endin

instr Reset

 Schannel sprintf "rslider%d", p4
         chnset p5, Schannel
         prints "Slider%dVal:%f\n", p4, chnget:i(Schannel)
 turnoff

endin


would this work for you?
        joachim



On 05/07/17 15:24, Rory Walsh wrote:
Probably, to it seems very cumbersome. I wonder is there any way chnget
can be updated to deal with k-time strings?

On 5 July 2017 at 14:16, Oeyvind Brandtsegg <[hidden email]
<mailto:[hidden email]>> wrote:

    (not tested here, beware of typos)

    2017-07-05 15:16 GMT+02:00 Oeyvind Brandtsegg
    < [hidden email] <mailto: [hidden email]>>:

        Could you do:

        if metro(1) == 1 && kChan < 3 then
          if changed(kChan) then
            reinit chan_name
          endif
          chan_name:
          Schannel sprintf "rslider%d", i(kChan)
          chnset k(1), Schannel
          rireturn

        ?

        2017-07-05 14:45 GMT+02:00 Rory Walsh <[hidden email]
        <mailto: [hidden email]>>:

            Ouch. That sounds like a nightmare. Was it always this way?
            I can't seem to remember having those issues before.

            On 5 July 2017 at 13:08, Tarmo Johannes <[hidden email]
            <mailto:[hidden email]>> wrote:

                String from array witk k-index is still a k-time string
                and chget does not get it at i-time.
                Very annoying. I think I needed to write another
                instrument to do the work on i-time but I agree it
                should not be that unconfortable.
                Tarmo

                05.07.2017 14:50 kirjutas kuupäeval "Rory Walsh"
                < [hidden email] <mailto: [hidden email]>>:

                    Hmm. I thought the following would work, but I get
                    an invalid channel name error?

                    instr 100
                    kChan init 0
                    iCnt init 0
                    SChannels[] init 4

                    while iCnt < 2 do
                       SChannels[iCnt] sprintf "rslider%d", iCnt+1
                       iCnt+=1
                    od

                        if metro(1) == 1 && kChan < 2 then
                        printks SChannels[kChan], 0
                            chnset k(1), SChannels[kChan]
                            ;printks "Value of slider channel: %f", 0,
                    chnget:k(SChannels[kChan])
                            kChan+=1
                        endif

                    endin

                    On 5 July 2017 at 12:05, Rory Walsh
                    <[hidden email] <mailto:[hidden email]>> wrote:

                        Thanks Tarmo. This sounds familiar now! I think
                        to avoid this in the past I used arrays, and
                        then used the strings from the arrays to query
                        my channels. That should work.

                        On 5 July 2017 at 11:51, Tarmo Johannes
                        < [hidden email] <mailto: [hidden email]>>
                        wrote:

                            I think chnget takes string only in init
                            time so all later k-time operations are void.
                            This is of course quite a problem in many
                            cases...
                            Tarmo

                            05.07.2017 13:08 kirjutas kuupäeval "Rory
                            Walsh" <[hidden email]
                            <mailto: [hidden email]>>:


                                As far as I can see, the following code
                                should set the values of two channels to
                                1, but only manages to set the first
                                channel? The value of the second
                                channels remains at 0 even after chnset
                                is called. I vaguely remember coming
                                across this issue before, but can't for
                                the life of me remember how I resolved
                                it...

                                <CsoundSynthesizer>
                                <CsOptions>
                                -odac
                                </CsOptions>
                                <CsInstruments>
                                sr = 44100
                                ksmps = 32
                                nchnls = 2
                                0dbfs = 1


                                instr 100
                                kChan init 1
                                kVal init 1

                                    if metro(1) == 1 && kChan < 3 then
                                         Schannel sprintfk "rslider%d",
                                kChan
                                         chnset k(1), Schannel
                                         printks "Slider%dVal:%f\n", 0,
                                kChan, chnget:k(Schannel)
                                         kChan+=1
                                    endif

                                endin

                                </CsInstruments>
                                <CsScore>
                                i100 0 z
                                </CsScore>
                                </CsoundSynthesizer>
                                Csound mailing list
                                [hidden email]
                                <mailto: [hidden email]>
                                https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                                <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
                                Send bugs reports to
                                https://github.com/csound/csound/issues
                                <https://github.com/csound/csound/issues> Discussions
                                of bugs and features can be posted here


                            Csound mailing list
                            [hidden email]
                            <mailto: [hidden email]>
                            https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                            <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
                            Send bugs reports to
                            https://github.com/csound/csound/issues
                            <https://github.com/csound/csound/issues>
                            Discussions of bugs and features can be
                            posted here



                    Csound mailing list [hidden email]
                    <mailto: [hidden email]>
                    https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                    <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
                    Send bugs reports to
                    https://github.com/csound/csound/issues
                    <https://github.com/csound/csound/issues>
                    Discussions of bugs and features can be posted here

                Csound mailing list [hidden email]
                <mailto: [hidden email]>
                https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send
                bugs reports to https://github.com/csound/csound/issues
                <https://github.com/csound/csound/issues> Discussions of
                bugs and features can be posted here


            Csound mailing list [hidden email]
            <mailto: [hidden email]>
            https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
            <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs
            reports to https://github.com/csound/csound/issues
            <https://github.com/csound/csound/issues> Discussions of
            bugs and features can be posted here




        --

        Oeyvind Brandtsegg
        Professor of Music Technology
        NTNU
        7491 Trondheim
        Norway
        Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205" target="_blank">+47 92 203 205

        http://www.partikkelaudio.com/
        http://crossadaptive.hf.ntnu.no < http://crossadaptive.hf.ntnu.no>
        http://gdsp.hf.ntnu.no/
        http://soundcloud.com/brandtsegg < http://soundcloud.com/brandtsegg>
        http://flyndresang.no/
        http://soundcloud.com/t-emp





    --

    Oeyvind Brandtsegg
    Professor of Music Technology
    NTNU
    7491 Trondheim
    Norway
    Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205" target="_blank">+47 92 203 205

    http://www.partikkelaudio.com/
    http://crossadaptive.hf.ntnu.no < http://crossadaptive.hf.ntnu.no>
    http://gdsp.hf.ntnu.no/
    http://soundcloud.com/brandtsegg < http://soundcloud.com/brandtsegg>
    http://flyndresang.no/
    http://soundcloud.com/t-emp

    Csound mailing list [hidden email]
    <mailto: [hidden email]>
    https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
    <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs reports
    to https://github.com/csound/csound/issues
    <https://github.com/csound/csound/issues> Discussions of bugs and
    features can be posted here


Csound mailing list [hidden email]
<mailto: [hidden email]>
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
[hidden email]
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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

rorywalsh
Can you think of any cost effective ways of doing it? 

On 5 July 2017 at 22:01, John ff <[hidden email]> wrote:
The problem is more to do with the calling of the init code again.  This could be a big hit in some cases.

Sent from TypeApp
On 5 Jul 2017, at 19:18, Oeyvind Brandtsegg <[hidden email]> wrote:
Hmm, but this could make the opcodes more CPU intensive. I guess k rate strings are more expensive than k rate floats. 

On Jul 5, 2017 8:08 PM, "Tarmo Johannes" < [hidden email]> wrote:
Yes, it would be more than welcome. Also for OSCsend and similar opcodes. I e if opcode operates at k-time it should be capable to read string constructed at k-time.

Tarmo.


05.07.2017 20:09 kirjutas kuupäeval "Rory Walsh" < [hidden email]>:
I think both of these solutions would work. I think it would be nice though if we could do it straight out of the box. 

On 5 July 2017 at 17:37, joachim heintz <[hidden email]> wrote:
i think what you could do is to call an instrument which does the job at i-time:

instr 100
kChan init 1
kVal init 1

    if metro(1) == 1 && kChan < 3 then
         event "i", "Reset", 0, 1, kChan, kVal
         kChan+=1
    endif

endin

instr Reset

 Schannel sprintf "rslider%d", p4
         chnset p5, Schannel
         prints "Slider%dVal:%f\n", p4, chnget:i(Schannel)
 turnoff

endin


would this work for you?
        joachim



On 05/07/17 15:24, Rory Walsh wrote:
Probably, to it seems very cumbersome. I wonder is there any way chnget
can be updated to deal with k-time strings?

On 5 July 2017 at 14:16, Oeyvind Brandtsegg <[hidden email]
<mailto:[hidden email]>> wrote:

    (not tested here, beware of typos)

    2017-07-05 15:16 GMT+02:00 Oeyvind Brandtsegg
    < [hidden email] <mailto: [hidden email]>>:

        Could you do:

        if metro(1) == 1 && kChan < 3 then
          if changed(kChan) then
            reinit chan_name
          endif
          chan_name:
          Schannel sprintf "rslider%d", i(kChan)
          chnset k(1), Schannel
          rireturn

        ?

        2017-07-05 14:45 GMT+02:00 Rory Walsh <[hidden email]
        <mailto: [hidden email]>>:

            Ouch. That sounds like a nightmare. Was it always this way?
            I can't seem to remember having those issues before.

            On 5 July 2017 at 13:08, Tarmo Johannes <[hidden email]
            <mailto:[hidden email]>> wrote:

                String from array witk k-index is still a k-time string
                and chget does not get it at i-time.
                Very annoying. I think I needed to write another
                instrument to do the work on i-time but I agree it
                should not be that unconfortable.
                Tarmo

                05.07.2017 14:50 kirjutas kuupäeval "Rory Walsh"
                < [hidden email] <mailto: [hidden email]>>:

                    Hmm. I thought the following would work, but I get
                    an invalid channel name error?

                    instr 100
                    kChan init 0
                    iCnt init 0
                    SChannels[] init 4

                    while iCnt < 2 do
                       SChannels[iCnt] sprintf "rslider%d", iCnt+1
                       iCnt+=1
                    od

                        if metro(1) == 1 && kChan < 2 then
                        printks SChannels[kChan], 0
                            chnset k(1), SChannels[kChan]
                            ;printks "Value of slider channel: %f", 0,
                    chnget:k(SChannels[kChan])
                            kChan+=1
                        endif

                    endin

                    On 5 July 2017 at 12:05, Rory Walsh
                    <[hidden email] <mailto:[hidden email]>> wrote:

                        Thanks Tarmo. This sounds familiar now! I think
                        to avoid this in the past I used arrays, and
                        then used the strings from the arrays to query
                        my channels. That should work.

                        On 5 July 2017 at 11:51, Tarmo Johannes
                        < [hidden email] <mailto: [hidden email]>>
                        wrote:

                            I think chnget takes string only in init
                            time so all later k-time operations are void.
                            This is of course quite a problem in many
                            cases...
                            Tarmo

                            05.07.2017 13:08 kirjutas kuupäeval "Rory
                            Walsh" <[hidden email]
                            <mailto: [hidden email]>>:


                                As far as I can see, the following code
                                should set the values of two channels to
                                1, but only manages to set the first
                                channel? The value of the second
                                channels remains at 0 even after chnset
                                is called. I vaguely remember coming
                                across this issue before, but can't for
                                the life of me remember how I resolved
                                it...

                                <CsoundSynthesizer>
                                <CsOptions>
                                -odac
                                </CsOptions>
                                <CsInstruments>
                                sr = 44100
                                ksmps = 32
                                nchnls = 2
                                0dbfs = 1


                                instr 100
                                kChan init 1
                                kVal init 1

                                    if metro(1) == 1 && kChan < 3 then
                                         Schannel sprintfk "rslider%d",
                                kChan
                                         chnset k(1), Schannel
                                         printks "Slider%dVal:%f\n", 0,
                                kChan, chnget:k(Schannel)
                                         kChan+=1
                                    endif

                                endin

                                </CsInstruments>
                                <CsScore>
                                i100 0 z
                                </CsScore>
                                </CsoundSynthesizer>
                                Csound mailing list
                                [hidden email]
                                <mailto: [hidden email]>
                                https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                                <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
                                Send bugs reports to
                                https://github.com/csound/csound/issues
                                <https://github.com/csound/csound/issues> Discussions
                                of bugs and features can be posted here


                            Csound mailing list
                            [hidden email]
                            <mailto: [hidden email]>
                            https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                            <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
                            Send bugs reports to
                            https://github.com/csound/csound/issues
                            <https://github.com/csound/csound/issues>
                            Discussions of bugs and features can be
                            posted here



                    Csound mailing list [hidden email]
                    <mailto: [hidden email]>
                    https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                    <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
                    Send bugs reports to
                    https://github.com/csound/csound/issues
                    <https://github.com/csound/csound/issues>
                    Discussions of bugs and features can be posted here

                Csound mailing list [hidden email]
                <mailto: [hidden email]>
                https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send
                bugs reports to https://github.com/csound/csound/issues
                <https://github.com/csound/csound/issues> Discussions of
                bugs and features can be posted here


            Csound mailing list [hidden email]
            <mailto: [hidden email]>
            https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
            <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs
            reports to https://github.com/csound/csound/issues
            <https://github.com/csound/csound/issues> Discussions of
            bugs and features can be posted here




        --

        Oeyvind Brandtsegg
        Professor of Music Technology
        NTNU
        7491 Trondheim
        Norway
        Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205" target="_blank">+47 92 203 205

        http://www.partikkelaudio.com/
        http://crossadaptive.hf.ntnu.no < http://crossadaptive.hf.ntnu.no>
        http://gdsp.hf.ntnu.no/
        http://soundcloud.com/brandtsegg < http://soundcloud.com/brandtsegg>
        http://flyndresang.no/
        http://soundcloud.com/t-emp





    --

    Oeyvind Brandtsegg
    Professor of Music Technology
    NTNU
    7491 Trondheim
    Norway
    Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205" target="_blank">+47 92 203 205

    http://www.partikkelaudio.com/
    http://crossadaptive.hf.ntnu.no < http://crossadaptive.hf.ntnu.no>
    http://gdsp.hf.ntnu.no/
    http://soundcloud.com/brandtsegg < http://soundcloud.com/brandtsegg>
    http://flyndresang.no/
    http://soundcloud.com/t-emp

    Csound mailing list [hidden email]
    <mailto: [hidden email]>
    https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
    <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs reports
    to https://github.com/csound/csound/issues
    <https://github.com/csound/csound/issues> Discussions of bugs and
    features can be posted here


Csound mailing list [hidden email]
<mailto: [hidden email]>
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
[hidden email]
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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

gsenna
In reply to this post by jpff

Which function will impact more on performance,  John? csoundGetChannelPtr or csoundGetChannelLock? I see however that chnset for S-variables has nearly identical functions for init and performance.


On 05/07/17 18:01, John ff wrote:
The problem is more to do with the calling of the init code again.  This could be a big hit in some cases.

⁣Sent from TypeApp ​

On 5 Jul 2017, 19:18, at 19:18, Oeyvind Brandtsegg [hidden email] wrote:
Hmm, but this could make the opcodes more CPU intensive. I guess k rate
strings are more expensive than k rate floats.

On Jul 5, 2017 8:08 PM, "Tarmo Johannes" [hidden email] wrote:

Yes, it would be more than welcome. Also for OSCsend and similar
opcodes.
I e if opcode operates at k-time it should be capable to read string
constructed at k-time.

Tarmo.


05.07.2017 20:09 kirjutas kuupäeval "Rory Walsh" [hidden email]:

I think both of these solutions would work. I think it would be nice
though if we could do it straight out of the box.

On 5 July 2017 at 17:37, joachim heintz [hidden email] wrote:

i think what you could do is to call an instrument which does the
job at
i-time:

instr 100
kChan init 1
kVal init 1

    if metro(1) == 1 && kChan < 3 then
         event "i", "Reset", 0, 1, kChan, kVal
         kChan+=1
    endif

endin

instr Reset

 Schannel sprintf "rslider%d", p4
         chnset p5, Schannel
         prints "Slider%dVal:%f\n", p4, chnget:i(Schannel)
 turnoff

endin


would this work for you?
        joachim



On 05/07/17 15:24, Rory Walsh wrote:

Probably, to it seems very cumbersome. I wonder is there any way
chnget
can be updated to deal with k-time strings?

On 5 July 2017 at 14:16, Oeyvind Brandtsegg
<[hidden email]
[hidden email]> wrote:

    (not tested here, beware of typos)

    2017-07-05 15:16 GMT+02:00 Oeyvind Brandtsegg
    <[hidden email] [hidden email]>:

        Could you do:

        if metro(1) == 1 && kChan < 3 then
          if changed(kChan) then
            reinit chan_name
          endif
          chan_name:
          Schannel sprintf "rslider%d", i(kChan)
          chnset k(1), Schannel
          rireturn

        ?

        2017-07-05 14:45 GMT+02:00 Rory Walsh <[hidden email]
        [hidden email]>:

            Ouch. That sounds like a nightmare. Was it always this
way?
            I can't seem to remember having those issues before.

            On 5 July 2017 at 13:08, Tarmo Johannes
<[hidden email]
            [hidden email]> wrote:

                String from array witk k-index is still a k-time
string
                and chget does not get it at i-time.
                Very annoying. I think I needed to write another
                instrument to do the work on i-time but I agree it
                should not be that unconfortable.
                Tarmo

                05.07.2017 14:50 kirjutas kuupäeval "Rory Walsh"
                <[hidden email] [hidden email]>:

                    Hmm. I thought the following would work, but I
get
                    an invalid channel name error?

                    instr 100
                    kChan init 0
                    iCnt init 0
                    SChannels[] init 4

                    while iCnt < 2 do
                       SChannels[iCnt] sprintf "rslider%d", iCnt+1
                       iCnt+=1
                    od

                        if metro(1) == 1 && kChan < 2 then
                        printks SChannels[kChan], 0
                            chnset k(1), SChannels[kChan]
                            ;printks "Value of slider channel: %f",
0,
                    chnget:k(SChannels[kChan])
                            kChan+=1
                        endif

                    endin

                    On 5 July 2017 at 12:05, Rory Walsh
                    <[hidden email] [hidden email]>
wrote:
                        Thanks Tarmo. This sounds familiar now! I
think
                        to avoid this in the past I used arrays,
and
                        then used the strings from the arrays to
query
                        my channels. That should work.

                        On 5 July 2017 at 11:51, Tarmo Johannes
                        <[hidden email]
[hidden email]>
                        wrote:

                            I think chnget takes string only in
init
                            time so all later k-time operations are
void.
                            This is of course quite a problem in
many
                            cases...
                            Tarmo

                            05.07.2017 13:08 kirjutas kuupäeval
"Rory
                            Walsh" <[hidden email]
                            [hidden email]>:


                                As far as I can see, the following
code
                                should set the values of two
channels to
                                1, but only manages to set the
first
                                channel? The value of the second
                                channels remains at 0 even after
chnset
                                is called. I vaguely remember
coming
                                across this issue before, but can't
for
                                the life of me remember how I
resolved
                                it...

                                <CsoundSynthesizer>
                                <CsOptions>
                                -odac
                                </CsOptions>
                                <CsInstruments>
                                sr = 44100
                                ksmps = 32
                                nchnls = 2
                                0dbfs = 1


                                instr 100
                                kChan init 1
                                kVal init 1

                                    if metro(1) == 1 && kChan < 3
then
                                         Schannel sprintfk
"rslider%d",
                                kChan
                                         chnset k(1), Schannel
                                         printks
"Slider%dVal:%f\n", 0,
                                kChan, chnget:k(Schannel)
                                         kChan+=1
                                    endif

                                endin

                                </CsInstruments>
                                <CsScore>
                                i100 0 z
                                </CsScore>
                                </CsoundSynthesizer>
                                Csound mailing list
                                [hidden email]
                                [hidden email]
                                https://listserv.heanet.ie/cgi
-bin/wa?A0=CSOUND
                                <https://listserv.heanet.ie/cg
i-bin/wa?A0=CSOUND>
                                Send bugs reports to
                               
https://github.com/csound/csound/issues
                               
<https://github.com/csound/csound/issues>
Discussions
                                of bugs and features can be posted
here

                            Csound mailing list
                            [hidden email]
                            [hidden email]
                            https://listserv.heanet.ie/cgi
-bin/wa?A0=CSOUND
                            <https://listserv.heanet.ie/cg
i-bin/wa?A0=CSOUND>
                            Send bugs reports to
                            https://github.com/csound/csound/issues
                           
<https://github.com/csound/csound/issues>
                            Discussions of bugs and features can be
                            posted here



                    Csound mailing list [hidden email]
                    [hidden email]
                    https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                   
<https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
                    Send bugs reports to
                    https://github.com/csound/csound/issues
                    <https://github.com/csound/csound/issues>
                    Discussions of bugs and features can be posted
here
                Csound mailing list [hidden email]
                [hidden email]
                https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
                <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
Send
                bugs reports to
https://github.com/csound/csound/issues
                <https://github.com/csound/csound/issues>
Discussions of
                bugs and features can be posted here


            Csound mailing list [hidden email]
            [hidden email]
            https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
            <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send
bugs
            reports to https://github.com/csound/csound/issues
            <https://github.com/csound/csound/issues> Discussions
of
            bugs and features can be posted here




        --

        Oeyvind Brandtsegg
        Professor of Music Technology
        NTNU
        7491 Trondheim
        Norway
        Cell: +47 92 203 205

        http://www.partikkelaudio.com/
        http://crossadaptive.hf.ntnu.no
<http://crossadaptive.hf.ntnu.no

              
        http://gdsp.hf.ntnu.no/
        http://soundcloud.com/brandtsegg
<http://soundcloud.com/brandts
egg>
        http://flyndresang.no/
        http://soundcloud.com/t-emp





    --

    Oeyvind Brandtsegg
    Professor of Music Technology
    NTNU
    7491 Trondheim
    Norway
    Cell: +47 92 203 205

    http://www.partikkelaudio.com/
    http://crossadaptive.hf.ntnu.no
<http://crossadaptive.hf.ntnu.no>
    http://gdsp.hf.ntnu.no/
    http://soundcloud.com/brandtsegg
<http://soundcloud.com/brandtsegg>
    http://flyndresang.no/
    http://soundcloud.com/t-emp

    Csound mailing list [hidden email]
    [hidden email]
    https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
    <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs
reports
    to https://github.com/csound/csound/issues
    <https://github.com/csound/csound/issues> Discussions of bugs
and
    features can be posted here


Csound mailing list [hidden email]
[hidden email]
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
[hidden email]
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 [hidden email]
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 [hidden email]
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
[hidden email]
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
[hidden email]
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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

Victor Lazzarini
I am a bit late in this conversation. I thought chnget worked at k-time already? What is the problem?
If it is to do with arrays, it might not be a question of chnget but of arrays access?

Remember the semantics of access …[k] is at k-time. If you want to access at i-time, use …[i]
So, for instance, see this


chn_S "test", 3

instr 1
Sarr[] init 2
Sarr[0] = "hello\n"
Sarr[1] = "world\n"

i1 = 0
k1 = 1

chnset Sarr[k1], "test"
S1 chnget "test"
printks S1,0.5

chnset Sarr[i1], "test"
S1 chnget "test"
prints S1

endin


========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 6 Jul 2017, at 01:29, Guillermo Senna <[hidden email]> wrote:
>
> Which function will impact more on performance,  John? csoundGetChannelPtr or csoundGetChannelLock? I see however that chnset for S-variables has nearly identical functions for init and performance.
>
>
> On 05/07/17 18:01, John ff wrote:
>> The problem is more to do with the calling of the init code again.  This could be a big hit in some cases.
>>
>> ⁣Sent from TypeApp ​
>>
>> On 5 Jul 2017, 19:18, at 19:18, Oeyvind Brandtsegg
>> <[hidden email]>
>>  wrote:
>>
>>> Hmm, but this could make the opcodes more CPU intensive. I guess k rate
>>> strings are more expensive than k rate floats.
>>>
>>> On Jul 5, 2017 8:08 PM, "Tarmo Johannes"
>>> <[hidden email]>
>>>  wrote:
>>>
>>>
>>>> Yes, it would be more than welcome. Also for OSCsend and similar
>>>>
>>> opcodes.
>>>
>>>> I e if opcode operates at k-time it should be capable to read string
>>>> constructed at k-time.
>>>>
>>>> Tarmo.
>>>>
>>>>
>>>> 05.07.2017 20:09 kirjutas kuupäeval "Rory Walsh"
>>>> <[hidden email]>
>>>> :
>>>>
>>>> I think both of these solutions would work. I think it would be nice
>>>> though if we could do it straight out of the box.
>>>>
>>>> On 5 July 2017 at 17:37, joachim heintz
>>>> <[hidden email]>
>>>>  wrote:
>>>>
>>>>
>>>>> i think what you could do is to call an instrument which does the
>>>>>
>>> job at
>>>
>>>>> i-time:
>>>>>
>>>>> instr 100
>>>>> kChan init 1
>>>>> kVal init 1
>>>>>
>>>>>     if metro(1) == 1 && kChan < 3 then
>>>>>          event "i", "Reset", 0, 1, kChan, kVal
>>>>>          kChan+=1
>>>>>     endif
>>>>>
>>>>> endin
>>>>>
>>>>> instr Reset
>>>>>
>>>>>  Schannel sprintf "rslider%d", p4
>>>>>          chnset p5, Schannel
>>>>>          prints "Slider%dVal:%f\n", p4, chnget:i(Schannel)
>>>>>  turnoff
>>>>>
>>>>> endin
>>>>>
>>>>>
>>>>> would this work for you?
>>>>>         joachim
>>>>>
>>>>>
>>>>>
>>>>> On 05/07/17 15:24, Rory Walsh wrote:
>>>>>
>>>>>
>>>>>> Probably, to it seems very cumbersome. I wonder is there any way
>>>>>>
>>> chnget
>>>
>>>>>> can be updated to deal with k-time strings?
>>>>>>
>>>>>> On 5 July 2017 at 14:16, Oeyvind Brandtsegg
>>>>>>
>>> <[hidden email]
>>>>>> <mailto:[hidden email]>
>>>>>> > wrote:
>>>>>>
>>>>>>     (not tested here, beware of typos)
>>>>>>
>>>>>>     2017-07-05 15:16 GMT+02:00 Oeyvind Brandtsegg
>>>>>>     <
>>>>>> [hidden email] <mailto:[hidden email]>
>>>>>> >:
>>>>>>
>>>>>>         Could you do:
>>>>>>
>>>>>>         if metro(1) == 1 && kChan < 3 then
>>>>>>           if changed(kChan) then
>>>>>>             reinit chan_name
>>>>>>           endif
>>>>>>           chan_name:
>>>>>>           Schannel sprintf "rslider%d", i(kChan)
>>>>>>           chnset k(1), Schannel
>>>>>>           rireturn
>>>>>>
>>>>>>         ?
>>>>>>
>>>>>>         2017-07-05 14:45 GMT+02:00 Rory Walsh <
>>>>>> [hidden email]
>>>>>>
>>>>>>        
>>>>>> <mailto:[hidden email]>
>>>>>> >:
>>>>>>
>>>>>>             Ouch. That sounds like a nightmare. Was it always this
>>>>>>
>>> way?
>>>
>>>>>>             I can't seem to remember having those issues before.
>>>>>>
>>>>>>             On 5 July 2017 at 13:08, Tarmo Johannes
>>>>>>
>>> <[hidden email]
>>>>>>             <mailto:[hidden email]>
>>>>>> > wrote:
>>>>>>
>>>>>>                 String from array witk k-index is still a k-time
>>>>>>
>>> string
>>>
>>>>>>                 and chget does not get it at i-time.
>>>>>>                 Very annoying. I think I needed to write another
>>>>>>                 instrument to do the work on i-time but I agree it
>>>>>>                 should not be that unconfortable.
>>>>>>                 Tarmo
>>>>>>
>>>>>>                 05.07.2017 14:50 kirjutas kuupäeval "Rory Walsh"
>>>>>>                 <
>>>>>> [hidden email] <mailto:[hidden email]>
>>>>>> >:
>>>>>>
>>>>>>                     Hmm. I thought the following would work, but I
>>>>>>
>>> get
>>>
>>>>>>                     an invalid channel name error?
>>>>>>
>>>>>>                     instr 100
>>>>>>                     kChan init 0
>>>>>>                     iCnt init 0
>>>>>>                     SChannels[] init 4
>>>>>>
>>>>>>                     while iCnt < 2 do
>>>>>>                        SChannels[iCnt] sprintf "rslider%d", iCnt+1
>>>>>>                        iCnt+=1
>>>>>>                     od
>>>>>>
>>>>>>                         if metro(1) == 1 && kChan < 2 then
>>>>>>                         printks SChannels[kChan], 0
>>>>>>                             chnset k(1), SChannels[kChan]
>>>>>>                             ;printks "Value of slider channel: %f",
>>>>>>
>>> 0,
>>>
>>>>>>                     chnget:k(SChannels[kChan])
>>>>>>                             kChan+=1
>>>>>>                         endif
>>>>>>
>>>>>>                     endin
>>>>>>
>>>>>>                     On 5 July 2017 at 12:05, Rory Walsh
>>>>>>                     <
>>>>>> [hidden email] <mailto:[hidden email]>
>>>>>> >
>>>>>>
>>> wrote:
>>>
>>>>>>                         Thanks Tarmo. This sounds familiar now! I
>>>>>>
>>> think
>>>
>>>>>>                         to avoid this in the past I used arrays,
>>>>>>
>>> and
>>>
>>>>>>                         then used the strings from the arrays to
>>>>>>
>>> query
>>>
>>>>>>                         my channels. That should work.
>>>>>>
>>>>>>                         On 5 July 2017 at 11:51, Tarmo Johannes
>>>>>>                         <
>>>>>> [hidden email]
>>> <mailto:[hidden email]>
>>> >
>>>
>>>>>>                         wrote:
>>>>>>
>>>>>>                             I think chnget takes string only in
>>>>>>
>>> init
>>>
>>>>>>                             time so all later k-time operations are
>>>>>>
>>> void.
>>>
>>>>>>                             This is of course quite a problem in
>>>>>>
>>> many
>>>
>>>>>>                             cases...
>>>>>>                             Tarmo
>>>>>>
>>>>>>                             05.07.2017 13:08 kirjutas kuupäeval
>>>>>>
>>> "Rory
>>>
>>>>>>                             Walsh" <[hidden email]
>>>>>>
>>>>>>                            
>>>>>> <mailto:[hidden email]>
>>>>>> >:
>>>>>>
>>>>>>
>>>>>>                                 As far as I can see, the following
>>>>>>
>>> code
>>>
>>>>>>                                 should set the values of two
>>>>>>
>>> channels to
>>>
>>>>>>                                 1, but only manages to set the
>>>>>>
>>> first
>>>
>>>>>>                                 channel? The value of the second
>>>>>>                                 channels remains at 0 even after
>>>>>>
>>> chnset
>>>
>>>>>>                                 is called. I vaguely remember
>>>>>>
>>> coming
>>>
>>>>>>                                 across this issue before, but can't
>>>>>>
>>> for
>>>
>>>>>>                                 the life of me remember how I
>>>>>>
>>> resolved
>>>
>>>>>>                                 it...
>>>>>>
>>>>>>                                 <CsoundSynthesizer>
>>>>>>                                 <CsOptions>
>>>>>>                                 -odac
>>>>>>                                 </CsOptions>
>>>>>>                                 <CsInstruments>
>>>>>>                                 sr = 44100
>>>>>>                                 ksmps = 32
>>>>>>                                 nchnls = 2
>>>>>>                                 0dbfs = 1
>>>>>>
>>>>>>
>>>>>>                                 instr 100
>>>>>>                                 kChan init 1
>>>>>>                                 kVal init 1
>>>>>>
>>>>>>                                     if metro(1) == 1 && kChan < 3
>>>>>>
>>> then
>>>
>>>>>>                                          Schannel sprintfk
>>>>>>
>>> "rslider%d",
>>>
>>>>>>                                 kChan
>>>>>>                                          chnset k(1), Schannel
>>>>>>                                          printks
>>>>>>
>>> "Slider%dVal:%f\n", 0,
>>>
>>>>>>                                 kChan, chnget:k(Schannel)
>>>>>>                                          kChan+=1
>>>>>>                                     endif
>>>>>>
>>>>>>                                 endin
>>>>>>
>>>>>>                                 </CsInstruments>
>>>>>>                                 <CsScore>
>>>>>>                                 i100 0 z
>>>>>>                                 </CsScore>
>>>>>>                                 </CsoundSynthesizer>
>>>>>>                                 Csound mailing list
>>>>>>                                
>>>>>> [hidden email]
>>>>>>
>>>>>>                                
>>>>>> <mailto:[hidden email]>
>>>>>>
>>>>>>                                
>>>>>> https://listserv.heanet.ie/cgi
>>>>>>
>>>>>> -bin/wa?A0=CSOUND
>>>>>>                                
>>>>>> <https://listserv.heanet.ie/cg
>>>>>> i-bin/wa?A0=CSOUND>
>>>>>>
>>>>>>                                 Send bugs reports to
>>>>>>                                
>>>>>>
>>> https://github.com/csound/csound/issues
>>>>>>                                
>>>>>>
>>> <https://github.com/csound/csound/issues>
>>>>>> Discussions
>>>>>>                                 of bugs and features can be posted
>>>>>>
>>> here
>>>
>>>>>>
>>>>>>                             Csound mailing list
>>>>>>                            
>>>>>> [hidden email]
>>>>>>
>>>>>>                            
>>>>>> <mailto:[hidden email]>
>>>>>>
>>>>>>                            
>>>>>> https://listserv.heanet.ie/cgi
>>>>>>
>>>>>> -bin/wa?A0=CSOUND
>>>>>>                            
>>>>>> <https://listserv.heanet.ie/cg
>>>>>> i-bin/wa?A0=CSOUND>
>>>>>>
>>>>>>                             Send bugs reports to
>>>>>>                            
>>>>>> https://github.com/csound/csound/issues
>>>>>>
>>>>>>                            
>>>>>>
>>> <https://github.com/csound/csound/issues>
>>>>>>                             Discussions of bugs and features can be
>>>>>>                             posted here
>>>>>>
>>>>>>
>>>>>>
>>>>>>                     Csound mailing list
>>>>>> [hidden email]
>>>>>>
>>>>>>                    
>>>>>> <mailto:[hidden email]>
>>>>>>
>>>>>>                    
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>
>>>>>>                    
>>>>>>
>>> <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>>>>>>                     Send bugs reports to
>>>>>>                    
>>>>>> https://github.com/csound/csound/issues
>>>>>>
>>>>>>                    
>>>>>> <https://github.com/csound/csound/issues>
>>>>>>
>>>>>>                     Discussions of bugs and features can be posted
>>>>>>
>>> here
>>>
>>>>>>                 Csound mailing list [hidden email]
>>>>>>
>>>>>>                
>>>>>> <mailto:[hidden email]>
>>>>>>
>>>>>>                
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>
>>>>>>                
>>>>>> <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>>> Send
>>>
>>>>>>                 bugs reports to
>>>>>>
>>> https://github.com/csound/csound/issues
>>>>>>                 <https://github.com/csound/csound/issues>
>>> Discussions of
>>>
>>>>>>                 bugs and features can be posted here
>>>>>>
>>>>>>
>>>>>>             Csound mailing list
>>>>>> [hidden email]
>>>>>>
>>>>>>            
>>>>>> <mailto:[hidden email]>
>>>>>>
>>>>>>            
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>
>>>>>>            
>>>>>> <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>>>>>>  Send
>>>>>>
>>> bugs
>>>
>>>>>>             reports to https://github.com/csound/csound/issues
>>>>>>
>>>>>>            
>>>>>> <https://github.com/csound/csound/issues>
>>>>>>  Discussions
>>>>>>
>>> of
>>>
>>>>>>             bugs and features can be posted here
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>         --
>>>>>>
>>>>>>         Oeyvind Brandtsegg
>>>>>>         Professor of Music Technology
>>>>>>         NTNU
>>>>>>         7491 Trondheim
>>>>>>         Norway
>>>>>>         Cell: +47 92 203 205
>>>>>>
>>>>>>        
>>>>>> http://www.partikkelaudio.com/
>>>>>>
>>>>>>        
>>>>>> http://crossadaptive.hf.ntnu.no
>>> <http://crossadaptive.hf.ntnu.no
>>>>>>         http://gdsp.hf.ntnu.no/
>>>>>>
>>>>>>        
>>>>>> http://soundcloud.com/brandtsegg
>>> <http://soundcloud.com/brandts
>>>>>> egg>
>>>>>>        
>>>>>> http://flyndresang.no/
>>>>>>
>>>>>>        
>>>>>> http://soundcloud.com/t-emp
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>     --
>>>>>>
>>>>>>     Oeyvind Brandtsegg
>>>>>>     Professor of Music Technology
>>>>>>     NTNU
>>>>>>     7491 Trondheim
>>>>>>     Norway
>>>>>>     Cell: +47 92 203 205
>>>>>>
>>>>>>    
>>>>>> http://www.partikkelaudio.com/
>>>>>>
>>>>>>    
>>>>>> http://crossadaptive.hf.ntnu.no
>>> <http://crossadaptive.hf.ntnu.no>
>>>>>>     http://gdsp.hf.ntnu.no/
>>>>>>
>>>>>>    
>>>>>> http://soundcloud.com/brandtsegg
>>> <http://soundcloud.com/brandtsegg>
>>>>>>     http://flyndresang.no/
>>>>>>
>>>>>>    
>>>>>> http://soundcloud.com/t-emp
>>>>>>
>>>>>>
>>>>>>     Csound mailing list
>>>>>> [hidden email]
>>>>>>
>>>>>>    
>>>>>> <mailto:[hidden email]>
>>>>>>
>>>>>>    
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>
>>>>>>    
>>>>>> <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>>>>>>  Send bugs
>>>>>>
>>> reports
>>>
>>>>>>     to https://github.com/csound/csound/issues
>>>>>>
>>>>>>    
>>>>>> <https://github.com/csound/csound/issues>
>>>>>>  Discussions of bugs
>>>>>>
>>> and
>>>
>>>>>>     features can be posted here
>>>>>>
>>>>>>
>>>>>> Csound mailing list
>>>>>> [hidden email]
>>>>>> <mailto:[hidden email]>
>>>>>> 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
>>>>>
>>>>> [hidden email]
>>>>> 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 [hidden email]
>>>> 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
>>>> [hidden email]
>>> 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
>>>
>>> [hidden email]
>>> 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
>>
>> [hidden email]
>> 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 [hidden email] 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

rorywalsh
Here's a summary. The following instrument tries to create and retrieve the values of two channels, "channel1" and "channel2". It succeeds in setting the value of "channel1" but not "channel2"


//=========================================================
instr 100
kChan init 1
kVal init 1

    if metro(1) == 1 && kChan < 3 then
         Schannel sprintfk "channel%d", kChan
         chnset k(1), Schannel
         printks "Channel%dVal:%f\n", 0, kChan, chnget:k(Schannel)
         kChan+=1
    endif

endin

//=========================================================

I then thought I might be able to use arrays, but that didn't work either.  

//=========================================================
instr 100
kChan init 0
iCnt init 0
SChannels[] init 4

while iCnt < 2 do
    SChannels[iCnt] sprintf "rslider%d", iCnt+1
    iCnt+=1
od

    if metro(1) == 1 && kChan < 2 then
     printks SChannels[kChan], 0
        chnset k(1), SChannels[kChan]
        ;printks "Value of slider channel: %f", 0, chnget:k(SChannels[kChan])
        kChan+=1
    endif

endin
//=========================================================

Some reinit solutions have been proposed. While they will work, I would rather not have instruments whose sole purposes is to create possible channel names at i-time. 




On 6 July 2017 at 09:14, Victor Lazzarini <[hidden email]> wrote:
I am a bit late in this conversation. I thought chnget worked at k-time already? What is the problem?
If it is to do with arrays, it might not be a question of chnget but of arrays access?

Remember the semantics of access …[k] is at k-time. If you want to access at i-time, use …[i]
So, for instance, see this


chn_S "test", 3

instr 1
Sarr[] init 2
Sarr[0] = "hello\n"
Sarr[1] = "world\n"

i1 = 0
k1 = 1

chnset Sarr[k1], "test"
S1 chnget "test"
printks S1,0.5

chnset Sarr[i1], "test"
S1 chnget "test"
prints S1

endin


========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 6 Jul 2017, at 01:29, Guillermo Senna <[hidden email]> wrote:
>
> Which function will impact more on performance,  John? csoundGetChannelPtr or csoundGetChannelLock? I see however that chnset for S-variables has nearly identical functions for init and performance.
>
>
> On 05/07/17 18:01, John ff wrote:
>> The problem is more to do with the calling of the init code again.  This could be a big hit in some cases.
>>
>> ⁣Sent from TypeApp ​
>>
>> On 5 Jul 2017, 19:18, at 19:18, Oeyvind Brandtsegg
>> <[hidden email]>
>>  wrote:
>>
>>> Hmm, but this could make the opcodes more CPU intensive. I guess k rate
>>> strings are more expensive than k rate floats.
>>>
>>> On Jul 5, 2017 8:08 PM, "Tarmo Johannes"
>>> <[hidden email]>
>>>  wrote:
>>>
>>>
>>>> Yes, it would be more than welcome. Also for OSCsend and similar
>>>>
>>> opcodes.
>>>
>>>> I e if opcode operates at k-time it should be capable to read string
>>>> constructed at k-time.
>>>>
>>>> Tarmo.
>>>>
>>>>
>>>> 05.07.2017 20:09 kirjutas kuupäeval "Rory Walsh"
>>>> <[hidden email]>
>>>> :
>>>>
>>>> I think both of these solutions would work. I think it would be nice
>>>> though if we could do it straight out of the box.
>>>>
>>>> On 5 July 2017 at 17:37, joachim heintz
>>>> <[hidden email]>
>>>>  wrote:
>>>>
>>>>
>>>>> i think what you could do is to call an instrument which does the
>>>>>
>>> job at
>>>
>>>>> i-time:
>>>>>
>>>>> instr 100
>>>>> kChan init 1
>>>>> kVal init 1
>>>>>
>>>>>     if metro(1) == 1 && kChan < 3 then
>>>>>          event "i", "Reset", 0, 1, kChan, kVal
>>>>>          kChan+=1
>>>>>     endif
>>>>>
>>>>> endin
>>>>>
>>>>> instr Reset
>>>>>
>>>>>  Schannel sprintf "rslider%d", p4
>>>>>          chnset p5, Schannel
>>>>>          prints "Slider%dVal:%f\n", p4, chnget:i(Schannel)
>>>>>  turnoff
>>>>>
>>>>> endin
>>>>>
>>>>>
>>>>> would this work for you?
>>>>>         joachim
>>>>>
>>>>>
>>>>>
>>>>> On 05/07/17 15:24, Rory Walsh wrote:
>>>>>
>>>>>
>>>>>> Probably, to it seems very cumbersome. I wonder is there any way
>>>>>>
>>> chnget
>>>
>>>>>> can be updated to deal with k-time strings?
>>>>>>
>>>>>> On 5 July 2017 at 14:16, Oeyvind Brandtsegg
>>>>>>
>>> <[hidden email]
>>>>>> <mailto:[hidden email]>
>>>>>> > wrote:
>>>>>>
>>>>>>     (not tested here, beware of typos)
>>>>>>
>>>>>>     2017-07-05 15:16 GMT+02:00 Oeyvind Brandtsegg
>>>>>>     <
>>>>>> [hidden email] <mailto:[hidden email]>
>>>>>> >:
>>>>>>
>>>>>>         Could you do:
>>>>>>
>>>>>>         if metro(1) == 1 && kChan < 3 then
>>>>>>           if changed(kChan) then
>>>>>>             reinit chan_name
>>>>>>           endif
>>>>>>           chan_name:
>>>>>>           Schannel sprintf "rslider%d", i(kChan)
>>>>>>           chnset k(1), Schannel
>>>>>>           rireturn
>>>>>>
>>>>>>         ?
>>>>>>
>>>>>>         2017-07-05 14:45 GMT+02:00 Rory Walsh <
>>>>>> [hidden email]
>>>>>>
>>>>>>
>>>>>> <mailto:[hidden email]>
>>>>>> >:
>>>>>>
>>>>>>             Ouch. That sounds like a nightmare. Was it always this
>>>>>>
>>> way?
>>>
>>>>>>             I can't seem to remember having those issues before.
>>>>>>
>>>>>>             On 5 July 2017 at 13:08, Tarmo Johannes
>>>>>>
>>> <[hidden email]
>>>>>>             <mailto:[hidden email]>
>>>>>> > wrote:
>>>>>>
>>>>>>                 String from array witk k-index is still a k-time
>>>>>>
>>> string
>>>
>>>>>>                 and chget does not get it at i-time.
>>>>>>                 Very annoying. I think I needed to write another
>>>>>>                 instrument to do the work on i-time but I agree it
>>>>>>                 should not be that unconfortable.
>>>>>>                 Tarmo
>>>>>>
>>>>>>                 05.07.2017 14:50 kirjutas kuupäeval "Rory Walsh"
>>>>>>                 <
>>>>>> [hidden email] <mailto:[hidden email]>
>>>>>> >:
>>>>>>
>>>>>>                     Hmm. I thought the following would work, but I
>>>>>>
>>> get
>>>
>>>>>>                     an invalid channel name error?
>>>>>>
>>>>>>                     instr 100
>>>>>>                     kChan init 0
>>>>>>                     iCnt init 0
>>>>>>                     SChannels[] init 4
>>>>>>
>>>>>>                     while iCnt < 2 do
>>>>>>                        SChannels[iCnt] sprintf "rslider%d", iCnt+1
>>>>>>                        iCnt+=1
>>>>>>                     od
>>>>>>
>>>>>>                         if metro(1) == 1 && kChan < 2 then
>>>>>>                         printks SChannels[kChan], 0
>>>>>>                             chnset k(1), SChannels[kChan]
>>>>>>                             ;printks "Value of slider channel: %f",
>>>>>>
>>> 0,
>>>
>>>>>>                     chnget:k(SChannels[kChan])
>>>>>>                             kChan+=1
>>>>>>                         endif
>>>>>>
>>>>>>                     endin
>>>>>>
>>>>>>                     On 5 July 2017 at 12:05, Rory Walsh
>>>>>>                     <
>>>>>> [hidden email] <mailto:[hidden email]>
>>>>>> >
>>>>>>
>>> wrote:
>>>
>>>>>>                         Thanks Tarmo. This sounds familiar now! I
>>>>>>
>>> think
>>>
>>>>>>                         to avoid this in the past I used arrays,
>>>>>>
>>> and
>>>
>>>>>>                         then used the strings from the arrays to
>>>>>>
>>> query
>>>
>>>>>>                         my channels. That should work.
>>>>>>
>>>>>>                         On 5 July 2017 at 11:51, Tarmo Johannes
>>>>>>                         <
>>>>>> [hidden email]
>>> <mailto:[hidden email]>
>>> >
>>>
>>>>>>                         wrote:
>>>>>>
>>>>>>                             I think chnget takes string only in
>>>>>>
>>> init
>>>
>>>>>>                             time so all later k-time operations are
>>>>>>
>>> void.
>>>
>>>>>>                             This is of course quite a problem in
>>>>>>
>>> many
>>>
>>>>>>                             cases...
>>>>>>                             Tarmo
>>>>>>
>>>>>>                             05.07.2017 13:08 kirjutas kuupäeval
>>>>>>
>>> "Rory
>>>
>>>>>>                             Walsh" <[hidden email]
>>>>>>
>>>>>>
>>>>>> <mailto:[hidden email]>
>>>>>> >:
>>>>>>
>>>>>>
>>>>>>                                 As far as I can see, the following
>>>>>>
>>> code
>>>
>>>>>>                                 should set the values of two
>>>>>>
>>> channels to
>>>
>>>>>>                                 1, but only manages to set the
>>>>>>
>>> first
>>>
>>>>>>                                 channel? The value of the second
>>>>>>                                 channels remains at 0 even after
>>>>>>
>>> chnset
>>>
>>>>>>                                 is called. I vaguely remember
>>>>>>
>>> coming
>>>
>>>>>>                                 across this issue before, but can't
>>>>>>
>>> for
>>>
>>>>>>                                 the life of me remember how I
>>>>>>
>>> resolved
>>>
>>>>>>                                 it...
>>>>>>
>>>>>>                                 <CsoundSynthesizer>
>>>>>>                                 <CsOptions>
>>>>>>                                 -odac
>>>>>>                                 </CsOptions>
>>>>>>                                 <CsInstruments>
>>>>>>                                 sr = 44100
>>>>>>                                 ksmps = 32
>>>>>>                                 nchnls = 2
>>>>>>                                 0dbfs = 1
>>>>>>
>>>>>>
>>>>>>                                 instr 100
>>>>>>                                 kChan init 1
>>>>>>                                 kVal init 1
>>>>>>
>>>>>>                                     if metro(1) == 1 && kChan < 3
>>>>>>
>>> then
>>>
>>>>>>                                          Schannel sprintfk
>>>>>>
>>> "rslider%d",
>>>
>>>>>>                                 kChan
>>>>>>                                          chnset k(1), Schannel
>>>>>>                                          printks
>>>>>>
>>> "Slider%dVal:%f\n", 0,
>>>
>>>>>>                                 kChan, chnget:k(Schannel)
>>>>>>                                          kChan+=1
>>>>>>                                     endif
>>>>>>
>>>>>>                                 endin
>>>>>>
>>>>>>                                 </CsInstruments>
>>>>>>                                 <CsScore>
>>>>>>                                 i100 0 z
>>>>>>                                 </CsScore>
>>>>>>                                 </CsoundSynthesizer>
>>>>>>                                 Csound mailing list
>>>>>>
>>>>>> [hidden email]
>>>>>>
>>>>>>
>>>>>> <mailto:[hidden email]>
>>>>>>
>>>>>>
>>>>>> https://listserv.heanet.ie/cgi
>>>>>>
>>>>>> -bin/wa?A0=CSOUND
>>>>>>
>>>>>> <https://listserv.heanet.ie/cg
>>>>>> i-bin/wa?A0=CSOUND>
>>>>>>
>>>>>>                                 Send bugs reports to
>>>>>>
>>>>>>
>>> https://github.com/csound/csound/issues
>>>>>>
>>>>>>
>>> <https://github.com/csound/csound/issues>
>>>>>> Discussions
>>>>>>                                 of bugs and features can be posted
>>>>>>
>>> here
>>>
>>>>>>
>>>>>>                             Csound mailing list
>>>>>>
>>>>>> [hidden email]
>>>>>>
>>>>>>
>>>>>> <mailto:[hidden email]>
>>>>>>
>>>>>>
>>>>>> https://listserv.heanet.ie/cgi
>>>>>>
>>>>>> -bin/wa?A0=CSOUND
>>>>>>
>>>>>> <https://listserv.heanet.ie/cg
>>>>>> i-bin/wa?A0=CSOUND>
>>>>>>
>>>>>>                             Send bugs reports to
>>>>>>
>>>>>> https://github.com/csound/csound/issues
>>>>>>
>>>>>>
>>>>>>
>>> <https://github.com/csound/csound/issues>
>>>>>>                             Discussions of bugs and features can be
>>>>>>                             posted here
>>>>>>
>>>>>>
>>>>>>
>>>>>>                     Csound mailing list
>>>>>> [hidden email]
>>>>>>
>>>>>>
>>>>>> <mailto:[hidden email]>
>>>>>>
>>>>>>
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>
>>>>>>
>>>>>>
>>> <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>>>>>>                     Send bugs reports to
>>>>>>
>>>>>> https://github.com/csound/csound/issues
>>>>>>
>>>>>>
>>>>>> <https://github.com/csound/csound/issues>
>>>>>>
>>>>>>                     Discussions of bugs and features can be posted
>>>>>>
>>> here
>>>
>>>>>>                 Csound mailing list [hidden email]
>>>>>>
>>>>>>
>>>>>> <mailto:[hidden email]>
>>>>>>
>>>>>>
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>
>>>>>>
>>>>>> <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>>> Send
>>>
>>>>>>                 bugs reports to
>>>>>>
>>> https://github.com/csound/csound/issues
>>>>>>                 <https://github.com/csound/csound/issues>
>>> Discussions of
>>>
>>>>>>                 bugs and features can be posted here
>>>>>>
>>>>>>
>>>>>>             Csound mailing list
>>>>>> [hidden email]
>>>>>>
>>>>>>
>>>>>> <mailto:[hidden email]>
>>>>>>
>>>>>>
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>
>>>>>>
>>>>>> <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>>>>>>  Send
>>>>>>
>>> bugs
>>>
>>>>>>             reports to https://github.com/csound/csound/issues
>>>>>>
>>>>>>
>>>>>> <https://github.com/csound/csound/issues>
>>>>>>  Discussions
>>>>>>
>>> of
>>>
>>>>>>             bugs and features can be posted here
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>         --
>>>>>>
>>>>>>         Oeyvind Brandtsegg
>>>>>>         Professor of Music Technology
>>>>>>         NTNU
>>>>>>         7491 Trondheim
>>>>>>         Norway
>>>>>>         Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205">+47 92 203 205
>>>>>>
>>>>>>
>>>>>> http://www.partikkelaudio.com/
>>>>>>
>>>>>>
>>>>>> http://crossadaptive.hf.ntnu.no
>>> <http://crossadaptive.hf.ntnu.no
>>>>>>         http://gdsp.hf.ntnu.no/
>>>>>>
>>>>>>
>>>>>> http://soundcloud.com/brandtsegg
>>> <http://soundcloud.com/brandts
>>>>>> egg>
>>>>>>
>>>>>> http://flyndresang.no/
>>>>>>
>>>>>>
>>>>>> http://soundcloud.com/t-emp
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>     --
>>>>>>
>>>>>>     Oeyvind Brandtsegg
>>>>>>     Professor of Music Technology
>>>>>>     NTNU
>>>>>>     7491 Trondheim
>>>>>>     Norway
>>>>>>     Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205">+47 92 203 205
>>>>>>
>>>>>>
>>>>>> http://www.partikkelaudio.com/
>>>>>>
>>>>>>
>>>>>> http://crossadaptive.hf.ntnu.no
>>> <http://crossadaptive.hf.ntnu.no>
>>>>>>     http://gdsp.hf.ntnu.no/
>>>>>>
>>>>>>
>>>>>> http://soundcloud.com/brandtsegg
>>> <http://soundcloud.com/brandtsegg>
>>>>>>     http://flyndresang.no/
>>>>>>
>>>>>>
>>>>>> http://soundcloud.com/t-emp
>>>>>>
>>>>>>
>>>>>>     Csound mailing list
>>>>>> [hidden email]
>>>>>>
>>>>>>
>>>>>> <mailto:[hidden email]>
>>>>>>
>>>>>>
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>
>>>>>>
>>>>>> <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>>>>>>  Send bugs
>>>>>>
>>> reports
>>>
>>>>>>     to https://github.com/csound/csound/issues
>>>>>>
>>>>>>
>>>>>> <https://github.com/csound/csound/issues>
>>>>>>  Discussions of bugs
>>>>>>
>>> and
>>>
>>>>>>     features can be posted here
>>>>>>
>>>>>>
>>>>>> Csound mailing list
>>>>>> [hidden email]
>>>>>> <mailto:[hidden email]>
>>>>>> 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
>>>>>
>>>>> [hidden email]
>>>>> 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 [hidden email]
>>>> 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
>>>> [hidden email]
>>> 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
>>>
>>> [hidden email]
>>> 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
>>
>> [hidden email]
>> 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 [hidden email] 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
[hidden email]
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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] issue with channels..

Victor Lazzarini
Ok, so the problem is that chnset does read strings at perf-time. I remember this one from before,
it finds the channel at i-time and uses it. Did we not change this at one point? Or did chnget change but
not chnset?

Anyway. I’d prefer if any changes we made were postponed. The bugfix release is already very complicated
as it is and I fear introducing more issues.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 6 Jul 2017, at 10:02, Rory Walsh <[hidden email]> wrote:
>
> Here's a summary. The following instrument tries to create and retrieve the values of two channels, "channel1" and "channel2". It succeeds in setting the value of "channel1" but not "channel2"
>
>
> //=========================================================
> instr 100
> kChan init 1
> kVal init 1
>
>     if metro(1) == 1 && kChan < 3 then
>          Schannel sprintfk "channel%d", kChan
>          chnset k(1), Schannel
>          printks "Channel%dVal:%f\n", 0, kChan, chnget:k(Schannel)
>          kChan+=1
>     endif
>
> endin
>
> //=========================================================
>
> I then thought I might be able to use arrays, but that didn't work either.  
>
> //=========================================================
> instr 100
> kChan init 0
> iCnt init 0
> SChannels[] init 4
>
> while iCnt < 2 do
>    SChannels[iCnt] sprintf "rslider%d", iCnt+1
>    iCnt+=1
> od
>
>     if metro(1) == 1 && kChan < 2 then
>     printks SChannels[kChan], 0
>         chnset k(1), SChannels[kChan]
>         ;printks "Value of slider channel: %f", 0, chnget:k(SChannels[kChan])
>         kChan+=1
>     endif
>
> endin
> //=========================================================
>
> Some reinit solutions have been proposed. While they will work, I would rather not have instruments whose sole purposes is to create possible channel names at i-time.
>
>
>
>
> On 6 July 2017 at 09:14, Victor Lazzarini <[hidden email]> wrote:
> I am a bit late in this conversation. I thought chnget worked at k-time already? What is the problem?
> If it is to do with arrays, it might not be a question of chnget but of arrays access?
>
> Remember the semantics of access …[k] is at k-time. If you want to access at i-time, use …[i]
> So, for instance, see this
>
>
> chn_S "test", 3
>
> instr 1
> Sarr[] init 2
> Sarr[0] = "hello\n"
> Sarr[1] = "world\n"
>
> i1 = 0
> k1 = 1
>
> chnset Sarr[k1], "test"
> S1 chnget "test"
> printks S1,0.5
>
> chnset Sarr[i1], "test"
> S1 chnget "test"
> prints S1
>
> endin
>
>
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
> > On 6 Jul 2017, at 01:29, Guillermo Senna <[hidden email]> wrote:
> >
> > Which function will impact more on performance,  John? csoundGetChannelPtr or csoundGetChannelLock? I see however that chnset for S-variables has nearly identical functions for init and performance.
> >
> >
> > On 05/07/17 18:01, John ff wrote:
> >> The problem is more to do with the calling of the init code again.  This could be a big hit in some cases.
> >>
> >> ⁣Sent from TypeApp ​
> >>
> >> On 5 Jul 2017, 19:18, at 19:18, Oeyvind Brandtsegg
> >> <[hidden email]>
> >>  wrote:
> >>
> >>> Hmm, but this could make the opcodes more CPU intensive. I guess k rate
> >>> strings are more expensive than k rate floats.
> >>>
> >>> On Jul 5, 2017 8:08 PM, "Tarmo Johannes"
> >>> <[hidden email]>
> >>>  wrote:
> >>>
> >>>
> >>>> Yes, it would be more than welcome. Also for OSCsend and similar
> >>>>
> >>> opcodes.
> >>>
> >>>> I e if opcode operates at k-time it should be capable to read string
> >>>> constructed at k-time.
> >>>>
> >>>> Tarmo.
> >>>>
> >>>>
> >>>> 05.07.2017 20:09 kirjutas kuupäeval "Rory Walsh"
> >>>> <[hidden email]>
> >>>> :
> >>>>
> >>>> I think both of these solutions would work. I think it would be nice
> >>>> though if we could do it straight out of the box.
> >>>>
> >>>> On 5 July 2017 at 17:37, joachim heintz
> >>>> <[hidden email]>
> >>>>  wrote:
> >>>>
> >>>>
> >>>>> i think what you could do is to call an instrument which does the
> >>>>>
> >>> job at
> >>>
> >>>>> i-time:
> >>>>>
> >>>>> instr 100
> >>>>> kChan init 1
> >>>>> kVal init 1
> >>>>>
> >>>>>     if metro(1) == 1 && kChan < 3 then
> >>>>>          event "i", "Reset", 0, 1, kChan, kVal
> >>>>>          kChan+=1
> >>>>>     endif
> >>>>>
> >>>>> endin
> >>>>>
> >>>>> instr Reset
> >>>>>
> >>>>>  Schannel sprintf "rslider%d", p4
> >>>>>          chnset p5, Schannel
> >>>>>          prints "Slider%dVal:%f\n", p4, chnget:i(Schannel)
> >>>>>  turnoff
> >>>>>
> >>>>> endin
> >>>>>
> >>>>>
> >>>>> would this work for you?
> >>>>>         joachim
> >>>>>
> >>>>>
> >>>>>
> >>>>> On 05/07/17 15:24, Rory Walsh wrote:
> >>>>>
> >>>>>
> >>>>>> Probably, to it seems very cumbersome. I wonder is there any way
> >>>>>>
> >>> chnget
> >>>
> >>>>>> can be updated to deal with k-time strings?
> >>>>>>
> >>>>>> On 5 July 2017 at 14:16, Oeyvind Brandtsegg
> >>>>>>
> >>> <[hidden email]
> >>>>>> <mailto:[hidden email]>
> >>>>>> > wrote:
> >>>>>>
> >>>>>>     (not tested here, beware of typos)
> >>>>>>
> >>>>>>     2017-07-05 15:16 GMT+02:00 Oeyvind Brandtsegg
> >>>>>>     <
> >>>>>> [hidden email] <mailto:[hidden email]>
> >>>>>> >:
> >>>>>>
> >>>>>>         Could you do:
> >>>>>>
> >>>>>>         if metro(1) == 1 && kChan < 3 then
> >>>>>>           if changed(kChan) then
> >>>>>>             reinit chan_name
> >>>>>>           endif
> >>>>>>           chan_name:
> >>>>>>           Schannel sprintf "rslider%d", i(kChan)
> >>>>>>           chnset k(1), Schannel
> >>>>>>           rireturn
> >>>>>>
> >>>>>>         ?
> >>>>>>
> >>>>>>         2017-07-05 14:45 GMT+02:00 Rory Walsh <
> >>>>>> [hidden email]
> >>>>>>
> >>>>>>
> >>>>>> <mailto:[hidden email]>
> >>>>>> >:
> >>>>>>
> >>>>>>             Ouch. That sounds like a nightmare. Was it always this
> >>>>>>
> >>> way?
> >>>
> >>>>>>             I can't seem to remember having those issues before.
> >>>>>>
> >>>>>>             On 5 July 2017 at 13:08, Tarmo Johannes
> >>>>>>
> >>> <[hidden email]
> >>>>>>             <mailto:[hidden email]>
> >>>>>> > wrote:
> >>>>>>
> >>>>>>                 String from array witk k-index is still a k-time
> >>>>>>
> >>> string
> >>>
> >>>>>>                 and chget does not get it at i-time.
> >>>>>>                 Very annoying. I think I needed to write another
> >>>>>>                 instrument to do the work on i-time but I agree it
> >>>>>>                 should not be that unconfortable.
> >>>>>>                 Tarmo
> >>>>>>
> >>>>>>                 05.07.2017 14:50 kirjutas kuupäeval "Rory Walsh"
> >>>>>>                 <
> >>>>>> [hidden email] <mailto:[hidden email]>
> >>>>>> >:
> >>>>>>
> >>>>>>                     Hmm. I thought the following would work, but I
> >>>>>>
> >>> get
> >>>
> >>>>>>                     an invalid channel name error?
> >>>>>>
> >>>>>>                     instr 100
> >>>>>>                     kChan init 0
> >>>>>>                     iCnt init 0
> >>>>>>                     SChannels[] init 4
> >>>>>>
> >>>>>>                     while iCnt < 2 do
> >>>>>>                        SChannels[iCnt] sprintf "rslider%d", iCnt+1
> >>>>>>                        iCnt+=1
> >>>>>>                     od
> >>>>>>
> >>>>>>                         if metro(1) == 1 && kChan < 2 then
> >>>>>>                         printks SChannels[kChan], 0
> >>>>>>                             chnset k(1), SChannels[kChan]
> >>>>>>                             ;printks "Value of slider channel: %f",
> >>>>>>
> >>> 0,
> >>>
> >>>>>>                     chnget:k(SChannels[kChan])
> >>>>>>                             kChan+=1
> >>>>>>                         endif
> >>>>>>
> >>>>>>                     endin
> >>>>>>
> >>>>>>                     On 5 July 2017 at 12:05, Rory Walsh
> >>>>>>                     <
> >>>>>> [hidden email] <mailto:[hidden email]>
> >>>>>> >
> >>>>>>
> >>> wrote:
> >>>
> >>>>>>                         Thanks Tarmo. This sounds familiar now! I
> >>>>>>
> >>> think
> >>>
> >>>>>>                         to avoid this in the past I used arrays,
> >>>>>>
> >>> and
> >>>
> >>>>>>                         then used the strings from the arrays to
> >>>>>>
> >>> query
> >>>
> >>>>>>                         my channels. That should work.
> >>>>>>
> >>>>>>                         On 5 July 2017 at 11:51, Tarmo Johannes
> >>>>>>                         <
> >>>>>> [hidden email]
> >>> <mailto:[hidden email]>
> >>> >
> >>>
> >>>>>>                         wrote:
> >>>>>>
> >>>>>>                             I think chnget takes string only in
> >>>>>>
> >>> init
> >>>
> >>>>>>                             time so all later k-time operations are
> >>>>>>
> >>> void.
> >>>
> >>>>>>                             This is of course quite a problem in
> >>>>>>
> >>> many
> >>>
> >>>>>>                             cases...
> >>>>>>                             Tarmo
> >>>>>>
> >>>>>>                             05.07.2017 13:08 kirjutas kuupäeval
> >>>>>>
> >>> "Rory
> >>>
> >>>>>>                             Walsh" <[hidden email]
> >>>>>>
> >>>>>>
> >>>>>> <mailto:[hidden email]>
> >>>>>> >:
> >>>>>>
> >>>>>>
> >>>>>>                                 As far as I can see, the following
> >>>>>>
> >>> code
> >>>
> >>>>>>                                 should set the values of two
> >>>>>>
> >>> channels to
> >>>
> >>>>>>                                 1, but only manages to set the
> >>>>>>
> >>> first
> >>>
> >>>>>>                                 channel? The value of the second
> >>>>>>                                 channels remains at 0 even after
> >>>>>>
> >>> chnset
> >>>
> >>>>>>                                 is called. I vaguely remember
> >>>>>>
> >>> coming
> >>>
> >>>>>>                                 across this issue before, but can't
> >>>>>>
> >>> for
> >>>
> >>>>>>                                 the life of me remember how I
> >>>>>>
> >>> resolved
> >>>
> >>>>>>                                 it...
> >>>>>>
> >>>>>>                                 <CsoundSynthesizer>
> >>>>>>                                 <CsOptions>
> >>>>>>                                 -odac
> >>>>>>                                 </CsOptions>
> >>>>>>                                 <CsInstruments>
> >>>>>>                                 sr = 44100
> >>>>>>                                 ksmps = 32
> >>>>>>                                 nchnls = 2
> >>>>>>                                 0dbfs = 1
> >>>>>>
> >>>>>>
> >>>>>>                                 instr 100
> >>>>>>                                 kChan init 1
> >>>>>>                                 kVal init 1
> >>>>>>
> >>>>>>                                     if metro(1) == 1 && kChan < 3
> >>>>>>
> >>> then
> >>>
> >>>>>>                                          Schannel sprintfk
> >>>>>>
> >>> "rslider%d",
> >>>
> >>>>>>                                 kChan
> >>>>>>                                          chnset k(1), Schannel
> >>>>>>                                          printks
> >>>>>>
> >>> "Slider%dVal:%f\n", 0,
> >>>
> >>>>>>                                 kChan, chnget:k(Schannel)
> >>>>>>                                          kChan+=1
> >>>>>>                                     endif
> >>>>>>
> >>>>>>                                 endin
> >>>>>>
> >>>>>>                                 </CsInstruments>
> >>>>>>                                 <CsScore>
> >>>>>>                                 i100 0 z
> >>>>>>                                 </CsScore>
> >>>>>>                                 </CsoundSynthesizer>
> >>>>>>                                 Csound mailing list
> >>>>>>
> >>>>>> [hidden email]
> >>>>>>
> >>>>>>
> >>>>>> <mailto:[hidden email]>
> >>>>>>
> >>>>>>
> >>>>>> https://listserv.heanet.ie/cgi
> >>>>>>
> >>>>>> -bin/wa?A0=CSOUND
> >>>>>>
> >>>>>> <https://listserv.heanet.ie/cg
> >>>>>> i-bin/wa?A0=CSOUND>
> >>>>>>
> >>>>>>                                 Send bugs reports to
> >>>>>>
> >>>>>>
> >>> https://github.com/csound/csound/issues
> >>>>>>
> >>>>>>
> >>> <https://github.com/csound/csound/issues>
> >>>>>> Discussions
> >>>>>>                                 of bugs and features can be posted
> >>>>>>
> >>> here
> >>>
> >>>>>>
> >>>>>>                             Csound mailing list
> >>>>>>
> >>>>>> [hidden email]
> >>>>>>
> >>>>>>
> >>>>>> <mailto:[hidden email]>
> >>>>>>
> >>>>>>
> >>>>>> https://listserv.heanet.ie/cgi
> >>>>>>
> >>>>>> -bin/wa?A0=CSOUND
> >>>>>>
> >>>>>> <https://listserv.heanet.ie/cg
> >>>>>> i-bin/wa?A0=CSOUND>
> >>>>>>
> >>>>>>                             Send bugs reports to
> >>>>>>
> >>>>>> https://github.com/csound/csound/issues
> >>>>>>
> >>>>>>
> >>>>>>
> >>> <https://github.com/csound/csound/issues>
> >>>>>>                             Discussions of bugs and features can be
> >>>>>>                             posted here
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>                     Csound mailing list
> >>>>>> [hidden email]
> >>>>>>
> >>>>>>
> >>>>>> <mailto:[hidden email]>
> >>>>>>
> >>>>>>
> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>
> >>>>>>
> >>>>>>
> >>> <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
> >>>>>>                     Send bugs reports to
> >>>>>>
> >>>>>> https://github.com/csound/csound/issues
> >>>>>>
> >>>>>>
> >>>>>> <https://github.com/csound/csound/issues>
> >>>>>>
> >>>>>>                     Discussions of bugs and features can be posted
> >>>>>>
> >>> here
> >>>
> >>>>>>                 Csound mailing list [hidden email]
> >>>>>>
> >>>>>>
> >>>>>> <mailto:[hidden email]>
> >>>>>>
> >>>>>>
> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>
> >>>>>>
> >>>>>> <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
> >>> Send
> >>>
> >>>>>>                 bugs reports to
> >>>>>>
> >>> https://github.com/csound/csound/issues
> >>>>>>                 <https://github.com/csound/csound/issues>
> >>> Discussions of
> >>>
> >>>>>>                 bugs and features can be posted here
> >>>>>>
> >>>>>>
> >>>>>>             Csound mailing list
> >>>>>> [hidden email]
> >>>>>>
> >>>>>>
> >>>>>> <mailto:[hidden email]>
> >>>>>>
> >>>>>>
> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>
> >>>>>>
> >>>>>> <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
> >>>>>>  Send
> >>>>>>
> >>> bugs
> >>>
> >>>>>>             reports to https://github.com/csound/csound/issues
> >>>>>>
> >>>>>>
> >>>>>> <https://github.com/csound/csound/issues>
> >>>>>>  Discussions
> >>>>>>
> >>> of
> >>>
> >>>>>>             bugs and features can be posted here
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>         --
> >>>>>>
> >>>>>>         Oeyvind Brandtsegg
> >>>>>>         Professor of Music Technology
> >>>>>>         NTNU
> >>>>>>         7491 Trondheim
> >>>>>>         Norway
> >>>>>>         Cell: +47 92 203 205
> >>>>>>
> >>>>>>
> >>>>>> http://www.partikkelaudio.com/
> >>>>>>
> >>>>>>
> >>>>>> http://crossadaptive.hf.ntnu.no
> >>> <http://crossadaptive.hf.ntnu.no
> >>>>>>         http://gdsp.hf.ntnu.no/
> >>>>>>
> >>>>>>
> >>>>>> http://soundcloud.com/brandtsegg
> >>> <http://soundcloud.com/brandts
> >>>>>> egg>
> >>>>>>
> >>>>>> http://flyndresang.no/
> >>>>>>
> >>>>>>
> >>>>>> http://soundcloud.com/t-emp
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>     --
> >>>>>>
> >>>>>>     Oeyvind Brandtsegg
> >>>>>>     Professor of Music Technology
> >>>>>>     NTNU
> >>>>>>     7491 Trondheim
> >>>>>>     Norway
> >>>>>>     Cell: +47 92 203 205
> >>>>>>
> >>>>>>
> >>>>>> http://www.partikkelaudio.com/
> >>>>>>
> >>>>>>
> >>>>>> http://crossadaptive.hf.ntnu.no
> >>> <http://crossadaptive.hf.ntnu.no>
> >>>>>>     http://gdsp.hf.ntnu.no/
> >>>>>>
> >>>>>>
> >>>>>> http://soundcloud.com/brandtsegg
> >>> <http://soundcloud.com/brandtsegg>
> >>>>>>     http://flyndresang.no/
> >>>>>>
> >>>>>>
> >>>>>> http://soundcloud.com/t-emp
> >>>>>>
> >>>>>>
> >>>>>>     Csound mailing list
> >>>>>> [hidden email]
> >>>>>>
> >>>>>>
> >>>>>> <mailto:[hidden email]>
> >>>>>>
> >>>>>>
> >>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >>>>>>
> >>>>>>
> >>>>>> <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
> >>>>>>  Send bugs
> >>>>>>
> >>> reports
> >>>
> >>>>>>     to https://github.com/csound/csound/issues
> >>>>>>
> >>>>>>
> >>>>>> <https://github.com/csound/csound/issues>
> >>>>>>  Discussions of bugs
> >>>>>>
> >>> and
> >>>
> >>>>>>     features can be posted here
> >>>>>>
> >>>>>>
> >>>>>> Csound mailing list
> >>>>>> [hidden email]
> >>>>>> <mailto:[hidden email]>
> >>>>>> 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
> >>>>>
> >>>>> [hidden email]
> >>>>> 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 [hidden email]
> >>>> 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
> >>>> [hidden email]
> >>> 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
> >>>
> >>> [hidden email]
> >>> 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
> >>
> >> [hidden email]
> >> 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 [hidden email] 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
> [hidden email]
> 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 [hidden email] 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
[hidden email]
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
12
Loading...