Csound Csound-dev Csound-tekno Search About

[Csnd] While and audio arrays

Date2020-09-02 18:06
From"Jeanette C."
Subject[Csnd] While and audio arrays
Hey hey,
I think somehow I've fallen into the execution time trap, but I can't work out 
how. I'm working on a kind of bandpass-filter based vocoder. Since the number 
of bands is fixed, I use a few arrays:
kWidths[] init 10 ; bandwidths
iCentres[] = fillarray(v1, v2, ..., v10)
aCarBands[] init 10 ; analysis bands of the carrier
aModBands[] init 10 ; analysis bands of the modulator

Then there's the main analysis loop:
kIndex = 0
while (kIndex < 10) do
   aCarBands[kIndex] = butterbp(aCarrier, iCentres[kIndex], kWidths[kIndex])
   ...
od

Grabbing any of these bands, produces a VERY loud impulse and silence.


Setting the centre frequency to a literal value or a fixed element of the 
array - iCentres[5] - produces the expected results.

I also tried making the array iCentres an array kCentres with no change.

Adding print statement shows that all the values in iCentres/kCentres and 
kWidths are as expected.

Can any one guess a reason?

Best wishes,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Give me a sign...
Hit me Baby one more time <3
(Britney Spears)

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

Date2020-09-02 19:38
FromRory Walsh
SubjectRe: [Csnd] While and audio arrays
I don't think you can use opcodes like this in a loop. I think if you want to do something like this you need to use a recursive UDO? I could be wrong...

On Wed, 2 Sep 2020 at 18:06, Jeanette C. <julien@mail.upb.de> wrote:
Hey hey,
I think somehow I've fallen into the execution time trap, but I can't work out
how. I'm working on a kind of bandpass-filter based vocoder. Since the number
of bands is fixed, I use a few arrays:
kWidths[] init 10 ; bandwidths
iCentres[] = fillarray(v1, v2, ..., v10)
aCarBands[] init 10 ; analysis bands of the carrier
aModBands[] init 10 ; analysis bands of the modulator

Then there's the main analysis loop:
kIndex = 0
while (kIndex < 10) do
   aCarBands[kIndex] = butterbp(aCarrier, iCentres[kIndex], kWidths[kIndex])
   ...
od

Grabbing any of these bands, produces a VERY loud impulse and silence.


Setting the centre frequency to a literal value or a fixed element of the
array - iCentres[5] - produces the expected results.

I also tried making the array iCentres an array kCentres with no change.

Adding print statement shows that all the values in iCentres/kCentres and
kWidths are as expected.

Can any one guess a reason?

Best wishes,

Jeanette

--
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Give me a sign...
Hit me Baby one more time <3
(Britney Spears)

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

Date2020-09-02 19:44
Fromjohn
SubjectRe: [Csnd] While and audio arrays
+1

You want a searate instancefor each filter in theloop bt you are only 
getting oneand reusing it



On Wed, 2 Sep 2020, Rory Walsh wrote:

> I don't think you can use opcodes like this in a loop. I think if you want to
> do something like this you need to use a recursive UDO? I could be wrong...
> 
> On Wed, 2 Sep 2020 at 18:06, Jeanette C.  wrote:
>       Hey hey,
>       I think somehow I've fallen into the execution time trap, but I
>       can't work out
>       how. I'm working on a kind of bandpass-filter based vocoder. Since
>       the number
>       of bands is fixed, I use a few arrays:
>       kWidths[] init 10 ; bandwidths
>       iCentres[] = fillarray(v1, v2, ..., v10)
>       aCarBands[] init 10 ; analysis bands of the carrier
>       aModBands[] init 10 ; analysis bands of the modulator
>
>       Then there's the main analysis loop:
>       kIndex = 0
>       while (kIndex < 10) do
>          aCarBands[kIndex] = butterbp(aCarrier, iCentres[kIndex],
>       kWidths[kIndex])
>          ...
>       od
>
>       Grabbing any of these bands, produces a VERY loud impulse and
>       silence.
> 
>
>       Setting the centre frequency to a literal value or a fixed element
>       of the
>       array - iCentres[5] - produces the expected results.
>
>       I also tried making the array iCentres an array kCentres with no
>       change.
>
>       Adding print statement shows that all the values in
>       iCentres/kCentres and
>       kWidths are as expected.
>
>       Can any one guess a reason?
>
>       Best wishes,
>
>       Jeanette
>
>       --
>         * Website: http://juliencoder.de - for summer is a state of
>       sound
>         * Youtube:
>       https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
>         * Audiobombs: https://www.audiobombs.com/users/jeanette_c
>         * GitHub: https://github.com/jeanette-c
>
>       Give me a sign...
>       Hit me Baby one more time <3
>       (Britney Spears)
>
>       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

