Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Often statistics are used as a drunken man uses lampposts -- for support rather than illumination.


devel / comp.lang.smalltalk.dolphin / How to pass array of arrays to an external library?

SubjectAuthor
o How to pass array of arrays to an external library?Joe Betz

1
How to pass array of arrays to an external library?

<c73ea80d-dfe7-4e3d-a45c-56586bbad462n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=239&group=comp.lang.smalltalk.dolphin#239

  copy link   Newsgroups: comp.lang.smalltalk.dolphin
X-Received: by 2002:a05:622a:15c8:b0:39c:ea8a:82e3 with SMTP id d8-20020a05622a15c800b0039cea8a82e3mr14588538qty.146.1666331408324;
Thu, 20 Oct 2022 22:50:08 -0700 (PDT)
X-Received: by 2002:a25:3cc4:0:b0:6af:c67e:909e with SMTP id
j187-20020a253cc4000000b006afc67e909emr14612537yba.266.1666331407885; Thu, 20
Oct 2022 22:50:07 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.smalltalk.dolphin
Date: Thu, 20 Oct 2022 22:50:07 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2001:861:51c3:bae0:8842:ea09:98ad:5b74;
posting-account=P1X3VgoAAADgSty0b3mKYJl_KPjmW842
NNTP-Posting-Host: 2001:861:51c3:bae0:8842:ea09:98ad:5b74
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c73ea80d-dfe7-4e3d-a45c-56586bbad462n@googlegroups.com>
Subject: How to pass array of arrays to an external library?
From: joebetz91@gmail.com (Joe Betz)
Injection-Date: Fri, 21 Oct 2022 05:50:08 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2025
 by: Joe Betz - Fri, 21 Oct 2022 05:50 UTC

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);
yourself.

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: https://www.fluidsynth.org/api/group__audio__rendering.html#gaf41e26b153a095dbc4248e9df4f3ad46

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor