Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.

How to pass array of arrays to an external library?

Skip to first unread message

Joe Betz

Oct 21, 2022, 1:50:08 AM10/21/22
Specifically, I need to pass an array of arrays of floats. It's a buffer to be populated by an external library with audio data.

I've tried:

(PointerArray length: 2 elementClass: FLOATArray)
at: 1 put: (FLOATArray new: 512);
at: 2 put: (FLOATArray new: 512);

But this errors with: "FLOATArray class should not implement #fromAddress:". The external method does return, however, but it seems Dolphin has issues recovering the float arrays from the result.

The spec for the C function is:

int fluid_synth_process (
fluid_synth_t * synth,
int len,
int nfx,
float * fx[],
int nout,
float * out[]

With the last argument being the tricky bit. I've tried represented it with both float* and float** in the Smalltalk stdcall specification, but neither worked.

More documentation on the C function:
0 new messages