Csound Csound-dev Csound-tekno Search About

[Csnd-dev] expression with multiple outputs

Date2025-09-21 14:18
Fromjoachim heintz
Subject[Csnd-dev] expression with multiple outputs
nchnls = 2
0dbfs = 1

instr 1
   sound:a = pinkish(.1)
   out(pan2(sound,random:i(0,1)))
endin
schedule(1,0,1)

error: opcode 'pan2' for expression with arg types ai returns out-args 
!= 1, line 14

is this a limitation, or is it supposed to work?

thanks -
	joachim

Date2025-09-21 14:28
FromEduardo Moguillansky
SubjectRe: [Csnd-dev] expression with multiple outputs
pan2 returns two outputs, not an array. So I would say that it is a limitation in the sense that for that to work one would need to add a variant of pan2 which returns an array.

On Sun, Sep 21, 2025 at 3:18 PM joachim heintz <jh@joachimheintz.de> wrote:
nchnls = 2
0dbfs = 1

instr 1
   sound:a = pinkish(.1)
   out(pan2(sound,random:i(0,1)))
endin
schedule(1,0,1)

error: opcode 'pan2' for expression with arg types ai returns out-args
!= 1, line 14

is this a limitation, or is it supposed to work?

thanks -
        joachim

Date2025-09-21 14:35
Fromjoachim heintz
SubjectRe: [Csnd-dev] expression with multiple outputs
my assumption was that if out(a1,a2) works, it should also work if the 
two arguments are the outputs of an expression, like here.


On 21/09/2025 22:28, Eduardo Moguillansky wrote:
> pan2 returns two outputs, not an array. So I would say that it is a 
> limitation in the sense that for that to work one would need to add a 
> variant of pan2 which returns an array.
> 
> On Sun, Sep 21, 2025 at 3:18 PM joachim heintz  > wrote:
> 
>     nchnls = 2
>     0dbfs = 1
> 
>     instr 1
>         sound:a = pinkish(.1)
>         out(pan2(sound,random:i(0,1)))
>     endin
>     schedule(1,0,1)
> 
>     error: opcode 'pan2' for expression with arg types ai returns out-args
>     != 1, line 14
> 
>     is this a limitation, or is it supposed to work?
> 
>     thanks -
>              joachim
> 

Date2025-09-21 15:16
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] expression with multiple outputs
No, we don't have that syntax and we have decided a while ago that we would not try to implement it.

So in summary, a multi-output opcode cannot be used inline like this. 

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 21 Sep 2025, at 14:35, joachim heintz  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.
> 
> my assumption was that if out(a1,a2) works, it should also work if the
> two arguments are the outputs of an expression, like here.
> 
> 
>> On 21/09/2025 22:28, Eduardo Moguillansky wrote:
>> pan2 returns two outputs, not an array. So I would say that it is a
>> limitation in the sense that for that to work one would need to add a
>> variant of pan2 which returns an array.
>> 
>> On Sun, Sep 21, 2025 at 3:18 PM joachim heintz > > wrote:
>> 
>>    nchnls = 2
>>    0dbfs = 1
>> 
>>    instr 1
>>        sound:a = pinkish(.1)
>>        out(pan2(sound,random:i(0,1)))
>>    endin
>>    schedule(1,0,1)
>> 
>>    error: opcode 'pan2' for expression with arg types ai returns out-args
>>    != 1, line 14
>> 
>>    is this a limitation, or is it supposed to work?
>> 
>>    thanks -
>>             joachim
>> 

Date2025-09-21 19:24
FromHlöðver Sigurðsson
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] expression with multiple outputs
in theory the out could infer the [a,a] after I finish this behemoth change regarding struct arrays I could take a look at this

On Sun, 21 Sept 2025 at 17:17, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
No, we don't have that syntax and we have decided a while ago that we would not try to implement it.

So in summary, a multi-output opcode cannot be used inline like this.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 21 Sep 2025, at 14:35, joachim heintz <jh@joachimheintz.de> 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.
>
> my assumption was that if out(a1,a2) works, it should also work if the
> two arguments are the outputs of an expression, like here.
>
>
>> On 21/09/2025 22:28, Eduardo Moguillansky wrote:
>> pan2 returns two outputs, not an array. So I would say that it is a
>> limitation in the sense that for that to work one would need to add a
>> variant of pan2 which returns an array.
>>
>> On Sun, Sep 21, 2025 at 3:18 PM joachim heintz <jh@joachimheintz.de
>> <mailto:jh@joachimheintz.de>> wrote:
>>
>>    nchnls = 2
>>    0dbfs = 1
>>
>>    instr 1
>>        sound:a = pinkish(.1)
>>        out(pan2(sound,random:i(0,1)))
>>    endin
>>    schedule(1,0,1)
>>
>>    error: opcode 'pan2' for expression with arg types ai returns out-args
>>    != 1, line 14
>>
>>    is this a limitation, or is it supposed to work?
>>
>>    thanks -
>>             joachim
>>

