Csound Csound-dev Csound-tekno Search About

Optional outputs for UDO

Date2017-01-05 13:17
FromPeter Burgess
SubjectOptional outputs for UDO
Hi. While writing a UDO, is there a way of listing an output as
optional, so I can choose whether or not use one or more of the
outputs. For example:

Let's pretend the 'o' on the UDO's output list represents the optional one....

opcode "MyUDO", ao, ii
iIn1, iIn2 xin
;Some Code Here
xout aOut, aOutOptional
endop

With the above pseudo code, I would want to be able to do either of
the following:

aRes MyUDO iIn1, iIn2

aRes, aResOptional MyUDO iIn1, iIn2

Is there a way to do that already? And if not, is there a way to do
that when writing an opcode in C/C++?

Pete

Date2017-01-05 13:53
FromVictor Lazzarini
SubjectRe: Optional outputs for UDO
Overload the UDO:

opcode Test,kk,kk
k1,k2 xin
xout k1*k2,k1+k2
endop

opcode Test,k,kk
k1,k2 xin
k1,k2 Test k1,k2
xout k1
endop


instr 1
k1 Test 1,2
k2,k3 Test 1,2
printk2 k1
printk2 k2
printk2 k3
endin

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 5 Jan 2017, at 13:17, Peter Burgess  wrote:
> 
> Hi. While writing a UDO, is there a way of listing an output as
> optional, so I can choose whether or not use one or more of the
> outputs. For example:
> 
> Let's pretend the 'o' on the UDO's output list represents the optional one....
> 
> opcode "MyUDO", ao, ii
> iIn1, iIn2 xin
> ;Some Code Here
> xout aOut, aOutOptional
> endop
> 
> With the above pseudo code, I would want to be able to do either of
> the following:
> 
> aRes MyUDO iIn1, iIn2
> 
> aRes, aResOptional MyUDO iIn1, iIn2
> 
> Is there a way to do that already? And if not, is there a way to do
> that when writing an opcode in C/C++?
> 
> Pete
> 
> 
> -- 
> http://algorythmradio.com
> https://soundcloud.com/algorythmradio
> 
> 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-05 15:50
FromPeter Burgess
SubjectRe: Optional outputs for UDO
Ok, that's fair enough, I was just hoping there was a way to do it
without writing it out again. Is it possible to have optional outputs
with proper opcodes?

On Thu, Jan 5, 2017 at 1:53 PM, Victor Lazzarini
 wrote:
