grame-cncm / faust

Functional programming language for signal processing and sound synthesis
http://faust.grame.fr
Other
2.46k stars 310 forks source link

Compile Faust to AssemblyScript? [Feature request] #674

Open Catsvilles opened 2 years ago

Catsvilles commented 2 years ago

Hi, I saw that Faust can compile to Rust, so I thought compiling to AssemblyScript also would be possible?There is already quite some work done in area of audio processing with AS, and AS is a perfect language to write audio plugins and applications for those who come from Javascript area, so I believe using them together with Faust would be just amazing :) I personally would love to use some Faust plugins inside of my AssemblyScript app.

sletz commented 2 years ago

Faust also compiles to WebAssembly. Is WebAssembly code usable in AS ?

Catsvilles commented 2 years ago

@sletz That was my first idea too but seems that unfortunately we cannot call WASM from AS at the moment.

sletz commented 2 years ago

Do you have any example of audio code or project written using AS ?

Catsvilles commented 2 years ago

@sletz Peter Salomonsen is the pioneer of writing AssemblyScript synth and doing audio processing with it. :) Check out his project: https://github.com/petersalomonsen/javascriptmusic Really amazing work :)

Also there is another project with a possibility of writing Assemblyscript VST plugins. Haven't tested it properly though

sletz commented 2 years ago

Great ! I guess we should invite @petersalomonsen in this discussion or continue it on the AS Discord channel ?

petersalomonsen commented 2 years ago

yep, here is one example of AssemblyScript for generating real-time rendered instruments. AssemblyScript for the synthesis on the right side, and on the left side the music sequence is written in Javascript. It's all compiled on the fly in the browser when you press the save button.

https://petersalomonsen.com/webassemblymusic/livecodev2/?gist=7868e46c3ba499612326efbf157b5f05

sletz commented 2 years ago

So do we continue the discussion on AS discord channel?