Date2025-09-21 20:41
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] expression with multiple outputs
It's a can of worms. I have discussed this with Steven and we concluded it's a bad idea.


Prof. Victor Lazzarini
Maynooth University
Ireland

On 21 Sep 2025, at 19:25, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:


in theory the out could infer the [a,a] after I finish this behemoth change regarding struct arrays I could take a look at this

On Sun, 21 Sept 2025 at 17:17, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
No, we don't have that syntax and we have decided a while ago that we would not try to implement it.

So in summary, a multi-output opcode cannot be used inline like this.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 21 Sep 2025, at 14:35, joachim heintz <jh@joachimheintz.de> 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.
>
> my assumption was that if out(a1,a2) works, it should also work if the
> two arguments are the outputs of an expression, like here.
>
>
>> On 21/09/2025 22:28, Eduardo Moguillansky wrote:
>> pan2 returns two outputs, not an array. So I would say that it is a
>> limitation in the sense that for that to work one would need to add a
>> variant of pan2 which returns an array.
>>
>> On Sun, Sep 21, 2025 at 3:18 PM joachim heintz <jh@joachimheintz.de
>> <mailto:jh@joachimheintz.de>> wrote:
>>
>>    nchnls = 2
>>    0dbfs = 1
>>
>>    instr 1
>>        sound:a = pinkish(.1)
>>        out(pan2(sound,random:i(0,1)))
>>    endin
>>    schedule(1,0,1)
>>
>>    error: opcode 'pan2' for expression with arg types ai returns out-args
>>    != 1, line 14
>>
>>    is this a limitation, or is it supposed to work?
>>
>>    thanks -
>>             joachim
>>

Date2025-09-21 23:13
Fromjoachim heintz
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] expression with multiple outputs
ok --- thanks to all for the explanations and thoughts.
i wonder where is a good place to document it.
or is it already anywhere documented?

On 22/09/2025 04:41, Victor Lazzarini wrote:
> It's a can of worms. I have discussed this with Steven and we concluded 
> it's a bad idea.
> 
> 
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 21 Sep 2025, at 19:25, Hlöðver Sigurðsson  wrote:
>>
>> 
>> in theory the out could infer the [a,a] after I finish this behemoth 
>> change regarding struct arrays I could take a look at this
>>
>> On Sun, 21 Sept 2025 at 17:17, Victor Lazzarini <000010b17ddd988e- 
>> dmarc-request@listserv.heanet.ie > request@listserv.heanet.ie>> wrote:
>>
>>     No, we don't have that syntax and we have decided a while ago that
>>     we would not try to implement it.
>>
>>     So in summary, a multi-output opcode cannot be used inline like this.
>>
>>     Prof. Victor Lazzarini
>>     Maynooth University
>>     Ireland
>>
>>     > On 21 Sep 2025, at 14:35, joachim heintz >     > 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.
>>     >
>>     > my assumption was that if out(a1,a2) works, it should also work
>>     if the
>>     > two arguments are the outputs of an expression, like here.
>>     >
>>     >
>>     >> On 21/09/2025 22:28, Eduardo Moguillansky wrote:
>>     >> pan2 returns two outputs, not an array. So I would say that it is a
>>     >> limitation in the sense that for that to work one would need to
>>     add a
>>     >> variant of pan2 which returns an array.
>>     >>
>>     >> On Sun, Sep 21, 2025 at 3:18 PM joachim heintz
>>     
>>     >> >> wrote:
>>     >>
>>     >>    nchnls = 2
>>     >>    0dbfs = 1
>>     >>
>>     >>    instr 1
>>     >>        sound:a = pinkish(.1)
>>     >>        out(pan2(sound,random:i(0,1)))
>>     >>    endin
>>     >>    schedule(1,0,1)
>>     >>
>>     >>    error: opcode 'pan2' for expression with arg types ai
>>     returns out-args
>>     >>    != 1, line 14
>>     >>
>>     >>    is this a limitation, or is it supposed to work?
>>     >>
>>     >>    thanks -
>>     >>             joachim
>>     >>
>>

Date2025-09-22 12:42
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] expression with multiple outputs
What do you have in mind in terms of documentation?

There could be a section in the manual on inlined opcodes giving examples where it can be noted that only opcodes with one output may be inlined.

Note that this is a common approach in other languages that have multiple outputs. In Python tuples are used to handle this,

