Csound Csound-dev Csound-tekno Search About

Using stateful opcodes in the loop with arrays

Date2017-01-09 09:40
FromAnton Kholomiov
SubjectUsing stateful opcodes in the loop with arrays
I've got an array of control signals (gkVolumes in the code).
I'd like to apply portamento
to all signals in the array. But my guess that the code
like this:

~~~
kCount = 0
until (kCount == $SIZE) do
  ain inch (1 + kCount)
  kAmp port gkVolumes[kCount], 0.05
  gaOut += kAmp * ain
  kCount += 1
od
~~~

Is not going to work since the state for `port` is shared among dififerent cases.
I think that the same is the case for filtering an array in the loop.

How to do it right?

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

Date2017-01-09 12:55
Fromjpff
SubjectRe: Using stateful opcodes in the loop with arrays
Recursive UDO?

On Mon, 9 Jan 2017, Anton Kholomiov wrote:

> I've got an array of control signals (gkVolumes in the code).
> I'd like to apply portamento
> to all signals in the array. But my guess that the code
> like this:
> 
> ~~~
> kCount = 0
> until (kCount == $SIZE) do
>   ain inch (1 + kCount)
>   kAmp port gkVolumes[kCount], 0.05
>   gaOut += kAmp * ain
>   kCount += 1
> od
> ~~~
> 
> Is not going to work since the state for `port` is shared among dififerent
> cases.
> I think that the same is the case for filtering an array in the loop.
> 
> How to do it right?
> 
> Anton
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
>

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

Date2017-01-09 13:40
FromAnton Kholomiov
SubjectRe: Using stateful opcodes in the loop with arrays
Thanks for reply I guess that way it's going to work

2017-01-09 15:55 GMT+03:00 jpff <jpff@codemist.co.uk>:
Recursive UDO?


On Mon, 9 Jan 2017, Anton Kholomiov wrote:

I've got an array of control signals (gkVolumes in the code).
I'd like to apply portamento
to all signals in the array. But my guess that the code
like this:

~~~
kCount = 0
until (kCount == $SIZE) do
  ain inch (1 + kCount)
  kAmp port gkVolumes[kCount], 0.05
  gaOut += kAmp * ain
  kCount += 1
od
~~~

Is not going to work since the state for `port` is shared among dififerent
cases.
I think that the same is the case for filtering an array in the loop.

How to do it right?

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


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

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