eliot-akira / audiom

Modular music-making app
3 stars 0 forks source link

Is this project working? #1

Closed Catsvilles closed 4 years ago

Catsvilles commented 4 years ago

Hi, I thought this is direct fork of Node-Audio but after some digging through I realized it's kinda not? The question is, could I install this on my Ubuntu 18 and try do some music with it? :) Really interested into connecting node.js and VST audio plugins together, thanks :)

eliot-akira commented 4 years ago

Hi @Catsvilles , you're right, this was an experiment to see if I could keep extending node-audio. The plan was to have the UI in Electron, with the backend communicating with JUCE.

As you can see, the project didn't make much progress (yet!). It should run, though, so maybe you can make something from it. :)

More recently, I've been taking the opposite approach, to try to embed a lightweight JavaScript engine (QuickJS) or Lua in a JUCE application. For audio I think that's a better way - but it's quite a learning curve.

Another possible angle is, many DAWs have scripting capability, like Python in Ableton, JavaScript in Max (I think), Lua in Ardour.

Catsvilles commented 4 years ago

@eliot-akira Thanks for getting back to me! And thanks for the links, I think the problem with those scripting languages in existing DAWs is that they seem to be more DSP oriented, what I'm trying to achieve is the way to compose music using only code, VST plugins and interact with GUI as less as possible. But maybe I missed something and actually I could control the whole DAW just using their build-in scripting langs?

Embedding scripting languages inside of the plugin host actually seems to be very cool idea! I don't have experience with JUCE, but I assume it's capable of hosting different audio plugins, like VST2/VST3? Would be cool to compose music with code, listen to it, and render the result in offline mode. I guess there is no way around it and I will have to learn some C++ as knowing scripting langs is clearly not enough for these things :)

eliot-akira commented 4 years ago

interact with GUI as less as possible

I see what you mean, sounds like a nice approach. I think we have similar interests - I've been searching for a straight-forward way to programmatically compose/perform with code, ideally without DAWs or the constraints of GUIs.

There are minimal hosts for audio plugins, for example Hosting AU (Mac only) is less than a megabyte in size. (They're often based on JUCE, which is cross-platform, supports most types of audio plugins, has included libraries for GUI and other utilities. It also provides a fairly friendly entry into C++).

From the Node.js side, the node-midi library is a pretty "close to the metal" interface for exchanging MIDI messages with an audio plugin host.

You could also look into the Open Sound Control, a more general-purpose protocol with a number of Node.js implementations.

One thing I'm learning, though, is that there's not much out there in terms of precise and accurate scheduling/timer for Node.js. I also suspect that some aspects of Node.js (single threaded, garbage collected) might not be suitable for real-time performance. Like you, I'm drifting towards learning C++ to achieve what I imagine, but not so motivated by the huge and unsafe interface.

Pure Data is a visual graph-oriented programming environment with a long history - I've just started learning about it.

Sonic Pi is an interesting open-source project, it has a domain-specific language for live-coding music.

Catsvilles commented 4 years ago

Okay, I'll just throw additionally something I know, SuperCollider got this package not so long ago - basically allowing all kind of VSTs inside of SC, I guess this makes it the most mature, easy to start, coolest thing at the moment :)

I tried doing stuff with Midi and OSC, sending signals directly to plugin, but in my case I could not wrap my head around finding a way to "offline render" audio from the plugin to file. In the end it all comes to having a Host which can do all these thing for you, I guess. :)

eliot-akira commented 4 years ago

Thanks for sharing that. SuperCollider as an audio plugin host sounds interesting.

I'd like to try building it on Raspberry Pi. That's a direction I've been exploring, to have a portable box running Linux that does real-time audio and MIDI processing/generation.

I also wanted to mention Faust, which is its own language that does cross-platform audio.

For rendering audio in Node.js, this library naudiodon looks promising. Perhaps you could capture the output from a host that way.

Just for fun, I created a repo for another on-going experiment I have, Monju. The idea is a minimal headless wrapper around JUCE, for building GUIs and process audio/MIDI using Lua.

Ideally though, I want the same thing you're imagining, which is a Node.js native addon to host audio plugins, and have full control of the inputs and outputs. Something like JUCE.js. That's beyond my ability and knowledge (yet!) but I think it would open up fun possibilities.

Catsvilles commented 4 years ago

Additionally to SC allowing to code music with VSTs, there is also a new thing now - https://github.com/DBraun/DawDreamer. Python DAW without GUI and VST support. Well, I guess node.js version is realistically possible too, who knows, maybe someday. :)