Csound Csound-dev Csound-tekno Search About

[Csnd] UDOs or Ambisonics

Date2023-11-08 14:20
FromPhilipp Neumann
Subject[Csnd] UDOs or Ambisonics
Hello everyone!

I’m still on my way through the ambisonics jungle in csound and i looked into the UDOs by Martin Neukom.

I have a question related to rendering a file.
How can i use for example the ambi3D_enc_dist1 or ambi_encode and render the encoded signals to a file? with beformenc i just sended the array to a fout opcode. But these UDOs doesn’t produce a direct output? Or is this related to the ZAK System?

All the best,
Philipp
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

Date2023-11-08 17:46
Fromjoachim heintz
SubjectRe: [Csnd] UDOs or Ambisonics
hi philipp -

yes i think it is because martin used the zak feature.  i never used it, 
but i think you can straightforward change it to direct audio output.

for instance, in the UDO "ambi2d_encode_3" (example 05B11 in 
https://flossmanual.csound.com/sound-modification/panning-and-spatialization#ambisonics2d), 
you can change

opcode  ambi2D_encode_3, 0, ak
asnd,kaz        xin
kaz = $M_PI*kaz/180
                 zawm            asnd,0
                 zawm            cos(kaz)*asnd,1         ;a11
                 zawm            sin(kaz)*asnd,2         ;a12
                 zawm            cos(2*kaz)*asnd,3       ;a21
                 zawm            sin(2*kaz)*asnd,4       ;a22
                 zawm            cos(3*kaz)*asnd,5       ;a31
                 zawm            sin(3*kaz)*asnd,6       ;a32
endop

to

opcode  ambi2D_encode_3, aaaaaaa, ak
asnd,kaz        xin
kaz = $M_PI*kaz/180
                 a1 =            asnd
                 a2 =            cos(kaz)*asnd
                 a3 =            sin(kaz)*asnd
                 a4 =            cos(2*kaz)*asnd
                 a5 =            sin(2*kaz)*asnd
                 a6 =            cos(3*kaz)*asnd
                 a7 =            sin(3*kaz)*asnd
endop

i hope it works; i leave the test to you ...

	joachim



On 08/11/2023 15:20, Philipp Neumann wrote:
> Hello everyone!
> 
> I’m still on my way through the ambisonics jungle in csound and i looked into the UDOs by Martin Neukom.
> 
> I have a question related to rendering a file.
> How can i use for example the ambi3D_enc_dist1 or ambi_encode and render the encoded signals to a file? with beformenc i just sended the array to a fout opcode. But these UDOs doesn’t produce a direct output? Or is this related to the ZAK System?
> 
> All the best,
> Philipp
> 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