> Overload the UDO:
>
> opcode Test,kk,kk
> k1,k2 xin
> xout k1*k2,k1+k2
> endop
>
> opcode Test,k,kk
> k1,k2 xin
> k1,k2 Test k1,k2
> xout k1
> endop
>
>
> instr 1
> k1 Test 1,2
> k2,k3 Test 1,2
> printk2 k1
> printk2 k2
> printk2 k3
> endin
>
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 5 Jan 2017, at 13:17, Peter Burgess  wrote:
>>
>> Hi. While writing a UDO, is there a way of listing an output as
>> optional, so I can choose whether or not use one or more of the
>> outputs. For example:
>>
>> Let's pretend the 'o' on the UDO's output list represents the optional one....
>>
>> opcode "MyUDO", ao, ii
>> iIn1, iIn2 xin
>> ;Some Code Here
>> xout aOut, aOutOptional
>> endop
>>
>> With the above pseudo code, I would want to be able to do either of
>> the following:
>>
>> aRes MyUDO iIn1, iIn2
>>
>> aRes, aResOptional MyUDO iIn1, iIn2
>>
>> Is there a way to do that already? And if not, is there a way to do
>> that when writing an opcode in C/C++?
>>
>> Pete
>>
>>
>> --
>> http://algorythmradio.com
>> https://soundcloud.com/algorythmradio
>>
>> 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-05 15:58
FromVictor Lazzarini
SubjectRe: Optional outputs for UDO
No, it’s all about overloading.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 5 Jan 2017, at 15:50, Peter Burgess  wrote:
> 
> Ok, that's fair enough, I was just hoping there was a way to do it
> without writing it out again. Is it possible to have optional outputs
> with proper opcodes?
> 
> On Thu, Jan 5, 2017 at 1:53 PM, Victor Lazzarini
>  wrote:
>> Overload the UDO:
>> 
>> opcode Test,kk,kk
>> k1,k2 xin
>> xout k1*k2,k1+k2
>> endop
>> 
>> opcode Test,k,kk
>> k1,k2 xin
>> k1,k2 Test k1,k2
>> xout k1
>> endop
>> 
>> 
>> instr 1
>> k1 Test 1,2
>> k2,k3 Test 1,2
>> printk2 k1
>> printk2 k2
>> printk2 k3
>> endin
>> 
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>> 
>>> On 5 Jan 2017, at 13:17, Peter Burgess  wrote:
>>> 
>>> Hi. While writing a UDO, is there a way of listing an output as
>>> optional, so I can choose whether or not use one or more of the
>>> outputs. For example:
>>> 
>>> Let's pretend the 'o' on the UDO's output list represents the optional one....
>>> 
>>> opcode "MyUDO", ao, ii
>>> iIn1, iIn2 xin
>>> ;Some Code Here
>>> xout aOut, aOutOptional
>>> endop
>>> 
>>> With the above pseudo code, I would want to be able to do either of
>>> the following:
>>> 
>>> aRes MyUDO iIn1, iIn2
>>> 
>>> aRes, aResOptional MyUDO iIn1, iIn2
>>> 
>>> Is there a way to do that already? And if not, is there a way to do
>>> that when writing an opcode in C/C++?
>>> 
>>> Pete
>>> 
>>> 
>>> --
>>> http://algorythmradio.com
>>> https://soundcloud.com/algorythmradio
>>> 
>>> 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
> 
> 
> 
> -- 
> http://algorythmradio.com
> https://soundcloud.com/algorythmradio
> 
> 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-05 16:02
FromPeter Burgess
SubjectRe: Optional outputs for UDO
Okey doke. Cheers for your help!

Pete

On Thu, Jan 5, 2017 at 3:58 PM, Victor Lazzarini
 wrote:
> No, it’s all about overloading.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 5 Jan 2017, at 15:50, Peter Burgess  wrote:
>>
>> Ok, that's fair enough, I was just hoping there was a way to do it
>> without writing it out again. Is it possible to have optional outputs
>> with proper opcodes?
>>
>> On Thu, Jan 5, 2017 at 1:53 PM, Victor Lazzarini
>>  wrote:
>>> Overload the UDO:
>>>
>>> opcode Test,kk,kk
>>> k1,k2 xin
>>> xout k1*k2,k1+k2
>>> endop
>>>
>>> opcode Test,k,kk
>>> k1,k2 xin
>>> k1,k2 Test k1,k2
>>> xout k1
>>> endop
>>>
>>>
>>> instr 1
>>> k1 Test 1,2
>>> k2,k3 Test 1,2
>>> printk2 k1
>>> printk2 k2
>>> printk2 k3
>>> endin
>>>
>>> ========================
>>> Prof. Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>
>>>> On 5 Jan 2017, at 13:17, Peter Burgess  wrote:
>>>>
>>>> Hi. While writing a UDO, is there a way of listing an output as
>>>> optional, so I can choose whether or not use one or more of the
>>>> outputs. For example:
>>>>
>>>> Let's pretend the 'o' on the UDO's output list represents the optional one....
>>>>
>>>> opcode "MyUDO", ao, ii
>>>> iIn1, iIn2 xin
>>>> ;Some Code Here
>>>> xout aOut, aOutOptional
>>>> endop
>>>>
>>>> With the above pseudo code, I would want to be able to do either of
>>>> the following:
>>>>
>>>> aRes MyUDO iIn1, iIn2
>>>>
>>>> aRes, aResOptional MyUDO iIn1, iIn2
>>>>
>>>> Is there a way to do that already? And if not, is there a way to do
>>>> that when writing an opcode in C/C++?
>>>>
>>>> Pete
>>>>
>>>>
>>>> --
>>>> http://algorythmradio.com
>>>> https://soundcloud.com/algorythmradio
>>>>
>>>> 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
>>
>>
>>
>> --
>> http://algorythmradio.com
>> https://soundcloud.com/algorythmradio
>>
>> 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