Date2020-09-02 19:52
FromRory Walsh
SubjectRe: [Csnd] While and audio arrays
And this, I believe, is the reason John was not a fan of these looping opcodes when they were introduced. After many years of getting stung by this very same issue, I am starting to agree with him. 

On Wed, 2 Sep 2020 at 19:44, john <jpff@codemist.co.uk> wrote:
+1

You want a searate instancefor each filter in theloop bt you are only
getting oneand reusing it



On Wed, 2 Sep 2020, Rory Walsh wrote:

> I don't think you can use opcodes like this in a loop. I think if you want to
> do something like this you need to use a recursive UDO? I could be wrong...
>
> On Wed, 2 Sep 2020 at 18:06, Jeanette C. <julien@mail.upb.de> wrote:
>       Hey hey,
>       I think somehow I've fallen into the execution time trap, but I
>       can't work out
>       how. I'm working on a kind of bandpass-filter based vocoder. Since
>       the number
>       of bands is fixed, I use a few arrays:
>       kWidths[] init 10 ; bandwidths
>       iCentres[] = fillarray(v1, v2, ..., v10)
>       aCarBands[] init 10 ; analysis bands of the carrier
>       aModBands[] init 10 ; analysis bands of the modulator
>
>       Then there's the main analysis loop:
>       kIndex = 0
>       while (kIndex < 10) do
>          aCarBands[kIndex] = butterbp(aCarrier, iCentres[kIndex],
>       kWidths[kIndex])
>          ...
>       od
>
>       Grabbing any of these bands, produces a VERY loud impulse and
>       silence.
>
>
>       Setting the centre frequency to a literal value or a fixed element
>       of the
>       array - iCentres[5] - produces the expected results.
>
>       I also tried making the array iCentres an array kCentres with no
>       change.
>
>       Adding print statement shows that all the values in
>       iCentres/kCentres and
>       kWidths are as expected.
>
>       Can any one guess a reason?
>
>       Best wishes,
>
>       Jeanette
>
>       --
>         * Website: http://juliencoder.de - for summer is a state of
>       sound
>         * Youtube:
>       https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
>         * Audiobombs: https://www.audiobombs.com/users/jeanette_c
>         * GitHub: https://github.com/jeanette-c
>
>       Give me a sign...
>       Hit me Baby one more time <3
>       (Britney Spears)
>
>       Csound mailing list
>       Csound@listserv.heanet.ie
>       https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>       Send bugs reports to
>               https://github.com/csound/csound/issues
>       Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
>

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

Date2020-09-02 19:56
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] While and audio arrays
The solution is to use recursion, as explained in the Csound book we did for Springer.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 2 Sep 2020, at 19:53, Rory Walsh <rorywalsh@ear.ie> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

And this, I believe, is the reason John was not a fan of these looping opcodes when they were introduced. After many years of getting stung by this very same issue, I am starting to agree with him. 

On Wed, 2 Sep 2020 at 19:44, john <jpff@codemist.co.uk> wrote:
+1

