magical-mixers
v1.1.0
Published
An open-source engine for communicating with digital mixers with nodejs.
Maintainers
Readme
Magical Mixers
An open-source engine for communicating with digital mixers in Node.js.
This library is the core communication layer behind Magical Mixing Console, a cross-platform application for remote control of digital mixers. It is designed to be reusable in other tools or custom workflows that need to interact with compatible digital audio consoles.
Built and maintained with ❤️ by Matías Barrios in Piriápolis, Uruguay 🇺🇾. Aguante la música ✨
Features
- 🧠 Provides a high-level abstraction layer over digital mixers, allowing applications to interact with them through a unified and simplified interface, regardless of specific model details.
- 🔌 Communication with digital mixers over LAN/WLAN.
- ⚡ Real-time bidirectional message handling.
- 🧱 Modular structure for easy extension and customization.
- 🧰 Used in production by Magical Mixing Console.
Supported Mixers
Currently supports:
- Behringer X Air series (XR12, XR16, XR18, X18).
- Midas M Air series (MR12, MR18).
Let's hope more models and brands will be supported in the future!
Development
Clone and install
git clone https://github.com/matiasbarrios/magical-mixers.git
cd magical-mixers
npm installSearching for devices
You can run LAN searches for devices with the following script in the examples folder:
node src/examples/search.jsIf you're having connection problems with your device, this script will help debug what's going on.
Virtual device
If you don't own a supported digital mixer, you can run a virtual one by executing the following script:
npm run x18By default it will listen on 127.0.0.1 on port 10024.
Has, get, set
The following code can be found in src/examples/busName.js. It shows how to connect to a device, get the main bus name, edit it, and get notifications every time it is edited.
Run it from the command line:
node src/examples/busName.js 127.0.0.1 10024// Requirements
import { searchNew, initialize } from '../core/index.js';
import { isValidIP, isValidPort } from '../core/helpers/values.js';
// Constants
const mainBusId = 27;
// Internal
const disconnect = async (device) => {
await device.dispose();
console.log('Disconnecting, bye bye!');
process.exit(0);
};
const readWriteBusName = async (device) => {
// Does the device have buses? It should!
device.features.bus.name.has(mainBusId, (has) => {
if (!has) {
console.error('Main bus not found');
setTimeout(() => disconnect(device), 1);
return;
}
// Get the main bus name
// Every time it's edited this will run
device.features.bus.name.get(mainBusId, (name) => {
console.log(`Main bus name: ${name}`);
});
// Edit it it two times, every time it should be printed
setTimeout(() => {
device.features.bus.name.set(mainBusId, 'The Great Main Bus');
}, 3000);
setTimeout(async () => {
device.features.bus.name.set(mainBusId, 'The Main Bus');
// Once finished, disconnect
await disconnect(device);
}, 6000);
});
};
const onDeviceFound = search => async (data) => {
const device = await search.getFound(data.ip, data.port);
await device.connect();
await search.stop();
console.log(`Device found on ${data.ip}:${data.port}`);
await readWriteBusName(device);
};
// Main
const main = async () => {
const ip = process.argv.length > 2 ? process.argv[2] : null;
const port = process.argv.length > 3 ? process.argv[3] : null;
if (!isValidIP(ip) || !isValidPort(port)) {
console.error('Invalid IP or port');
process.exit(1);
}
console.log(`Searching for ${ip}:${port}`);
initialize();
const search = searchNew();
await search.inIPPort(ip, port, onDeviceFound(search), async () => {
await search.stop();
console.error('Device not found');
process.exit(1);
});
};
// Run
main();If you want to develop the communication with a new device brand/model, you'll have to copy the structure of src/core/drivers/xair and implement the interaction for each feature. With the shown example, you can test the feature. Good luck!
Package installation
If you want to develop your own app that can handle the digital mixers supported, install the library:
npm install magical-mixersHello World
You'll also be able to connect to the device and access its features:
// Requirements
import { initialize, searchNew } from 'magical-mixers';
// Constants
const mainBusId = 27;
// Internal
const disconnect = async (device) => {
await device.dispose();
console.log('Disconnecting, bye bye!');
process.exit(0);
};
const readWriteBusName = async (device) => {
// Does the device have buses? It should!
device.features.bus.name.has(mainBusId, (has) => {
if (!has) {
console.error('Main bus not found');
setTimeout(() => disconnect(device), 1);
return;
}
// Get the main bus name
// Every time it's edited this will run
device.features.bus.name.get(mainBusId, (name) => {
console.log(`Main bus name: ${name}`);
});
// Edit it it two times, every time it should be printed
setTimeout(() => {
device.features.bus.name.set(mainBusId, 'The Great Main Bus');
}, 3000);
setTimeout(async () => {
device.features.bus.name.set(mainBusId, 'The Main Bus');
// Once finished, disconnect
await disconnect(device);
}, 6000);
});
};
const onDeviceFound = search => async (data) => {
const device = await search.getFound(data.ip, data.port);
await device.connect();
await search.stop();
console.log(`Device found on ${data.ip}:${data.port}`);
await readWriteBusName(device);
};
// Main
const main = async () => {
const ip = '127.0.0.1';
const port = 10024;
console.log(`Searching for ${ip}:${port}`);
initialize();
const search = searchNew();
await search.inIPPort(ip, port, onDeviceFound(search), async () => {
await search.stop();
console.error('Device not found');
process.exit(1);
});
};
// Run
main();API Reference
Coming soon – in the meantime, see the source code and join the Discord community.
Contributing
Contributions are welcome! If you find a bug or want to request a feature, please open an issue or pull request. Also feel free to use the discussion board or join our Discord server for help and collaboration.
License
Apache License 2.0 © 2025 Matías Barrios
Piriápolis, Uruguay 🇺🇾
📧 [email protected]