-- 
http://algorythmradio.com
https://soundcloud.com/algorythmradio

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-05 16:11
Fromjpff
SubjectRe: Optional outputs for UDO
For ocodes yes it is, but it is akwaed to do.  Type code m or z does it, 
but it is a pain
==John ff

On Thu, 5 Jan 2017, Peter Burgess wrote:

> Ok, that's fair enough, I was just hoping there was a way to do it
> without writing it out again. Is it possible to have optional outputs
> with proper opcodes?
>
> On Thu, Jan 5, 2017 at 1:53 PM, Victor Lazzarini
>  wrote:
>> Overload the UDO:
>>
>> opcode Test,kk,kk
>> k1,k2 xin
>> xout k1*k2,k1+k2
>> endop
>>
>> opcode Test,k,kk
>> k1,k2 xin
>> k1,k2 Test k1,k2
>> xout k1
>> endop
>>
>>
>> instr 1
>> k1 Test 1,2
>> k2,k3 Test 1,2
>> printk2 k1
>> printk2 k2
>> printk2 k3
>> endin
>>
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>>> On 5 Jan 2017, at 13:17, Peter Burgess  wrote:
>>>
>>> Hi. While writing a UDO, is there a way of listing an output as
>>> optional, so I can choose whether or not use one or more of the
>>> outputs. For example:
>>>
>>> Let's pretend the 'o' on the UDO's output list represents the optional one....
>>>
>>> opcode "MyUDO", ao, ii
>>> iIn1, iIn2 xin
>>> ;Some Code Here
>>> xout aOut, aOutOptional
>>> endop
>>>
>>> With the above pseudo code, I would want to be able to do either of
>>> the following:
>>>
>>> aRes MyUDO iIn1, iIn2
>>>
>>> aRes, aResOptional MyUDO iIn1, iIn2
>>>
>>> Is there a way to do that already? And if not, is there a way to do
>>> that when writing an opcode in C/C++?
>>>
>>> Pete
>>>
>>>
>>> --
>>> http://algorythmradio.com
>>> https://soundcloud.com/algorythmradio
>>>
>>> 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
>
>
>
> -- 
> http://algorythmradio.com
> https://soundcloud.com/algorythmradio
>
> 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-05 16:12
FromPeter Burgess
SubjectRe: Optional outputs for UDO
In what way is it a pain?

On Thu, Jan 5, 2017 at 4:11 PM, jpff  wrote:
> For ocodes yes it is, but it is akwaed to do.  Type code m or z does it, but
> it is a pain
> ==John ff
>
>
> On Thu, 5 Jan 2017, Peter Burgess wrote:
>
>> Ok, that's fair enough, I was just hoping there was a way to do it
>> without writing it out again. Is it possible to have optional outputs
>> with proper opcodes?
>>
>> On Thu, Jan 5, 2017 at 1:53 PM, Victor Lazzarini
>>  wrote:
>>>
>>> Overload the UDO:
>>>
>>> opcode Test,kk,kk
>>> k1,k2 xin
>>> xout k1*k2,k1+k2
>>> endop
>>>
>>> opcode Test,k,kk
>>> k1,k2 xin
>>> k1,k2 Test k1,k2
>>> xout k1
>>> endop
>>>
>>>
>>> instr 1
>>> k1 Test 1,2
>>> k2,k3 Test 1,2
>>> printk2 k1
>>> printk2 k2
>>> printk2 k3
>>> endin
>>>
>>> ========================
>>> Prof. Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>
>>>> On 5 Jan 2017, at 13:17, Peter Burgess 
>>>> wrote:
>>>>
>>>> Hi. While writing a UDO, is there a way of listing an output as
>>>> optional, so I can choose whether or not use one or more of the
>>>> outputs. For example:
>>>>
>>>> Let's pretend the 'o' on the UDO's output list represents the optional
>>>> one....
>>>>
>>>> opcode "MyUDO", ao, ii
>>>> iIn1, iIn2 xin
>>>> ;Some Code Here
>>>> xout aOut, aOutOptional
>>>> endop
>>>>
>>>> With the above pseudo code, I would want to be able to do either of
>>>> the following:
>>>>
>>>> aRes MyUDO iIn1, iIn2
>>>>
>>>> aRes, aResOptional MyUDO iIn1, iIn2
>>>>
>>>> Is there a way to do that already? And if not, is there a way to do
>>>> that when writing an opcode in C/C++?
>>>>
>>>> Pete
>>>>
>>>>
>>>> --
>>>> http://algorythmradio.com
>>>> https://soundcloud.com/algorythmradio
>>>>
>>>> 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
>>
>>
>>
>>
>> --
>> http://algorythmradio.com
>> https://soundcloud.com/algorythmradio
>>
>> 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-05 16:21
Frommskala@ANSUZ.SOOKE.BC.CA
SubjectRe: Optional outputs for UDO
On Thu, 5 Jan 2017, Peter Burgess wrote:
> Ok, that's fair enough, I was just hoping there was a way to do it
> without writing it out again. Is it possible to have optional outputs
> with proper opcodes?

