[Csnd] Problems with VBAP

Hello everybody,
I'm on Csound 6.18 and need to stay on this version because of a project involving a Bela board.

I have a few problems with VBAP and a 3-dimensional system. I initialize the VBAP system with 'vbaplsinit' as a 3D system with 16 speakers. Then I use the 'vbap' opcode to spatialize a signal, but VBAP always creates audio arrays of the wrong size.
In this example i get an array of the size 13 but it should be of size 16.

Am I doing something wrong here?

This is a minimal example:

<CsoundSynthesizer>
<CsOptions>
-d -o dac
</CsOptions>
<CsInstruments>

sr = 48000
ksmps = 16
nchnls = 16
0dbfs = 1.0

vbaplsinit 3, 16, 0,0,1,0,2,0,3,0, 1,0,1,1,1,2,1,3, 2,0,2,1,2,2,2,3, 3,0,3,1,3,2,3,3

instr 1
  aSig noise 0.5, 0.5
  aSigs[] vbap aSig, 0, 0
  print lenarray(aSigs)
endin

</CsInstruments>
<CsScore>
i1 0 1
</CsScore>
</CsoundSynthesizer>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        GitHub · Where software is built
Discussions of bugs and features can be posted here

suprisingly, the multiple output version works. since i need to do some array arithmetics (array addition for signal summing), this is very inconvenient. is there a workaround for this?

I had a look at the code, on Csound 7 with your original code I get 22 outputs. The code does not seem to
match the manual well. It appears that in 3 dimensions, 16 directions give more outputs. I don’t really
know the code well to understand where the problem is (documentation or code).

I can’t say much about 6.18 since we are not developing it anymore.