You want a searate instancefor each filter in theloop bt you are only
getting oneand reusing it



On Wed, 2 Sep 2020, Rory Walsh wrote:

> I don't think you can use opcodes like this in a loop. I think if you want to
> do something like this you need to use a recursive UDO? I could be wrong...
>
> On Wed, 2 Sep 2020 at 18:06, Jeanette C. <julien@mail.upb.de> wrote:
>       Hey hey,
>       I think somehow I've fallen into the execution time trap, but I
>       can't work out
>       how. I'm working on a kind of bandpass-filter based vocoder. Since
>       the number
>       of bands is fixed, I use a few arrays:
>       kWidths[] init 10 ; bandwidths
>       iCentres[] = fillarray(v1, v2, ..., v10)
>       aCarBands[] init 10 ; analysis bands of the carrier
>       aModBands[] init 10 ; analysis bands of the modulator
>
>       Then there's the main analysis loop:
>       kIndex = 0
>       while (kIndex < 10) do
>          aCarBands[kIndex] = butterbp(aCarrier, iCentres[kIndex],
>       kWidths[kIndex])
>          ...
>       od
>
>       Grabbing any of these bands, produces a VERY loud impulse and
>       silence.
>
>
>       Setting the centre frequency to a literal value or a fixed element
>       of the
>       array - iCentres[5] - produces the expected results.
>
>       I also tried making the array iCentres an array kCentres with no
>       change.
>
>       Adding print statement shows that all the values in
>       iCentres/kCentres and
>       kWidths are as expected.
>
>       Can any one guess a reason?
>
>       Best wishes,
>
>       Jeanette
>
>       --
>         * Website: http://juliencoder.de - for summer is a state of
>       sound
>         * Youtube:
>       https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
>         * Audiobombs: https://www.audiobombs.com/users/jeanette_c
>         * GitHub: https://github.com/jeanette-c
>
>       Give me a sign...
>       Hit me Baby one more time <3
>       (Britney Spears)
>
>       Csound mailing list
>       Csound@listserv.heanet.ie
>       https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>       Send bugs reports to
>               https://github.com/csound/csound/issues
>       Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
>

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

Date2020-09-02 20:02
FromSteven Yi
SubjectRe: [Csnd] While and audio arrays
Looping constructs are no different than labels+gotos, so the issue
has always been there.

On Wed, Sep 2, 2020 at 2:53 PM Rory Walsh  wrote:
>
> And this, I believe, is the reason John was not a fan of these looping opcodes when they were introduced. After many years of getting stung by this very same issue, I am starting to agree with him.
>
> On Wed, 2 Sep 2020 at 19:44, john  wrote:
>>
>> +1
>>
>> You want a searate instancefor each filter in theloop bt you are only
>> getting oneand reusing it
>>
>>
>>
>> On Wed, 2 Sep 2020, Rory Walsh wrote:
>>
>> > I don't think you can use opcodes like this in a loop. I think if you want to
>> > do something like this you need to use a recursive UDO? I could be wrong...
>> >
>> > On Wed, 2 Sep 2020 at 18:06, Jeanette C.  wrote:
>> >       Hey hey,
>> >       I think somehow I've fallen into the execution time trap, but I
>> >       can't work out
>> >       how. I'm working on a kind of bandpass-filter based vocoder. Since
>> >       the number
>> >       of bands is fixed, I use a few arrays:
>> >       kWidths[] init 10 ; bandwidths
>> >       iCentres[] = fillarray(v1, v2, ..., v10)
>> >       aCarBands[] init 10 ; analysis bands of the carrier
>> >       aModBands[] init 10 ; analysis bands of the modulator
>> >
>> >       Then there's the main analysis loop:
>> >       kIndex = 0
>> >       while (kIndex < 10) do
>> >          aCarBands[kIndex] = butterbp(aCarrier, iCentres[kIndex],
>> >       kWidths[kIndex])
>> >          ...
>> >       od
>> >
>> >       Grabbing any of these bands, produces a VERY loud impulse and
>> >       silence.
>> >
>> >
>> >       Setting the centre frequency to a literal value or a fixed element
>> >       of the
>> >       array - iCentres[5] - produces the expected results.
>> >
>> >       I also tried making the array iCentres an array kCentres with no
>> >       change.
>> >
>> >       Adding print statement shows that all the values in
>> >       iCentres/kCentres and
>> >       kWidths are as expected.
>> >
>> >       Can any one guess a reason?
>> >
>> >       Best wishes,
>> >
>> >       Jeanette
>> >
>> >       --
>> >         * Website: http://juliencoder.de - for summer is a state of
>> >       sound
>> >         * Youtube:
>> >       https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
>> >         * Audiobombs: https://www.audiobombs.com/users/jeanette_c
>> >         * GitHub: https://github.com/jeanette-c
>> >
>> >       Give me a sign...
>> >       Hit me Baby one more time <3
>> >       (Britney Spears)
>> >
>> >       Csound mailing list
>> >       Csound@listserv.heanet.ie
>> >       https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >       Send bugs reports to
>> >               https://github.com/csound/csound/issues
>> >       Discussions of bugs and features can be posted here
>> >
>> > Csound mailing list Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features can
>> > be posted here
>> >
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

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