def fun(): return 1, 2

fun()
(1,2)

def fun2(a,b): return a, b

fun2(fun())
TypeError: fun2() missing 1 required positional argument 'b'

fun2(fun()[0], fun()[1])
(1,2)

In Csound we can do similarly with arrays.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 21 Sep 2025, at 23:13, joachim heintz  wrote:
> 
> ok --- thanks to all for the explanations and thoughts.
> i wonder where is a good place to document it.
> or is it already anywhere documented?
> 
>> On 22/09/2025 04:41, Victor Lazzarini wrote:
>> It's a can of worms. I have discussed this with Steven and we concluded it's a bad idea.
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>>> On 21 Sep 2025, at 19:25, Hlöðver Sigurðsson  wrote:
>>> 
>>> 
>>> in theory the out could infer the [a,a] after I finish this behemoth change regarding struct arrays I could take a look at this
>>> 
>>>> On Sun, 21 Sept 2025 at 17:17, Victor Lazzarini <000010b17ddd988e- dmarc-request@listserv.heanet.ie > wrote:
>>> 
>>>    No, we don't have that syntax and we have decided a while ago that
>>>    we would not try to implement it.
>>> 
>>>    So in summary, a multi-output opcode cannot be used inline like this.
>>> 
>>>    Prof. Victor Lazzarini
>>>    Maynooth University
>>>    Ireland
>>> 
>>>    > On 21 Sep 2025, at 14:35, joachim heintz >>    > 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.
>>>    >
>>>    > my assumption was that if out(a1,a2) works, it should also work
>>>    if the
>>>    > two arguments are the outputs of an expression, like here.
>>>    >
>>>    >
>>>    >> On 21/09/2025 22:28, Eduardo Moguillansky wrote:
>>>    >> pan2 returns two outputs, not an array. So I would say that it is a
>>>    >> limitation in the sense that for that to work one would need to
>>>    add a
>>>    >> variant of pan2 which returns an array.
>>>    >>
>>>    >> On Sun, Sep 21, 2025 at 3:18 PM joachim heintz
>>>    
>>>    >> >> wrote:
>>>    >>
>>>    >>    nchnls = 2
>>>    >>    0dbfs = 1
>>>    >>
>>>    >>    instr 1
>>>    >>        sound:a = pinkish(.1)
>>>    >>        out(pan2(sound,random:i(0,1)))
>>>    >>    endin
>>>    >>    schedule(1,0,1)
>>>    >>
>>>    >>    error: opcode 'pan2' for expression with arg types ai
>>>    returns out-args
>>>    >>    != 1, line 14
>>>    >>
>>>    >>    is this a limitation, or is it supposed to work?
>>>    >>
>>>    >>    thanks -
>>>    >>             joachim
>>>    >>
>>> 

Date2025-09-22 13:45
Fromjoachim heintz
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] expression with multiple outputs
yes what you say is what i had in mind:
"There could be a section in the manual on inlined opcodes giving 
examples where it can be noted that only opcodes with one output may be 
inlined."

in the case of pan2: might it be an idea to add an array output, as 
eduardo mentioned?

