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

What is the error with the setget2()?

Prof. Victor Lazzarini
Maynooth University
Ireland

*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.

Hello,

I would like to ask you some explanations about the new UDO syntax.

In a UDP / OSC context, I send to Csound just simple messages as “/csound/event …” or “/csound/channel/…”.

This csound code works well:

<CsoundSynthesizer>
<CsOptions>
-odac --port=7777
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 128
nchnls = 2
0dbfs = 1

gisquare ftgen 2, 0, 16384, 10, 1, 0 , .33, 0, .2 , 0, .14, 0 , .11, 0, .09

opcode setget, k, i
pfield:i xin
chnidx:S = sprintf&quot;%\.02f\_p%d&quot;, p1, pfield
fieldvalue:i = pindexpfield
chnsetfieldvalue,chnidx
value@global:k = chngetchnidx
xoutvalue
putschnidx, 1
endop

instr 1

asig = oscilsetget\(5, setget4, 2)

outs asig*asetget\(6), asig*asetget\(6)

endin

For example, send a /csound/event "i1.01 0.0000 15.0000 51.0000 0.3390 1.0000” message provide a new instance of i1, and send after that for example a /csound/channel/1.01_p4 [val] massage control the setget4 parameter / pfield associated. No Csound console warning such as "i1 uses 6 pfield but etc." too.

But you can see the opcode setget uses a mix of old and new syntax.

When I try to follow the new Csound 7 syntax approach this causes some errors and makes my mind noob again.

Indeed, when I try to send the same messages with this udo:

opcode setget2pfield:i:k
chnidx:S = sprintf&quot;%\.02f\_p%d&quot;, p1, pfield
fieldvalue:i = pindexpfield
chnsetfieldvalue,chnidx
value@global:k = chngetchnidx
xoutvalue
putschnidx, 1
endop

Csound receives an error. I’ve tried to write the udo otherwise but in vain…

I’m pretty sure that my misunderstanding of some basis causes this post.. So...

Thanks for your help Professors friends composers and others!

Jb

Csound mailing list
Csound@listserv.heanet.ie
LISTSERV 16.5 - CSOUND List at LISTSERV.HEANET.IE
Send bugs reports to
       Issues · csound/csound · GitHub
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 addressees 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<mailto: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<mailto: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

Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here