Date2020-09-02 21:46
From"Jeanette C."
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] While and audio arrays
OK, recursion it is then. I almost feared as much. The while loop just looked 
so attractive, especially with arrays all round. Well, recursion it will be. 
;)

Best wishes and thanks all of you,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Give me a sign...
Hit me Baby one more time <3
(Britney Spears)

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

Date2020-09-04 04:21
FromJosh Moore
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] While and audio arrays
I ended up just coding a basic C program that automatically prints out as many iterations of whatever as i wanted so I can just dump it to a text file. You could probably do the same thing in bash or python or whatever but I'm not as familiar with those. 

On Wed, Sep 2, 2020 at 1:45 PM Jeanette C. <julien@mail.upb.de> wrote:
OK, recursion it is then. I almost feared as much. The while loop just looked
so attractive, especially with arrays all round. Well, recursion it will be.
;)

Best wishes and thanks all of you,

Jeanette

--
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Give me a sign...
Hit me Baby one more time <3
(Britney Spears)

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

Date2020-09-04 04:29
FromJosh Moore
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] While and audio arrays
Doing that is especially helpful for people like me who sometimes plays around with spectral/additive stuff that's in the hundreds of individual bands that need individual tuning capability. That's a lot of copying and pasting and number iterations and adding that you can just fix with a couple for loops and printfs making a 10 hour job a 10 minute job.

On Thu, Sep 3, 2020 at 8:21 PM Josh Moore <kh405.7h30ry@gmail.com> wrote:
I ended up just coding a basic C program that automatically prints out as many iterations of whatever as i wanted so I can just dump it to a text file. You could probably do the same thing in bash or python or whatever but I'm not as familiar with those. 

On Wed, Sep 2, 2020 at 1:45 PM Jeanette C. <julien@mail.upb.de> wrote:
OK, recursion it is then. I almost feared as much. The while loop just looked
so attractive, especially with arrays all round. Well, recursion it will be.
;)

Best wishes and thanks all of you,

Jeanette

--
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Give me a sign...
Hit me Baby one more time <3
(Britney Spears)

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

Date2020-09-04 08:46
From"Jeanette C."
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] While and audio arrays
Sep 4 2020, Josh Moore has written:

> Doing that is especially helpful for people like me who sometimes plays
> around with spectral/additive stuff that's in the hundreds of individual
> bands that need individual tuning capability.
Josh, I have worked with manipulating PVS bands and that works fine with
while loops. For detailed manipulation I used pvsftw and pvsftr with the
wile loop going through the tables and it worked fine. The upshot,
compared to a program unwinding the loop is that the original loop is
much easier to maintain.
...