On 22/09/2025 20:42, Victor Lazzarini wrote:
> What do you have in mind in terms of documentation?
> 
> There could be a section in the manual on inlined opcodes giving examples where it can be noted that only opcodes with one output may be inlined.
> 
> Note that this is a common approach in other languages that have multiple outputs. In Python tuples are used to handle this,
> 
> def fun(): return 1, 2
> 
> fun()
> (1,2)
> 
> def fun2(a,b): return a, b
> 
> fun2(fun())
> TypeError: fun2() missing 1 required positional argument 'b'
> 
> fun2(fun()[0], fun()[1])
> (1,2)
> 
> In Csound we can do similarly with arrays.
> 
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 21 Sep 2025, at 23:13, joachim heintz  wrote:
>>
>> ok --- thanks to all for the explanations and thoughts.
>> i wonder where is a good place to document it.
>> or is it already anywhere documented?
>>
>>> On 22/09/2025 04:41, Victor Lazzarini wrote:
>>> It's a can of worms. I have discussed this with Steven and we concluded it's a bad idea.
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>>>> On 21 Sep 2025, at 19:25, Hlöðver Sigurðsson  wrote:
>>>>
>>>> 
>>>> in theory the out could infer the [a,a] after I finish this behemoth change regarding struct arrays I could take a look at this
>>>>
>>>>> On Sun, 21 Sept 2025 at 17:17, Victor Lazzarini <000010b17ddd988e- dmarc-request@listserv.heanet.ie > wrote:
>>>>
>>>>     No, we don't have that syntax and we have decided a while ago that
>>>>     we would not try to implement it.
>>>>
>>>>     So in summary, a multi-output opcode cannot be used inline like this.
>>>>
>>>>     Prof. Victor Lazzarini
>>>>     Maynooth University
>>>>     Ireland
>>>>
>>>>     > On 21 Sep 2025, at 14:35, joachim heintz >>>     > 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.
>>>>     >
>>>>     > my assumption was that if out(a1,a2) works, it should also work
>>>>     if the
>>>>     > two arguments are the outputs of an expression, like here.
>>>>     >
>>>>     >
>>>>     >> On 21/09/2025 22:28, Eduardo Moguillansky wrote:
>>>>     >> pan2 returns two outputs, not an array. So I would say that it is a
>>>>     >> limitation in the sense that for that to work one would need to
>>>>     add a
>>>>     >> variant of pan2 which returns an array.
>>>>     >>
>>>>     >> On Sun, Sep 21, 2025 at 3:18 PM joachim heintz
>>>>     
>>>>     >> >> wrote:
>>>>     >>
>>>>     >>    nchnls = 2
>>>>     >>    0dbfs = 1
>>>>     >>
>>>>     >>    instr 1
>>>>     >>        sound:a = pinkish(.1)
>>>>     >>        out(pan2(sound,random:i(0,1)))
>>>>     >>    endin
>>>>     >>    schedule(1,0,1)
>>>>     >>
>>>>     >>    error: opcode 'pan2' for expression with arg types ai
>>>>     returns out-args
>>>>     >>    != 1, line 14
>>>>     >>
>>>>     >>    is this a limitation, or is it supposed to work?
>>>>     >>
>>>>     >>    thanks -
>>>>     >>             joachim
>>>>     >>
>>>>

Date2025-09-22 13:53
FromEduardo Moguillansky
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] expression with multiple outputs
I can add a variant of pan2, if needed

On Mon, Sep 22, 2025 at 2:45 PM joachim heintz <jh@joachimheintz.de> wrote:
yes what you say is what i had in mind:
"There could be a section in the manual on inlined opcodes giving
examples where it can be noted that only opcodes with one output may be
inlined."

in the case of pan2: might it be an idea to add an array output, as
eduardo mentioned?

On 22/09/2025 20:42, Victor Lazzarini wrote:
> What do you have in mind in terms of documentation?
>
> There could be a section in the manual on inlined opcodes giving examples where it can be noted that only opcodes with one output may be inlined.
>
> Note that this is a common approach in other languages that have multiple outputs. In Python tuples are used to handle this,
>
> def fun(): return 1, 2
>
> fun()
> (1,2)
>
> def fun2(a,b): return a, b
>
> fun2(fun())
> TypeError: fun2() missing 1 required positional argument 'b'
>
> fun2(fun()[0], fun()[1])
> (1,2)
>
> In Csound we can do similarly with arrays.
>
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 21 Sep 2025, at 23:13, joachim heintz <jh@joachimheintz.de> wrote:
>>
>> ok --- thanks to all for the explanations and thoughts.
>> i wonder where is a good place to document it.
>> or is it already anywhere documented?
>>
>>> On 22/09/2025 04:41, Victor Lazzarini wrote:
>>> It's a can of worms. I have discussed this with Steven and we concluded it's a bad idea.
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>>>> On 21 Sep 2025, at 19:25, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
>>>>
>>>> 
>>>> in theory the out could infer the [a,a] after I finish this behemoth change regarding struct arrays I could take a look at this
>>>>
>>>>> On Sun, 21 Sept 2025 at 17:17, Victor Lazzarini <000010b17ddd988e- dmarc-request@listserv.heanet.ie <mailto:000010b17ddd988e-dmarc- request@listserv.heanet.ie>> wrote:
>>>>
>>>>     No, we don't have that syntax and we have decided a while ago that
>>>>     we would not try to implement it.
>>>>
>>>>     So in summary, a multi-output opcode cannot be used inline like this.
>>>>
>>>>     Prof. Victor Lazzarini
>>>>     Maynooth University
>>>>     Ireland
>>>>
>>>>     > On 21 Sep 2025, at 14:35, joachim heintz <jh@joachimheintz.de
>>>>     <mailto:jh@joachimheintz.de>> 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.
>>>>     >
>>>>     > my assumption was that if out(a1,a2) works, it should also work
>>>>     if the
>>>>     > two arguments are the outputs of an expression, like here.
>>>>     >
>>>>     >
>>>>     >> On 21/09/2025 22:28, Eduardo Moguillansky wrote:
>>>>     >> pan2 returns two outputs, not an array. So I would say that it is a
>>>>     >> limitation in the sense that for that to work one would need to
>>>>     add a
>>>>     >> variant of pan2 which returns an array.
>>>>     >>
>>>>     >> On Sun, Sep 21, 2025 at 3:18 PM joachim heintz
>>>>     <jh@joachimheintz.de <mailto:jh@joachimheintz.de>
>>>>     >> <mailto:jh@joachimheintz.de <mailto:jh@joachimheintz.de>>> wrote:
>>>>     >>
>>>>     >>    nchnls = 2
>>>>     >>    0dbfs = 1
>>>>     >>
>>>>     >>    instr 1
>>>>     >>        sound:a = pinkish(.1)
>>>>     >>        out(pan2(sound,random:i(0,1)))
>>>>     >>    endin
>>>>     >>    schedule(1,0,1)
>>>>     >>
>>>>     >>    error: opcode 'pan2' for expression with arg types ai
>>>>     returns out-args
>>>>     >>    != 1, line 14
>>>>     >>
>>>>     >>    is this a limitation, or is it supposed to work?
>>>>     >>
>>>>     >>    thanks -
>>>>     >>             joachim
>>>>     >>
>>>>