Not sure what you mean by "proper" opcodes, but you could avoid
duplicate code by having one version call the other.

Date2017-01-05 16:24
FromPeter Burgess
SubjectRe: Optional outputs for UDO
By "proper" opcodes, I mean ones written in C/C++ that are part of the
Csound language, as opposed to user defined opcodes

On Thu, Jan 5, 2017 at 4:21 PM,   wrote:
> On Thu, 5 Jan 2017, Peter Burgess wrote:
>> Ok, that's fair enough, I was just hoping there was a way to do it
>> without writing it out again. Is it possible to have optional outputs
>> with proper opcodes?
>
> Not sure what you mean by "proper" opcodes, but you could avoid
> duplicate code by having one version call the other.
>
> --
> Matthew Skala
> mskala@ansuz.sooke.bc.ca                 People before principles.
> http://ansuz.sooke.bc.ca/
>
> 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-05 16:33
Fromjpff
SubjectRe: Optional outputs for UDO
Look at iplementation of init or soundin ot in or....
It looks like an arbitary number but the m (or I or z) actually marks an 
optional .  There is a macro (pace Mike) to say ow many were actually 
provided and it up to the cde to hadle it.   It is a pain because we would 
like arbitary umbes of outs but te structures forbid.

Just my opinion, but  like macros so what do I know/


On Thu, 5 Jan 2017, Peter Burgess wrote:

> In what way is it a pain?
>
> On Thu, Jan 5, 2017 at 4:11 PM, jpff  wrote:
>> For ocodes yes it is, but it is akwaed to do.  Type code m or z does it, but
>> it is a pain
>> ==John ff
>>
>>
>> On Thu, 5 Jan 2017, Peter Burgess wrote:
>>
>>> Ok, that's fair enough, I was just hoping there was a way to do it
>>> without writing it out again. Is it possible to have optional outputs
>>> with proper opcodes?
>>>
>>> On Thu, Jan 5, 2017 at 1:53 PM, Victor Lazzarini
>>>  wrote:
>>>>
>>>> Overload the UDO:
>>>>
>>>> opcode Test,kk,kk
>>>> k1,k2 xin
>>>> xout k1*k2,k1+k2
>>>> endop
>>>>
>>>> opcode Test,k,kk
>>>> k1,k2 xin
>>>> k1,k2 Test k1,k2
>>>> xout k1
>>>> endop
>>>>
>>>>
>>>> instr 1
>>>> k1 Test 1,2
>>>> k2,k3 Test 1,2
>>>> printk2 k1
>>>> printk2 k2
>>>> printk2 k3
>>>> endin
>>>>
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>> Maynooth University,
>>>> Maynooth, Co Kildare, Ireland
>>>> Tel: 00 353 7086936
>>>> Fax: 00 353 1 7086952
>>>>
>>>>> On 5 Jan 2017, at 13:17, Peter Burgess 
>>>>> wrote:
>>>>>
>>>>> Hi. While writing a UDO, is there a way of listing an output as
>>>>> optional, so I can choose whether or not use one or more of the
>>>>> outputs. For example:
>>>>>
>>>>> Let's pretend the 'o' on the UDO's output list represents the optional
>>>>> one....
>>>>>
>>>>> opcode "MyUDO", ao, ii
>>>>> iIn1, iIn2 xin
>>>>> ;Some Code Here
>>>>> xout aOut, aOutOptional
>>>>> endop
>>>>>
>>>>> With the above pseudo code, I would want to be able to do either of
>>>>> the following:
>>>>>
>>>>> aRes MyUDO iIn1, iIn2
>>>>>
>>>>> aRes, aResOptional MyUDO iIn1, iIn2
>>>>>
>>>>> Is there a way to do that already? And if not, is there a way to do
>>>>> that when writing an opcode in C/C++?
>>>>>
>>>>> Pete
>>>>>
>>>>>
>>>>> --
>>>>> http://algorythmradio.com
>>>>> https://soundcloud.com/algorythmradio
>>>>>
>>>>> 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
>>>
>>>
>>>
>>>
>>> --
>>> http://algorythmradio.com
>>> https://soundcloud.com/algorythmradio
>>>
>>> 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
>
>
>
> -- 
> http://algorythmradio.com
> https://soundcloud.com/algorythmradio
>
> 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-06 12:30
FromPeter Burgess
SubjectRe: Optional outputs for UDO
Haha! OK cool, I'll have a look at that, cheers buddy

On 5 Jan 2017 4:33 p.m., "jpff" <jpff@codemist.co.uk> wrote:
Look at iplementation of init or soundin ot in or....
It looks like an arbitary number but the m (or I or z) actually marks an optional .  There is a macro (pace Mike) to say ow many were actually provided and it up to the cde to hadle it.   It is a pain because we would like arbitary umbes of outs but te structures forbid.

Just my opinion, but  like macros so what do I know/


On Thu, 5 Jan 2017, Peter Burgess wrote:

In what way is it a pain?

On Thu, Jan 5, 2017 at 4:11 PM, jpff <jpff@codemist.co.uk> wrote:
For ocodes yes it is, but it is akwaed to do.  Type code m or z does it, but
it is a pain
==John ff


On Thu, 5 Jan 2017, Peter Burgess wrote:

Ok, that's fair enough, I was just hoping there was a way to do it
without writing it out again. Is it possible to have optional outputs
with proper opcodes?

On Thu, Jan 5, 2017 at 1:53 PM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:

Overload the UDO:

opcode Test,kk,kk
k1,k2 xin
xout k1*k2,k1+k2
endop

opcode Test,k,kk
k1,k2 xin
k1,k2 Test k1,k2
xout k1
endop


instr 1
k1 Test 1,2
k2,k3 Test 1,2
printk2 k1
printk2 k2
printk2 k3
endin

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 5 Jan 2017, at 13:17, Peter Burgess <pete.soundtechnician@gmail.com>
wrote:

Hi. While writing a UDO, is there a way of listing an output as
optional, so I can choose whether or not use one or more of the
outputs. For example:

Let's pretend the 'o' on the UDO's output list represents the optional
one....

opcode "MyUDO", ao, ii
iIn1, iIn2 xin
;Some Code Here
xout aOut, aOutOptional
endop

With the above pseudo code, I would want to be able to do either of
the following:

aRes MyUDO iIn1, iIn2

aRes, aResOptional MyUDO iIn1, iIn2

Is there a way to do that already? And if not, is there a way to do
that when writing an opcode in C/C++?

Pete


--
http://algorythmradio.com
https://soundcloud.com/algorythmradio

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




--
http://algorythmradio.com
https://soundcloud.com/algorythmradio

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



--
http://algorythmradio.com
https://soundcloud.com/algorythmradio

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