Best wishes,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Just call out my name, and I will be there... <3
(Britney Spears)

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

Date2020-09-04 14:07
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] While and audio arrays
The key to understand the limitations of loops for processing signal is this:

- each opcode inside a loop refers to ONE instance only
- when you run a loop, that single instance is called repeatedly
- if the opcode holds any state, that state is updated at every iteration

for example, an oscil holds state referring to its current phase. Every time
you call it, it gets incremented. So if you are running it in a loop, the
every time you call it, you update the phase. In a bank of oscillators,
each one has its own separate phase and they are all updated in parallel.
You don’t get that with a single oscillator in a loop.

Similar ideas apply to filters (which have memory for delays) or to 
anything that holds some form of state.

Contrast this with recursion: every time a UDO calls itself, it instantiates
a new copy of it, with its separate state etc. 

Opcodes that implement pure functions (no state) can be used in loops as you please.
You can implement a bank of oscillators using sin() and an audio array to hold
phases.

Hope that clears the matter.

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 4 Sep 2020, at 08:46, Jeanette C.  wrote:
> 
> Sep 4 2020, Josh Moore has written:
> 
>> Doing that is especially helpful for people like me who sometimes plays
>> around with spectral/additive stuff that's in the hundreds of individual
>> bands that need individual tuning capability.
> Josh, I have worked with manipulating PVS bands and that works fine with
> while loops. For detailed manipulation I used pvsftw and pvsftr with the
> wile loop going through the tables and it worked fine. The upshot,
> compared to a program unwinding the loop is that the original loop is
> much easier to maintain.
> ...
> 
> Best wishes,
> 
> Jeanette
> 
> -- 
> * Website: https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fjuliencoder.de%2F&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C903317d2ae584f1c335108d850a6a544%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637348023961750189&sdata=PTRbXf1zrHiovkz5sGJ7ZJKPmSkSd0CXf0bPtfRH7oQ%3D&reserved=0 - for summer is a state of sound
> * Youtube: https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fchannel%2FUCMS4rfGrTwz8W7jhC1Jnv7g&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C903317d2ae584f1c335108d850a6a544%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637348023961750189&sdata=iMHKdY5727RCN3R1hScBWsNJ8rHi%2FgWYZNmFYjvSeQ4%3D&reserved=0
> * Audiobombs: https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.audiobombs.com%2Fusers%2Fjeanette_c&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C903317d2ae584f1c335108d850a6a544%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637348023961760183&sdata=oFi3C%2FqSe9d%2B3nreKjExjmT6WkVjYurUAhR%2BMhX58QQ%3D&reserved=0
> * GitHub: https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjeanette-c&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C903317d2ae584f1c335108d850a6a544%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637348023961760183&sdata=5l%2BCUlyAE1CaqWSUpv9diZ3h04T%2FiCR8BvjeYHdyDJQ%3D&reserved=0
> 
> Just call out my name, and I will be there... <3
> (Britney Spears)
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C903317d2ae584f1c335108d850a6a544%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637348023961760183&sdata=WUKamAWZ2QTLtNpdKZbytOPcstOdgNojg%2BN6P7e4gPI%3D&reserved=0
> Send bugs reports to
>       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C903317d2ae584f1c335108d850a6a544%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637348023961760183&sdata=eYWlKpoA1KxC%2BrgWINKElqqOikwnEK7ElstSUljzu9c%3D&reserved=0
> 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

Date2020-09-04 17:04
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] While and audio arrays
Thanks for sharing these insights Victor!

Dr. Richard Boulanger

Professor of Electronic Production and Design

Berklee College of Music

Professional Writing and Technology Division





On Fri, Sep 4, 2020 at 9:09 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
The key to understand the limitations of loops for processing signal is this:

- each opcode inside a loop refers to ONE instance only
- when you run a loop, that single instance is called repeatedly
- if the opcode holds any state, that state is updated at every iteration