Date2025-09-22 13:55
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] expression with multiple outputs
Yes, I think so. Can you open a ticket for enhancement?

From: Csound-developers <CSOUND-DEV@LISTSERV.HEANET.IE> on behalf of joachim heintz <jh@JOACHIMHEINTZ.DE>
Sent: Monday 22 September 2025 13:45
To: CSOUND-DEV@LISTSERV.HEANET.IE <CSOUND-DEV@LISTSERV.HEANET.IE>
Subject: Re: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] expression with multiple outputs
 
yes what you say is what i had in mind:
"There could be a section in the manual on inlined opcodes giving
examples where it can be noted that only opcodes with one output may be
inlined."

in the case of pan2: might it be an idea to add an array output, as
eduardo mentioned?

On 22/09/2025 20:42, Victor Lazzarini wrote:
> What do you have in mind in terms of documentation?
>
> There could be a section in the manual on inlined opcodes giving examples where it can be noted that only opcodes with one output may be inlined.
>
> Note that this is a common approach in other languages that have multiple outputs. In Python tuples are used to handle this,
>
> def fun(): return 1, 2
>
> fun()
> (1,2)
>
> def fun2(a,b): return a, b
>
> fun2(fun())
> TypeError: fun2() missing 1 required positional argument 'b'
>
> fun2(fun()[0], fun()[1])
> (1,2)
>
> In Csound we can do similarly with arrays.
>
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 21 Sep 2025, at 23:13, joachim heintz <jh@joachimheintz.de> wrote:
>>
>> ok --- thanks to all for the explanations and thoughts.
>> i wonder where is a good place to document it.
>> or is it already anywhere documented?
>>
>>> On 22/09/2025 04:41, Victor Lazzarini wrote:
>>> It's a can of worms. I have discussed this with Steven and we concluded it's a bad idea.
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>>>> On 21 Sep 2025, at 19:25, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
>>>>
>>>> 
>>>> in theory the out could infer the [a,a] after I finish this behemoth change regarding struct arrays I could take a look at this
>>>>
>>>>> On Sun, 21 Sept 2025 at 17:17, Victor Lazzarini <000010b17ddd988e- dmarc-request@listserv.heanet.ie <mailto:000010b17ddd988e-dmarc- request@listserv.heanet.ie>> wrote:
>>>>
>>>>     No, we don't have that syntax and we have decided a while ago that
>>>>     we would not try to implement it.
>>>>
>>>>     So in summary, a multi-output opcode cannot be used inline like this.
>>>>
>>>>     Prof. Victor Lazzarini
>>>>     Maynooth University
>>>>     Ireland
>>>>
>>>>     > On 21 Sep 2025, at 14:35, joachim heintz <jh@joachimheintz.de
>>>>     <mailto:jh@joachimheintz.de>> 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.
>>>>     >
>>>>     > my assumption was that if out(a1,a2) works, it should also work
>>>>     if the
>>>>     > two arguments are the outputs of an expression, like here.
>>>>     >
>>>>     >
>>>>     >> On 21/09/2025 22:28, Eduardo Moguillansky wrote:
>>>>     >> pan2 returns two outputs, not an array. So I would say that it is a
>>>>     >> limitation in the sense that for that to work one would need to
>>>>     add a
>>>>     >> variant of pan2 which returns an array.
>>>>     >>
>>>>     >> On Sun, Sep 21, 2025 at 3:18 PM joachim heintz
>>>>     <jh@joachimheintz.de <mailto:jh@joachimheintz.de>
>>>>     >> <mailto:jh@joachimheintz.de <mailto:jh@joachimheintz.de>>> wrote:
>>>>     >>
>>>>     >>    nchnls = 2
>>>>     >>    0dbfs = 1
>>>>     >>
>>>>     >>    instr 1
>>>>     >>        sound:a = pinkish(.1)
>>>>     >>        out(pan2(sound,random:i(0,1)))
>>>>     >>    endin
>>>>     >>    schedule(1,0,1)
>>>>     >>
>>>>     >>    error: opcode 'pan2' for expression with arg types ai
>>>>     returns out-args
>>>>     >>    != 1, line 14
>>>>     >>
>>>>     >>    is this a limitation, or is it supposed to work?
>>>>     >>
>>>>     >>    thanks -
>>>>     >>             joachim
>>>>     >>
>>>>

