Csound Csound-dev Csound-tekno Search About

Re: [Csnd] [EXTERNAL] Re: [Csnd] New UDO syntax question

Date2026-04-25 17:04
FromJean Basile Sosa
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] New UDO syntax question
Interesting, I've made tests only using osc messages from outside the csd via an udp port, and send basic messages such as /csound/event works only using the old syntax UDO, the console print the pfield argument which seems has been set correctly, I can hear Csound plays an instance and control some channels. It's the setget2() who causes only an error in this case. 

But effectively testing the csd on a more simple way causes the same error in both case.

It's because I usually send a score instruction first, with a number of pfield given, before to control some channels, that I would like to declare all chnset corresponding to all chnget in the same udo.

Have you an advice to declare he first argument of chnset otherwise than use pindex?

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

Date2026-04-25 18:15
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] New UDO syntax question
I actually don't know but here's the main difference between the old-style and new-style udo:

1) Old-style: the argument value is copied into the variable pfield inside the UDO.

2) New-style: the pfield variable is a reference to the variable or value passed into the UDO. That means it shares the same memory.

So as you can see, this may have implications for your code.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 25 Apr 2026, at 17:04, Jean Basile Sosa  wrote:
>
> Interesting, I've made tests only using osc messages from outside the csd via an udp port, and send basic messages such as /csound/event works only using the old syntax UDO, the console print the pfield argument which seems has been set correctly, I can hear Csound plays an instance and control some channels. It's the setget2() who causes only an error in this case.
>
> But effectively testing the csd on a more simple way causes the same error in both case.
>
> It's because I usually send a score instruction first, with a number of pfield given, before to control some channels, that I would like to declare all chnset corresponding to all chnget in the same udo.
>
> Have you an advice to declare he first argument of chnset otherwise than use pindex?
>
> 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
The information contained in this email may be confidential and privileged. It is intended only for the addressee(s) stated above. If you are not an addressee any use, dissemination, distribution, publication or copying of the information contained in this email is strictly prohibited. If you have received this email in error, please immediately notify us by email at dataprotection@mu.ie and delete this email from your system.

Please note that Maynooth University is subject to Freedom of Information and Data Protection laws. We may be required to disclose the content of emails under the FOI Act 2014, the Data Protection Act 2018 or GDPR.

Is don seolaí / do na seolaithe thuasluaite amháin an ríomhphost seo. D’fhéadfadh an t-eolas atá ann a bheith rúnda agus faoi phribhléid. Mura seolaí tú, tá cosc iomlán ar aon eolas atá sa ríomhphost seo a úsáid, a scaipeadh, a dháileadh, a fhoilsiú nó a chóipeáil. Má fuair tú an ríomhphost seo trí thimpiste, cuir sin in iúl dúinn láithreach trí ríomhphost a chur chuig  dataprotection@mu.ie  agus scrios an ríomhphost seo ó do chóras.

Tabhair faoi deara go bhfuil Ollscoil Mhá Nuad faoi réir dhlíthe um Shaoráil Faisnéise agus um Chosaint Sonraí. D’fhéadfadh ceangal a bheith orainn ábhar ríomhphoist a nochtadh faoin Acht um Shaoráil Faisnéise 2014, faoin Acht um Chosaint Sonraí 2018 nó faoi GDPR.

Registered charity number 20037130



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

Date2026-04-25 18:45
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] New UDO syntax question
In particular consider this:

value@global:k = chnget(chnidx)
xout(value)

value is a global variable. With new-style UDO this global variable shares the memory of a variable in the instrument.
It’s bound to cause trouble. I think that may be an issue with the code.

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland






> On 25 Apr 2026, at 18:15, Victor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE> wrote:
>
> I actually don't know but here's the main difference between the old-style and new-style udo:
>
> 1) Old-style: the argument value is copied into the variable pfield inside the UDO.
>
> 2) New-style: the pfield variable is a reference to the variable or value passed into the UDO. That means it shares the same memory.
>
> So as you can see, this may have implications for your code.
>
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 25 Apr 2026, at 17:04, Jean Basile Sosa  wrote:
>>
>> Interesting, I've made tests only using osc messages from outside the csd via an udp port, and send basic messages such as /csound/event works only using the old syntax UDO, the console print the pfield argument which seems has been set correctly, I can hear Csound plays an instance and control some channels. It's the setget2() who causes only an error in this case.
>>
>> But effectively testing the csd on a more simple way causes the same error in both case.
>>
>> It's because I usually send a score instruction first, with a number of pfield given, before to control some channels, that I would like to declare all chnset corresponding to all chnget in the same udo.
>>
>> Have you an advice to declare he first argument of chnset otherwise than use pindex?
>>
>> 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
> The information contained in this email may be confidential and privileged. It is intended only for the addressee(s) stated above. If you are not an addressee any use, dissemination, distribution, publication or copying of the information contained in this email is strictly prohibited. If you have received this email in error, please immediately notify us by email at dataprotection@mu.ie and delete this email from your system.
>
> Please note that Maynooth University is subject to Freedom of Information and Data Protection laws. We may be required to disclose the content of emails under the FOI Act 2014, the Data Protection Act 2018 or GDPR.
>
> Is don seolaí / do na seolaithe thuasluaite amháin an ríomhphost seo. D’fhéadfadh an t-eolas atá ann a bheith rúnda agus faoi phribhléid. Mura seolaí tú, tá cosc iomlán ar aon eolas atá sa ríomhphost seo a úsáid, a scaipeadh, a dháileadh, a fhoilsiú nó a chóipeáil. Má fuair tú an ríomhphost seo trí thimpiste, cuir sin in iúl dúinn láithreach trí ríomhphost a chur chuig  dataprotection@mu.ie  agus scrios an ríomhphost seo ó do chóras.
>
> Tabhair faoi deara go bhfuil Ollscoil Mhá Nuad faoi réir dhlíthe um Shaoráil Faisnéise agus um Chosaint Sonraí. D’fhéadfadh ceangal a bheith orainn ábhar ríomhphoist a nochtadh faoin Acht um Shaoráil Faisnéise 2014, faoin Acht um Chosaint Sonraí 2018 nó faoi GDPR.
>
> Registered charity number 20037130
>
>
>
> 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

The information contained in this email may be confidential and privileged. It is intended only for the addressee(s) stated above. If you are not an addressee any use, dissemination, distribution, publication or copying of the information contained in this email is strictly prohibited. If you have received this email in error, please immediately notify us by email at dataprotection@mu.ie and delete this email from your system.

Please note that Maynooth University is subject to Freedom of Information and Data Protection laws. We may be required to disclose the content of emails under the FOI Act 2014, the Data Protection Act 2018 or GDPR.

Is don seolaí / do na seolaithe thuasluaite amháin an ríomhphost seo. D’fhéadfadh an t-eolas atá ann a bheith rúnda agus faoi phribhléid. Mura seolaí tú, tá cosc iomlán ar aon eolas atá sa ríomhphost seo a úsáid, a scaipeadh, a dháileadh, a fhoilsiú nó a chóipeáil. Má fuair tú an ríomhphost seo trí thimpiste, cuir sin in iúl dúinn láithreach trí ríomhphost a chur chuig  dataprotection@mu.ie  agus scrios an ríomhphost seo ó do chóras.

Tabhair faoi deara go bhfuil Ollscoil Mhá Nuad faoi réir dhlíthe um Shaoráil Faisnéise agus um Chosaint Sonraí. D’fhéadfadh ceangal a bheith orainn ábhar ríomhphoist a nochtadh faoin Acht um Shaoráil Faisnéise 2014, faoin Acht um Chosaint Sonraí 2018 nó faoi GDPR.

Registered charity number 20037130



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