for example, an oscil holds state referring to its current phase. Every time
you call it, it gets incremented. So if you are running it in a loop, the
every time you call it, you update the phase. In a bank of oscillators,
each one has its own separate phase and they are all updated in parallel.
You don’t get that with a single oscillator in a loop.

Similar ideas apply to filters (which have memory for delays) or to
anything that holds some form of state.

Contrast this with recursion: every time a UDO calls itself, it instantiates
a new copy of it, with its separate state etc.

Opcodes that implement pure functions (no state) can be used in loops as you please.
You can implement a bank of oscillators using sin() and an audio array to hold
phases.

Hope that clears the matter.

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 4 Sep 2020, at 08:46, Jeanette C. <julien@MAIL.UPB.DE> wrote:
>
> Sep 4 2020, Josh Moore has written:
>
>> Doing that is especially helpful for people like me who sometimes plays
>> around with spectral/additive stuff that's in the hundreds of individual
>> bands that need individual tuning capability.
> Josh, I have worked with manipulating PVS bands and that works fine with
> while loops. For detailed manipulation I used pvsftw and pvsftr with the
> wile loop going through the tables and it worked fine. The upshot,
> compared to a program unwinding the loop is that the original loop is
> much easier to maintain.
> ...
>
> Best wishes,
>
> Jeanette
>
> --
> * Website: https://us-west-2.protection.sophos.com?d=outlook.com&u=aHR0cHM6Ly9ldXIwMi5zYWZlbGlua3MucHJvdGVjdGlvbi5vdXRsb29rLmNvbS8_dXJsPWh0dHAlM0ElMkYlMkZqdWxpZW5jb2Rlci5kZSUyRiZkYXRhPTAyJTdDMDElN0NWaWN0b3IuTGF6emFyaW5pJTQwbXUuaWUlN0M5MDMzMTdkMmFlNTg0ZjFjMzM1MTA4ZDg1MGE2YTU0NCU3QzE0NTRmNWNjYmIzNTQ2ODViYmQ5ODYyMWZkODA1NWM5JTdDMSU3QzAlN0M2MzczNDgwMjM5NjE3NTAxODkmc2RhdGE9UFRSYlhmMXpySGlvdmt6NXNHSjdaSktQbVNrU2QwQ1hmMGJQdGZSSDdvUSUzRCZyZXNlcnZlZD0w&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=NzA5M0NpblNRZE1GQXRmSXBURjNvc1pUem56NGl1OW9ESXVFREFSTHBlND0=&h=da5759dcb68141e0bfccb985563b40c1 - for summer is a state of sound
> * Youtube: https://us-west-2.protection.sophos.com?d=outlook.com&u=aHR0cHM6Ly9ldXIwMi5zYWZlbGlua3MucHJvdGVjdGlvbi5vdXRsb29rLmNvbS8_dXJsPWh0dHBzJTNBJTJGJTJGd3d3LnlvdXR1YmUuY29tJTJGY2hhbm5lbCUyRlVDTVM0cmZHclR3ejhXN2poQzFKbnY3ZyZkYXRhPTAyJTdDMDElN0NWaWN0b3IuTGF6emFyaW5pJTQwbXUuaWUlN0M5MDMzMTdkMmFlNTg0ZjFjMzM1MTA4ZDg1MGE2YTU0NCU3QzE0NTRmNWNjYmIzNTQ2ODViYmQ5ODYyMWZkODA1NWM5JTdDMSU3QzAlN0M2MzczNDgwMjM5NjE3NTAxODkmc2RhdGE9aU1IS2RZNTcyN1JDTjNSMWhTY0JXc05KOHJIaSUyRmdXWVpObUZZanZTZVE0JTNEJnJlc2VydmVkPTA=&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=YXNGOUhpZFAvcWl1VTN2VVA2WWRQMnRlUWFMQTZmWEE5OTZMT3piM3NQbz0=&h=da5759dcb68141e0bfccb985563b40c1
> * Audiobombs: https://us-west-2.protection.sophos.com?d=outlook.com&u=aHR0cHM6Ly9ldXIwMi5zYWZlbGlua3MucHJvdGVjdGlvbi5vdXRsb29rLmNvbS8_dXJsPWh0dHBzJTNBJTJGJTJGd3d3LmF1ZGlvYm9tYnMuY29tJTJGdXNlcnMlMkZqZWFuZXR0ZV9jJmRhdGE9MDIlN0MwMSU3Q1ZpY3Rvci5MYXp6YXJpbmklNDBtdS5pZSU3QzkwMzMxN2QyYWU1ODRmMWMzMzUxMDhkODUwYTZhNTQ0JTdDMTQ1NGY1Y2NiYjM1NDY4NWJiZDk4NjIxZmQ4MDU1YzklN0MxJTdDMCU3QzYzNzM0ODAyMzk2MTc2MDE4MyZzZGF0YT1vRmkzQyUyRnFTZTlkJTJCM25yZUtqRXhqbVQ2V2tWall1clVBaFIlMkJNaFg1OFFRJTNEJnJlc2VydmVkPTA=&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=Z2tZL3dUYkFDUW9rYlh5Unk0SHh2aC96M3BZL2lERGtkYUJyRjZ3WUFGND0=&h=da5759dcb68141e0bfccb985563b40c1
> * GitHub: https://us-west-2.protection.sophos.com?d=outlook.com&u=aHR0cHM6Ly9ldXIwMi5zYWZlbGlua3MucHJvdGVjdGlvbi5vdXRsb29rLmNvbS8_dXJsPWh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmplYW5ldHRlLWMmZGF0YT0wMiU3QzAxJTdDVmljdG9yLkxhenphcmluaSU0MG11LmllJTdDOTAzMzE3ZDJhZTU4NGYxYzMzNTEwOGQ4NTBhNmE1NDQlN0MxNDU0ZjVjY2JiMzU0Njg1YmJkOTg2MjFmZDgwNTVjOSU3QzElN0MwJTdDNjM3MzQ4MDIzOTYxNzYwMTgzJnNkYXRhPTVsJTJCQ1VseUFFMUNhcVdTVXB2OWRpWjNoMDRUJTJGaUNSOEJ2amVZSGR5REpRJTNEJnJlc2VydmVkPTA=&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=b2FKVk54alJMSXRITVVCVlg0bXU3eWhFVTNiZ2RWeTJzcm05Z0s0YkpFZz0=&h=da5759dcb68141e0bfccb985563b40c1
>
> Just call out my name, and I will be there... <3
> (Britney Spears)
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://us-west-2.protection.sophos.com?d=outlook.com&u=aHR0cHM6Ly9ldXIwMi5zYWZlbGlua3MucHJvdGVjdGlvbi5vdXRsb29rLmNvbS8_dXJsPWh0dHBzJTNBJTJGJTJGbGlzdHNlcnYuaGVhbmV0LmllJTJGY2dpLWJpbiUyRndhJTNGQTAlM0RDU09VTkQmZGF0YT0wMiU3QzAxJTdDVmljdG9yLkxhenphcmluaSU0MG11LmllJTdDOTAzMzE3ZDJhZTU4NGYxYzMzNTEwOGQ4NTBhNmE1NDQlN0MxNDU0ZjVjY2JiMzU0Njg1YmJkOTg2MjFmZDgwNTVjOSU3QzElN0MwJTdDNjM3MzQ4MDIzOTYxNzYwMTgzJnNkYXRhPVdVS2FtQVdaMlFUTHROcGRLWmJ5dE9QY3N0T2RnTm9qZyUyQk42UDdlNGdQSSUzRCZyZXNlcnZlZD0w&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=c0dZZnA1bFo2QXZ5UnpGM0EyLzV3NlhGcmw4ckdoUlhieGk1L1lyTnErND0=&h=da5759dcb68141e0bfccb985563b40c1
> Send bugs reports to
>       https://us-west-2.protection.sophos.com?d=outlook.com&u=aHR0cHM6Ly9ldXIwMi5zYWZlbGlua3MucHJvdGVjdGlvbi5vdXRsb29rLmNvbS8_dXJsPWh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmNzb3VuZCUyRmNzb3VuZCUyRmlzc3VlcyZkYXRhPTAyJTdDMDElN0NWaWN0b3IuTGF6emFyaW5pJTQwbXUuaWUlN0M5MDMzMTdkMmFlNTg0ZjFjMzM1MTA4ZDg1MGE2YTU0NCU3QzE0NTRmNWNjYmIzNTQ2ODViYmQ5ODYyMWZkODA1NWM5JTdDMSU3QzAlN0M2MzczNDgwMjM5NjE3NjAxODMmc2RhdGE9ZVlXbEtwb0ExS3hDJTJCcmdXSU5LRWxxcU9pa3duRUs3RWxzdFNVbGp6dTljJTNEJnJlc2VydmVkPTA=&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=TFlDcDluMTBFeFV3d0hNaVhpZUVxR25xSmJKZ0VwMlJsa3F4K0o3N3RnRT0=&h=da5759dcb68141e0bfccb985563b40c1
> Discussions of bugs and features can be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://us-west-2.protection.sophos.com?d=heanet.ie&u=aHR0cHM6Ly9saXN0c2Vydi5oZWFuZXQuaWUvY2dpLWJpbi93YT9BMD1DU09VTkQ=&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=V2MrMzVGMU1BZEZaZ1lZck9kUnhTTC9YN1BHMnUxSDd4THhWY0dLeURxYz0=&h=da5759dcb68141e0bfccb985563b40c1
Send bugs reports to
        https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZC9jc291bmQvaXNzdWVz&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=cWpnbGx6KzZUci9yQkZQMDNaTDdyZFdzK1l1WDE0TVhzOXR1dHltRUx5RT0=&h=da5759dcb68141e0bfccb985563b40c1
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