Date2025-09-22 14:08
Fromjoachim heintz
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] expression with multiple outputs
great, thanks!
(i will look what you do and learn =)

On 22/09/2025 21:53, Eduardo Moguillansky wrote:
> I can add a variant of pan2, if needed
> 
> On Mon, Sep 22, 2025 at 2:45 PM joachim heintz  > wrote:
> 
>     yes what you say is what i had in mind:
>     "There could be a section in the manual on inlined opcodes giving
>     examples where it can be noted that only opcodes with one output may be
>     inlined."
> 
>     in the case of pan2: might it be an idea to add an array output, as
>     eduardo mentioned?
> 
>     On 22/09/2025 20:42, Victor Lazzarini wrote:
>      > What do you have in mind in terms of documentation?
>      >
>      > There could be a section in the manual on inlined opcodes giving
>     examples where it can be noted that only opcodes with one output may
>     be inlined.
>      >
>      > Note that this is a common approach in other languages that have
>     multiple outputs. In Python tuples are used to handle this,
>      >
>      > def fun(): return 1, 2
>      >
>      > fun()
>      > (1,2)
>      >
>      > def fun2(a,b): return a, b
>      >
>      > fun2(fun())
>      > TypeError: fun2() missing 1 required positional argument 'b'
>      >
>      > fun2(fun()[0], fun()[1])
>      > (1,2)
>      >
>      > In Csound we can do similarly with arrays.
>      >
>      > Prof. Victor Lazzarini
>      > Maynooth University
>      > Ireland
>      >
>      >> On 21 Sep 2025, at 23:13, joachim heintz      > wrote:
>      >>
>      >> ok --- thanks to all for the explanations and thoughts.
>      >> i wonder where is a good place to document it.
>      >> or is it already anywhere documented?
>      >>
>      >>> On 22/09/2025 04:41, Victor Lazzarini wrote:
>      >>> It's a can of worms. I have discussed this with Steven and we
>     concluded it's a bad idea.
>      >>> Prof. Victor Lazzarini
>      >>> Maynooth University
>      >>> Ireland
>      >>>>> On 21 Sep 2025, at 19:25, Hlöðver Sigurðsson
>     > wrote:
>      >>>>
>      >>>> 
>      >>>> in theory the out could infer the [a,a] after I finish this
>     behemoth change regarding struct arrays I could take a look at this
>      >>>>
>      >>>>> On Sun, 21 Sept 2025 at 17:17, Victor Lazzarini
>     <000010b17ddd988e- dmarc-request@listserv.heanet.ie      request@listserv.heanet.ie>       request@listserv.heanet.ie
>     >> wrote:
>      >>>>
>      >>>>     No, we don't have that syntax and we have decided a while
>     ago that
>      >>>>     we would not try to implement it.
>      >>>>
>      >>>>     So in summary, a multi-output opcode cannot be used inline
>     like this.
>      >>>>
>      >>>>     Prof. Victor Lazzarini
>      >>>>     Maynooth University
>      >>>>     Ireland
>      >>>>
>      >>>>     > On 21 Sep 2025, at 14:35, joachim heintz
>     
>      >>>>     >>
>     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.
>      >>>>     >
>      >>>>     > my assumption was that if out(a1,a2) works, it should
>     also work
>      >>>>     if the
>      >>>>     > two arguments are the outputs of an expression, like here.
>      >>>>     >
>      >>>>     >
>      >>>>     >> On 21/09/2025 22:28, Eduardo Moguillansky wrote:
>      >>>>     >> pan2 returns two outputs, not an array. So I would say
>     that it is a
>      >>>>     >> limitation in the sense that for that to work one would
>     need to
>      >>>>     add a
>      >>>>     >> variant of pan2 which returns an array.
>      >>>>     >>
>      >>>>     >> On Sun, Sep 21, 2025 at 3:18 PM joachim heintz
>      >>>>     
>     >
>      >>>>     >>            >>> wrote:
>      >>>>     >>
>      >>>>     >>    nchnls = 2
>      >>>>     >>    0dbfs = 1
>      >>>>     >>
>      >>>>     >>    instr 1
>      >>>>     >>        sound:a = pinkish(.1)
>      >>>>     >>        out(pan2(sound,random:i(0,1)))
>      >>>>     >>    endin
>      >>>>     >>    schedule(1,0,1)
>      >>>>     >>
>      >>>>     >>    error: opcode 'pan2' for expression with arg types ai
>      >>>>     returns out-args
>      >>>>     >>    != 1, line 14
>      >>>>     >>
>      >>>>     >>    is this a limitation, or is it supposed to work?
>      >>>>     >>
>      >>>>     >>    thanks -
>      >>>>     >>             joachim
>      >>>>     >>
>      >>>>
> 

