Csound Csound-dev Csound-tekno Search About

[Csnd] expanding arbitrary number of pfields into an array?

Date2021-09-19 16:15
FromIain Duncan
Subject[Csnd] expanding arbitrary number of pfields into an array?
Hello list, I'm trying to figure out how best to get arbitrary (potentially large) lists of numbers coming from stdin into csound instruments. I've been looking through the 2016 book, but not finding an example so far in my hunting. I would like to be able to have my Scheme program send a large list in and then have a csound instrument work with this. 

Some questions:
- is there a way to loop through pfields numerically?
- or a way to group all received pfields into an itime array? (without knowing how many there will be?
- if the answers to the above are no, would it be reasonable instead to send an f statement and have the function expanded into an array in the orchestra?
- are there other approaches to this that I haven't thought of?

thanks!
iain
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

Date2021-09-19 16:21
Fromjoachim heintz
SubjectRe: [Csnd] expanding arbitrary number of pfields into an array?
hi iain -
have a look at pcount and passign. this might do some of what you need.
best -
	joachim


On 19/09/2021 17:15, Iain Duncan wrote:
> Hello list, I'm trying to figure out how best to get arbitrary 
> (potentially large) lists of numbers coming from stdin into csound 
> instruments. I've been looking through the 2016 book, but not finding an 
> example so far in my hunting. I would like to be able to have my Scheme 
> program send a large list in and then have a csound instrument work with 
> this.
> 
> Some questions:
> - is there a way to loop through pfields numerically?
> - or a way to group all received pfields into an itime array? (without 
> knowing how many there will be?
> - if the answers to the above are no, would it be reasonable instead to 
> send an f statement and have the function expanded into an array in the 
> orchestra?
> - are there other approaches to this that I haven't thought of?
> 
> thanks!
> iain
> 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

Date2021-09-19 16:25
From00000008a49663bc-dmarc-request@LISTSERV.HEANET.IE
SubjectRe: [Csnd] expanding arbitrary number of pfields into an array?

Hello,

I suppose that looping pfields can be done with:

ifields pcount

ifield = 1

while ifield < ifields do

    ival pindex ifield

    iarray[ifield] = ival

    ifield += 1

od

didn't try but maybe works, the array must be longer or equal to the maximum pfields you plan to send

Ciao

Stefano


Il 19/09/2021 17:15 Iain Duncan <iainduncanlists@gmail.com> ha scritto:


Hello list, I'm trying to figure out how best to get arbitrary (potentially large) lists of numbers coming from stdin into csound instruments. I've been looking through the 2016 book, but not finding an example so far in my hunting. I would like to be able to have my Scheme program send a large list in and then have a csound instrument work with this. 

Some questions:
- is there a way to loop through pfields numerically?
- or a way to group all received pfields into an itime array? (without knowing how many there will be?
- if the answers to the above are no, would it be reasonable instead to send an f statement and have the function expanded into an array in the orchestra?
- are there other approaches to this that I haven't thought of?

thanks!
iain
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

Date2021-09-19 16:33
FromIain Duncan
SubjectRe: [Csnd] expanding arbitrary number of pfields into an array?
Thanks Stefano and Joachim, that should at least get me going!

iain

On Sun, Sep 19, 2021 at 8:25 AM <00000008a49663bc-dmarc-request@listserv.heanet.ie> wrote:

Hello,

I suppose that looping pfields can be done with:

ifields pcount

ifield = 1

while ifield < ifields do

    ival pindex ifield

    iarray[ifield] = ival

    ifield += 1

od

didn't try but maybe works, the array must be longer or equal to the maximum pfields you plan to send

Ciao

Stefano


Il 19/09/2021 17:15 Iain Duncan <iainduncanlists@gmail.com> ha scritto:


Hello list, I'm trying to figure out how best to get arbitrary (potentially large) lists of numbers coming from stdin into csound instruments. I've been looking through the 2016 book, but not finding an example so far in my hunting. I would like to be able to have my Scheme program send a large list in and then have a csound instrument work with this. 

Some questions:
- is there a way to loop through pfields numerically?
- or a way to group all received pfields into an itime array? (without knowing how many there will be?
- if the answers to the above are no, would it be reasonable instead to send an f statement and have the function expanded into an array in the orchestra?
- are there other approaches to this that I haven't thought of?

thanks!
iain
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

Date2021-09-19 18:00
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] expanding arbitrary number of pfields into an array?
Iain, 

Excited to see where you are going with this.
- thanks for the suggestions and for the feedback from the Csound Community.
Keep us in the loop!

And... good luck.

- Dr.B


Dr. Richard Boulanger

Professor

Electronic Production and Design

Berklee College of Music

Professional Writing & Technology Division



On Sun, Sep 19, 2021 at 11:34 AM Iain Duncan <iainduncanlists@gmail.com> wrote:
Thanks Stefano and Joachim, that should at least get me going!

iain

On Sun, Sep 19, 2021 at 8:25 AM <00000008a49663bc-dmarc-request@listserv.heanet.ie> wrote:

Hello,

I suppose that looping pfields can be done with:

ifields pcount

ifield = 1

while ifield < ifields do

    ival pindex ifield

    iarray[ifield] = ival

    ifield += 1

od

didn't try but maybe works, the array must be longer or equal to the maximum pfields you plan to send

Ciao

Stefano


Il 19/09/2021 17:15 Iain Duncan <iainduncanlists@gmail.com> ha scritto:


Hello list, I'm trying to figure out how best to get arbitrary (potentially large) lists of numbers coming from stdin into csound instruments. I've been looking through the 2016 book, but not finding an example so far in my hunting. I would like to be able to have my Scheme program send a large list in and then have a csound instrument work with this. 

Some questions:
- is there a way to loop through pfields numerically?
- or a way to group all received pfields into an itime array? (without knowing how many there will be?
- if the answers to the above are no, would it be reasonable instead to send an f statement and have the function expanded into an array in the orchestra?
- are there other approaches to this that I haven't thought of?

thanks!
iain
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