Date2020-09-05 16:50
FromJosh Moore
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] While and audio arrays
Yeah, for PVS stuff where you might use a single opcode as Victor says will work fine. It's when you get into multiple signals that you run into hiccups (as you were having with your vocoder stuff). Like having a pvsanal and individual or sub grouped resynthesis bins, each with their own output (ie, for spectral compression/expansion or something like that). You really do need a separate instance for each voice as was said. 

Calling a UDO a bunch of times would work, but I would imagine you also lose some flexibility and conciseness, and perhaps a performance drop vs just sending a big block to get interpreted. Using a standard programming language's loops to generate the individual lines for the appropriate instances *will* have the desired effect of creating individual instances (or what you would expect loops to normally do) and since you can just generate the whole CSD tags and all there's really no reason to use the loops internal to csound nor would you be really reading or modifying the CSD dump just running it. It's just a fancy text processor at that point, old skool bell labs style. Even if you were to use it to generate a UDO that you would need to only call once, instead of multiple times you could easily do the same. 

On Fri, Sep 4, 2020 at 12:46 AM Jeanette C. <julien@mail.upb.de> wrote:
Sep 4 2020, Josh Moore has written:

> Doing that is especially helpful for people like me who sometimes plays
> around with spectral/additive stuff that's in the hundreds of individual
> bands that need individual tuning capability.
Josh, I have worked with manipulating PVS bands and that works fine with
while loops. For detailed manipulation I used pvsftw and pvsftr with the
wile loop going through the tables and it worked fine. The upshot,
compared to a program unwinding the loop is that the original loop is
much easier to maintain.
...

Best wishes,

Jeanette

--
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Just call out my name, and I will be there... <3
(Britney Spears)

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