Date2025-09-22 20:14
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] expression with multiple outputs
Sounds great
Prof. Victor Lazzarini
Maynooth University
Ireland

On 22 Sep 2025, at 13:59, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:


I can add a variant of pan2, if needed

On Mon, Sep 22, 2025 at 2:45 PM joachim heintz <jh@joachimheintz.de> wrote:
yes what you say is what i had in mind:
"There could be a section in the manual on inlined opcodes giving
examples where it can be noted that only opcodes with one output may be
inlined."

in the case of pan2: might it be an idea to add an array output, as
eduardo mentioned?

On 22/09/2025 20:42, Victor Lazzarini wrote:
> What do you have in mind in terms of documentation?
>
> There could be a section in the manual on inlined opcodes giving examples where it can be noted that only opcodes with one output may be inlined.
>
> Note that this is a common approach in other languages that have multiple outputs. In Python tuples are used to handle this,
>
> def fun(): return 1, 2
>
> fun()
> (1,2)
>
> def fun2(a,b): return a, b
>
> fun2(fun())
> TypeError: fun2() missing 1 required positional argument 'b'
>
> fun2(fun()[0], fun()[1])
> (1,2)
>
> In Csound we can do similarly with arrays.
>
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 21 Sep 2025, at 23:13, joachim heintz <jh@joachimheintz.de> wrote:
>>
>> ok --- thanks to all for the explanations and thoughts.
>> i wonder where is a good place to document it.
>> or is it already anywhere documented?
>>
>>> On 22/09/2025 04:41, Victor Lazzarini wrote:
>>> It's a can of worms. I have discussed this with Steven and we concluded it's a bad idea.
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>>>> On 21 Sep 2025, at 19:25, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
>>>>
>>>> 
>>>> in theory the out could infer the [a,a] after I finish this behemoth change regarding struct arrays I could take a look at this
>>>>
>>>>> On Sun, 21 Sept 2025 at 17:17, Victor Lazzarini <000010b17ddd988e- dmarc-request@listserv.heanet.ie <mailto:000010b17ddd988e-dmarc- request@listserv.heanet.ie>> wrote:
>>>>
>>>>     No, we don't have that syntax and we have decided a while ago that
>>>>     we would not try to implement it.
>>>>
>>>>     So in summary, a multi-output opcode cannot be used inline like this.
>>>>
>>>>     Prof. Victor Lazzarini
>>>>     Maynooth University
>>>>     Ireland
>>>>
>>>>     > On 21 Sep 2025, at 14:35, joachim heintz <jh@joachimheintz.de
>>>>     <mailto:jh@joachimheintz.de>> 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.
>>>>     >
>>>>     > my assumption was that if out(a1,a2) works, it should also work
>>>>     if the
>>>>     > two arguments are the outputs of an expression, like here.
>>>>     >
>>>>     >
>>>>     >> On 21/09/2025 22:28, Eduardo Moguillansky wrote:
>>>>     >> pan2 returns two outputs, not an array. So I would say that it is a
>>>>     >> limitation in the sense that for that to work one would need to
>>>>     add a
>>>>     >> variant of pan2 which returns an array.
>>>>     >>
>>>>     >> On Sun, Sep 21, 2025 at 3:18 PM joachim heintz
>>>>     <jh@joachimheintz.de <mailto:jh@joachimheintz.de>
>>>>     >> <mailto:jh@joachimheintz.de <mailto:jh@joachimheintz.de>>> wrote:
>>>>     >>
>>>>     >>    nchnls = 2
>>>>     >>    0dbfs = 1
>>>>     >>
>>>>     >>    instr 1
>>>>     >>        sound:a = pinkish(.1)
>>>>     >>        out(pan2(sound,random:i(0,1)))
>>>>     >>    endin
>>>>     >>    schedule(1,0,1)
>>>>     >>
>>>>     >>    error: opcode 'pan2' for expression with arg types ai
>>>>     returns out-args
>>>>     >>    != 1, line 14
>>>>     >>
>>>>     >>    is this a limitation, or is it supposed to work?
>>>>     >>
>>>>     >>    thanks -
>>>>     >>             joachim
>>>>     >>
>>>>

