I would absolutely love to ditch my electron code and simply drop a folder into a Ableset directory called: plugins. There is only so much that could be developed with client js without being able to send commands via ableton-js.
This morning during our singing event, I was actually writing code in my head of how this could be possible. There is zero pressure on this idea but I would sincerely appreciate the consideration:
First have the "Enable Plugins"
option which would force the user to see a window warning them of the security risks of using plugins from unknown authors.
Have a menu link: "Show Plugins"
, which would direct them the plugins folder.
A plugin folder could be structured like this:
plugins
my-plugin
client
...resources
index.js //react
server
index.js //express
Ableset could simply import client/index.js
into itās loading routine. For my case, I would be using index.js to create a React ārootā div element named (for this example) <div id="my-plugin" />
and adding to the body tag. Then calling my React main entry file.
The server/index.js code could be a class with a default export. (Showing Typescript for clarity)
import { Ableton } from "ableton-js";
import express from "express";
export default class MyPluginServer {
protected pluginAbleton : Ableton;
protected port : number;
constructor( pluginAbleton : Ableton, uniqueServerPort: number) {
this.pluginAbleton = pluginAbleton;
this.port = uniqueServerPort;
const server = express();
//...
server.listen(uniqueServerPort, () => {
console.log(`MyPluginServer listening on ${uniqueServerPort}`);
});
}
}
Ableset could then load all of the compiled plugins inside of the āpluginsā folder with a script similar to this:
//...
//A separate Ableton class for all plugins to share
const pluginAbleton = new Ableton();
pluginFolders.forEach( async (folder) => {
try {
const plugin = await import(`${folder}/server/index.js`);
//find a unique port for the plugin server
const pluginPort = await findPort();
const pluginName = path.basename(folder);
const pluginObj = new plugin( pluginAbleton, pluginPort );
runningPlugins.push( { name: pluginName, port: pluginPort } );
} catch (error) {
console.error("Plugin error: ", error);
}
});
From the above example, Ableset could then pass the plugin port information using an endpoint like: /plugins
which would return:
{
"plugins" : [
{
"name": "my-plugin",
"port": 5000
}
]
}
This is certainly barebones code but Iād love to hear your thoughts about the possibilities of Ableset plugins. Itās been mentioned by many users that Ableset is quickly becoming much more valuable than just a setlist manager. I could see an simple plugin being developed that would give users a mixer view to adjust volumes and mute instrument stems. With the addition of plugin functionality, Ableset could truly explode into a full ecosystem. Thanks for your time! Youāre a coding superhero! By the way, where is that link to make donations? You deserve much more money than youāre getting.