alisomay / libpd-rs

Safe rust abstractions over libpd.
Other
80 stars 4 forks source link

multi instance support #20

Open doing-fine-thanks opened 6 months ago

doing-fine-thanks commented 6 months ago

Hey! I was curious if there were any plans/timelines for multi instance support. I am working some Godot addons using this library (via gdext), but I am sort of stuck until multiple instances are supported. The global allocation means all patches play from all audio sources in a game scene at the same time (unless I am missing something).

Thank you so much in advanced/for all y'alls work!

alisomay commented 6 months ago

There were no plans currently but since a need has appeared, actually why not. It is just that probably I'll not dive in and implement it until a few months later on the other hand I'm always open to PRs.

I kind of burnt myself out with these projects

doing-fine-thanks commented 6 months ago

Hey! Super understand the burn out (hence me getting into game development after ~6 years doing big-data architecture work).

In terms of game audio: what you outlined is my understanding of it too (admittedly very new to game engines and rust programming).

My current usage of this library is passing a buffer stored on each audio object in a game scene to the global pd object, taking the buffer and handing them off a Generator playback in Godot and letting the audio server code manage the mix/spatialization of the various elements.

The issues I am running into are:

alisomay commented 6 months ago

I see, it seems that multi instance support seems a nice fit to widen your bottle neck. It shouldn't be very complicated to add that. I was planning to do it sometime anyway. I'll see what I can do and let you know here if there are any updates ✨ If there are other contributor candidates reading this issue, I'm open to PRs.

doing-fine-thanks commented 6 months ago

Thank you so much!

alisomay commented 6 months ago

I took a look at it this morning. I think it might take approximately ~3 days of work to

I'll try to look at these whenever I have enough time budget to allocate. I'll give updates.

alisomay commented 6 months ago

It is progressing with no blocks. I can not work on it very frequently but probably finish it sometime this month.

alisomay commented 5 months ago

Waiting for these two

danomatika commented 5 months ago

@doing-fine-thanks "Multi-instance" refers to entirely separate pure data environments. Think VST environments where audio plugins are running at different places and along different signal chains. It seems like what you are having issues with is working with multiple abstractions, aka instances of the same patch, within a single Pure Data environment. In this case, you can use the unique $0 id to differentiate between them and/or your own messaging structures ala send/recieve names. If you can make it work within a single desktop Pd, you don't need multiple Pd instances.

doing-fine-thanks commented 5 months ago

Hey, sorry for not chiming in for a bit. I do actually mean separate patches with different buffers.