faust icon indicating copy to clipboard operation
faust copied to clipboard

Add soundfile support to webaudio architecture / Faust online editor

Open dxinteractive opened this issue 4 years ago • 5 comments

Hi, I came across this thread which mentions that soundfile cannot be used in the Faust online editor, which appears to still be true: https://sourceforge.net/p/faudiostream/mailman/faudiostream-users/thread/A8142024-6C77-4AE7-B1B1-AFD74E48217F%40grame.fr/

What would it take to add soundfile support, so that files could be fetched upon execution using fetch() for example? Is that even a good idea?

dxinteractive avatar Jul 01 '20 00:07 dxinteractive

Using fetch() is part of the solution. I did some experiments some months ago, basically doing more on C++ side, like having then entire C++ sound management code be compiled with EMCC and exposed on JS side. This is not mature enough to be released, but I may work on that again soon.

sletz avatar Jul 01 '20 07:07 sletz

Ok great. I'm just playing with things at this stage but I'm interested in giving this a go at some point too.

I haven't closely looked at the code in the webaudio architecture so on a technical level this may not even make sense, but an API I'd like could be: perhaps the node created by new Faustosc() could accept an overwritten node.addSoundfile = (label, path) => AudioBuffer method. That said, I have no idea how that AudioBuffer then makes its way into something that the C++ addSoundfile can use, and or how the timing would all work.

I'll try using the webaudio architecture and see how it looks.

dxinteractive avatar Jul 08 '20 02:07 dxinteractive

Anything new regarding this? It would be really awesome to be able to use soundfile with wasm as well, as wasm seems more and more portable with the availability of multi platform wasm vms.

xaviergodart avatar Jan 05 '24 10:01 xaviergodart

Nothing new, by on the TODO list for sure.

BTW I've announced your Talk: Generative music with Faust @ playground #1 meetup on the Faust Discord channel.

sletz avatar Jan 05 '24 11:01 sletz

Nothing new, by on the TODO list for sure.

Great to hear, thanks!

BTW I've announced your Talk: Generative music with Faust @ playground #1 meetup on the Faust Discord channel.

Thank you for that, I didn't know. I've been interested in making generative music patches with Faust , and it's working pretty well for that.

xaviergodart avatar Jan 05 '24 11:01 xaviergodart