Csound Csound-dev Csound-tekno Search About

[Csnd] UDO type annotations

Date2018-08-17 13:28
FromDave Seidel
Subject[Csnd] UDO type annotations
I need to be be able to ensure that a UDO will be called at k-time. As Joachim kindly reminded me on the dev list, this can be done using a type annotation, like so:

kfoo = my_udo:k(ibar, kbaz, kquux)

However, at least one of the UDOs I would like to use in this way has multiple return value, so I can't use the new function syntax. Is there any way to do this kind of type coercion with a UDO using the original syntax?

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

Date2018-08-17 13:58
FromMauro Giubileo
SubjectRe: [Csnd] UDO type annotations

Hi, the UDOs are always called at k-time. The "opcode:x(...)" notation is for those opcodes that could return different types of variable and you use them inside an expression. With the classic syntax you don't have to worry of the right return type, because it is automatically derived from the output variable type.

For example, when you write:

kvar linseg 0, 1, 1

you can be sure that this linseg will always return a k-type value because kvar is a k-type variable.

Regards,
Mauro

---


Il 2018-08-17 14:28 Dave Seidel ha scritto:

I need to be be able to ensure that a UDO will be called at k-time. As Joachim kindly reminded me on the dev list, this can be done using a type annotation, like so:
 
kfoo = my_udo:k(ibar, kbaz, kquux)

However, at least one of the UDOs I would like to use in this way has multiple return value, so I can't use the new function syntax. Is there any way to do this kind of type coercion with a UDO using the original syntax?
 
 
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

Date2018-08-17 14:12
FromMauro Giubileo
SubjectRe: [Csnd] UDO type annotations

A clarification: if an UDO returns only i-values, of course it will be executed only at init-time. In all other cases, it will have an init-time and next it will run at each k-time.

Mauro


Il 2018-08-17 14:58 Mauro Giubileo ha scritto:

Hi, the UDOs are always called at k-time. The "opcode:x(...)" notation is for those opcodes that could return different types of variable and you use them inside an expression. With the classic syntax you don't have to worry of the right return type, because it is automatically derived from the output variable type.

For example, when you write:

kvar linseg 0, 1, 1

you can be sure that this linseg will always return a k-type value because kvar is a k-type variable.

Regards,
Mauro

---


Il 2018-08-17 14:28 Dave Seidel ha scritto:

I need to be be able to ensure that a UDO will be called at k-time. As Joachim kindly reminded me on the dev list, this can be done using a type annotation, like so:
 
kfoo = my_udo:k(ibar, kbaz, kquux)

However, at least one of the UDOs I would like to use in this way has multiple return value, so I can't use the new function syntax. Is there any way to do this kind of type coercion with a UDO using the original syntax?
 
 
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


Date2018-08-18 10:18
Fromjoachim heintz
SubjectRe: [Csnd] UDO type annotations
hi mauro -

i think it is slightly more complicated, and i tried to describe the 
issue on the thread dave mentioned on the dev list.  are you on the dev 
list or can join it?  i think it is better to discuss there, and perhaps 
i overlooked something.

best -
	joachim



On 17/08/18 15:12, Mauro Giubileo wrote:
> A clarification: if an UDO returns only i-values, of course it will be
> executed only at init-time. In all other cases, it will have an
> init-time and next it will run at each k-time.
>
> Mauro
>
>
> Il 2018-08-17 14:58 Mauro Giubileo ha scritto:
>
>> Hi, the UDOs are always called at k-time. The "opcode:x(...)" notation
>> is for those opcodes that could return different types of variable and
>> you use them inside an expression. With the classic syntax you don't
>> have to worry of the right return type, because it is automatically
>> derived from the output variable type.
>>
>> For example, when you write:
>>
>> kvar linseg 0, 1, 1
>>
>> you can be sure that this linseg will always return a k-type value
>> because kvar is a k-type variable.
>>
>> Regards,
>> Mauro
>>
>> ---
>>
>>
>> Il 2018-08-17 14:28 Dave Seidel ha scritto:
>>
>>     I need to be be able to ensure that a UDO will be called at
>>     k-time. As Joachim kindly reminded me on the dev list, this can be
>>     done using a type annotation, like so:
>>
>>     kfoo = my_udo:k(ibar, kbaz, kquux)
>>
>>     However, at least one of the UDOs I would like to use in this way
>>     has multiple return value, so I can't use the new function syntax.
>>     Is there any way to do this kind of type coercion with a UDO using
>>     the original syntax?
>>
>>
>>     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

Date2018-08-18 10:46
FromMauro Giubileo
SubjectRe: [Csnd] UDO type annotations

Hi, currently I'm not on the dev-list... I will check it and (if I have something to say) join there! :-)

Mauro


Il 2018-08-18 11:18 joachim heintz ha scritto:

hi mauro -

i think it is slightly more complicated, and i tried to describe the issue on the thread dave mentioned on the dev list.  are you on the dev list or can join it?  i think it is better to discuss there, and perhaps i overlooked something.

best -
    joachim



On 17/08/18 15:12, Mauro Giubileo wrote:
A clarification: if an UDO returns only i-values, of course it will be
executed only at init-time. In all other cases, it will have an
init-time and next it will run at each k-time.

Mauro


Il 2018-08-17 14:58 Mauro Giubileo ha scritto:

Hi, the UDOs are always called at k-time. The "opcode:x(...)" notation
is for those opcodes that could return different types of variable and
you use them inside an expression. With the classic syntax you don't
have to worry of the right return type, because it is automatically
derived from the output variable type.

For example, when you write:

kvar linseg 0, 1, 1

you can be sure that this linseg will always return a k-type value
because kvar is a k-type variable.

Regards,
Mauro

---


Il 2018-08-17 14:28 Dave Seidel ha scritto:

    I need to be be able to ensure that a UDO will be called at
    k-time. As Joachim kindly reminded me on the dev list, this can be
    done using a type annotation, like so:

    kfoo = my_udo:k(ibar, kbaz, kquux)

    However, at least one of the UDOs I would like to use in this way
    has multiple return value, so I can't use the new function syntax.
    Is there any way to do this kind of type coercion with a UDO using
    the original syntax?


    Csound mailing list Csound@listserv.heanet.ie
    <mailto: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
<mailto: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
<mailto: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