Date2025-09-23 10:01
FromEduardo Moguillansky
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] expression with multiple outputs

On Mon, Sep 22, 2025 at 9:14 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
Sounds great
Prof. Victor Lazzarini
Maynooth University
Ireland

On 22 Sep 2025, at 13:59, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:


I can add a variant of pan2, if needed

On Mon, Sep 22, 2025 at 2:45 PM joachim heintz <jh@joachimheintz.de> wrote:
yes what you say is what i had in mind:
"There could be a section in the manual on inlined opcodes giving
examples where it can be noted that only opcodes with one output may be
inlined."

in the case of pan2: might it be an idea to add an array output, as
eduardo mentioned?

On 22/09/2025 20:42, Victor Lazzarini wrote:
> What do you have in mind in terms of documentation?
>
> There could be a section in the manual on inlined opcodes giving examples where it can be noted that only opcodes with one output may be inlined.
>
> Note that this is a common approach in other languages that have multiple outputs. In Python tuples are used to handle this,
>
> def fun(): return 1, 2
>
> fun()
> (1,2)
>
> def fun2(a,b): return a, b
>
> fun2(fun())
> TypeError: fun2() missing 1 required positional argument 'b'
>
> fun2(fun()[0], fun()[1])
> (1,2)
>
> In Csound we can do similarly with arrays.
>
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 21 Sep 2025, at 23:13, joachim heintz <jh@joachimheintz.de> wrote:
>>
>> ok --- thanks to all for the explanations and thoughts.
>> i wonder where is a good place to document it.
>> or is it already anywhere documented?
>>
>>> On 22/09/2025 04:41, Victor Lazzarini wrote:
>>> It's a can of worms. I have discussed this with Steven and we concluded it's a bad idea.
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>>>> On 21 Sep 2025, at 19:25, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
>>>>
>>>> 
>>>> in theory the out could infer the [a,a] after I finish this behemoth change regarding struct arrays I could take a look at this
>>>>
>>>>> On Sun, 21 Sept 2025 at 17:17, Victor Lazzarini <000010b17ddd988e- dmarc-request@listserv.heanet.ie <mailto:000010b17ddd988e-dmarc- request@listserv.heanet.ie>> wrote:
>>>>
>>>>     No, we don't have that syntax and we have decided a while ago that
>>>>     we would not try to implement it.
>>>>
>>>>     So in summary, a multi-output opcode cannot be used inline like this.
>>>>
>>>>     Prof. Victor Lazzarini
>>>>     Maynooth University
>>>>     Ireland
>>>>
>>>>     > On 21 Sep 2025, at 14:35, joachim heintz <jh@joachimheintz.de
>>>>     <mailto:jh@joachimheintz.de>> 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.
>>>>     >
>>>>     > my assumption was that if out(a1,a2) works, it should also work
>>>>     if the
>>>>     > two arguments are the outputs of an expression, like here.
>>>>     >
>>>>     >
>>>>     >> On 21/09/2025 22:28, Eduardo Moguillansky wrote:
>>>>     >> pan2 returns two outputs, not an array. So I would say that it is a
>>>>     >> limitation in the sense that for that to work one would need to
>>>>     add a
>>>>     >> variant of pan2 which returns an array.
>>>>     >>
>>>>     >> On Sun, Sep 21, 2025 at 3:18 PM joachim heintz
>>>>     <jh@joachimheintz.de <mailto:jh@joachimheintz.de>
>>>>     >> <mailto:jh@joachimheintz.de <mailto:jh@joachimheintz.de>>> wrote:
>>>>     >>
>>>>     >>    nchnls = 2
>>>>     >>    0dbfs = 1
>>>>     >>
>>>>     >>    instr 1
>>>>     >>        sound:a = pinkish(.1)
>>>>     >>        out(pan2(sound,random:i(0,1)))
>>>>     >>    endin
>>>>     >>    schedule(1,0,1)
>>>>     >>
>>>>     >>    error: opcode 'pan2' for expression with arg types ai
>>>>     returns out-args
>>>>     >>    != 1, line 14
>>>>     >>
>>>>     >>    is this a limitation, or is it supposed to work?
>>>>     >>
>>>>     >>    thanks -
>>>>     >>             joachim
>>>>     >>
>>>>