Csound Csound-dev Csound-tekno Search About

Re: Audio arrays instead of zaw, zawm, zar

Date2016-03-31 19:23
From"vallste@libero.it" <00000008a49663bc-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: Audio arrays instead of zaw, zawm, zar
Thanks, for the reply, i will investigate further.
I'm asking this becase I'm using a series of subinstr generated within an instrument (at i time by reading a ftable)  that have a variable patching scheme (so the output of a subinstr could be the input of several subinstrs). With zak opcodes is quite easy because you can pass a zak index at k-time (just the number to the correct location written and read in a ftable) and managing numbered indexes (zak addresses) is easier than strings.
I've read that zak opcodes are somehow deprecated so I'm studying the "modern" way.
Ciao
----Messaggio originale----
Da: Rory Walsh <rorywalsh@EAR.IE>
Data: 31/03/2016 17.13
A: <CSOUND@LISTSERV.HEANET.IE>
Ogg: Re: [Csnd] Audio arrays instead of zaw, zawm, zar

I guess 1 should work if you ksmps=1, but I ain't sure. It seems a little odd to me to want to do this in the first place. Why not just use an a-rate variable? 2, so long as you don't overwrite the index then I believe the value will persist through k-cycles. Not sure about 3, but instead of using array, why not simply use audio channels? I patch signal between instruments all the time using a-rate chnsets and chngets. Would they not be simple then using global arrays? 

On 31 March 2016 at 12:24, vallste@libero.it <00000008a49663bc-dmarc-request@listserv.heanet.ie> wrote:
Hello list,
I'm starting to look into arrays (audio) to see how I can use them instead of zak opcodes for patching different instruments, I've the following doubts:

1) can I use a k variable as index to write/read in the array like:
kindex = 10
aout = a_array[kindex]
kindex = kindex + 1
a_array[kindex] = aout

2) are audio arrays zeroed at every k pass or values are persistent through k cycles? With zak opcodes zakcl must be used at each k cycle if we don't want to have the value present at the next k cycle, I must do something like a_array[kindex] = 0 at every kpass?

3) I suppose that writing at an array location completely replace the existing value with the new one so if I'd like to write the equivalent code of zawm I should do something like:
a_array[0]  = aval + a_array[0]
can someone confirm?

Thank you in advance for your help

Stefano
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

Date2016-03-31 19:36
FromRory Walsh
SubjectRe: Audio arrays instead of zaw, zawm, zar
Ok, sounds rather complex. You can also use string arrays to hold each patch name and access them at k-time? Anyhow, good luck with your project. You could simply continue to use the zak opcodes. They ain't going anywhere.    

On 31 March 2016 at 19:23, vallste@libero.it <00000008a49663bc-dmarc-request@listserv.heanet.ie> wrote:
Thanks, for the reply, i will investigate further.
I'm asking this becase I'm using a series of subinstr generated within an instrument (at i time by reading a ftable)  that have a variable patching scheme (so the output of a subinstr could be the input of several subinstrs). With zak opcodes is quite easy because you can pass a zak index at k-time (just the number to the correct location written and read in a ftable) and managing numbered indexes (zak addresses) is easier than strings.
I've read that zak opcodes are somehow deprecated so I'm studying the "modern" way.
Ciao
----Messaggio originale----
Da: Rory Walsh <rorywalsh@EAR.IE>
Data: 31/03/2016 17.13
A: <CSOUND@LISTSERV.HEANET.IE>
Ogg: Re: [Csnd] Audio arrays instead of zaw, zawm, zar


I guess 1 should work if you ksmps=1, but I ain't sure. It seems a little odd to me to want to do this in the first place. Why not just use an a-rate variable? 2, so long as you don't overwrite the index then I believe the value will persist through k-cycles. Not sure about 3, but instead of using array, why not simply use audio channels? I patch signal between instruments all the time using a-rate chnsets and chngets. Would they not be simple then using global arrays? 

On 31 March 2016 at 12:24, vallste@libero.it <00000008a49663bc-dmarc-request@listserv.heanet.ie> wrote:
Hello list,
I'm starting to look into arrays (audio) to see how I can use them instead of zak opcodes for patching different instruments, I've the following doubts:

1) can I use a k variable as index to write/read in the array like:
kindex = 10
aout = a_array[kindex]
kindex = kindex + 1
a_array[kindex] = aout

2) are audio arrays zeroed at every k pass or values are persistent through k cycles? With zak opcodes zakcl must be used at each k cycle if we don't want to have the value present at the next k cycle, I must do something like a_array[kindex] = 0 at every kpass?

3) I suppose that writing at an array location completely replace the existing value with the new one so if I'd like to write the equivalent code of zawm I should do something like:
a_array[0]  = aval + a_array[0]
can someone confirm?

Thank you in advance for your help

Stefano
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