Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/david-vandensteen/remote-midi
Send MIDI messages between different computers through a TCP connection with NodeJS.
https://github.com/david-vandensteen/remote-midi
javascript midi nodejs tcp
Last synced: about 2 months ago
JSON representation
Send MIDI messages between different computers through a TCP connection with NodeJS.
- Host: GitHub
- URL: https://github.com/david-vandensteen/remote-midi
- Owner: David-Vandensteen
- License: mit
- Created: 2022-12-10T11:27:51.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-23T16:06:31.000Z (over 1 year ago)
- Last Synced: 2023-08-06T23:08:00.368Z (over 1 year ago)
- Topics: javascript, midi, nodejs, tcp
- Language: JavaScript
- Homepage:
- Size: 204 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# remote-midi
Remote-MIDI is a library that allows you to send MIDI messages between different computers through a TCP connection.
It can be used in both unidirectional and bidirectional communication scenarios.## Unidirectional
In a unidirectional scenario, the slave computer sends MIDI messages to the master computer, which then forwards them to a MIDI out device connected to it.
The process is represented in the following diagram:+----------------+ +----------------+ +----------------+
| SLAVE COMPUTER |---->| MIDI MESSAGE |---->| TCP |
| | | | | |
+----------------+ +----------------+ +----------------+
|
|
v
+----------------+
| MASTER COMPUTER |
| |
+----------------+
|
|
v
+----------------+
| MIDI OUT DEVICE|
| |
+----------------+On the server/master side, you can use the rMidiServer function to start a server that listens for incoming MIDI messages on a specific IP and port, and forwards them to a specific MIDI out device:
```javascript
import { rMidiServer } from '#src/remote-midi';const server = rMidiServer({
host: '0.0.0.0', port: 7070, midiOutputDeviceName: 'vmidi-out',
});
server.start();
```On the client/slave side, you can use the rMidiClient function to connect to the server and send MIDI messages:
```javascript
import { rMidiClient } from '#src/remote-midi';const client = rMidiClient({ host: '192.168.0.1', port: 7070 });
client
.start()
.send('cc', {
controller: 30,
value: 32,
channel: 0,
});
```## Bidirectional
In a bidirectional scenario, not only can the slave computer send MIDI messages to the master computer, but the master computer can also send MIDI messages to the slave computer.
The process is represented in the following diagram:+----------------+ +----------------+ +----------------+
| SLAVE COMPUTER |---->| MIDI MESSAGE |---->| TCP |
| | | | | |
| rMidiClient | | | | |
| | | | | |
+----------------+ +----------------+ +----------------+
|
|
v
+----------------+
| MASTER COMPUTER |
| |
| rMidiServer |
| |
+----------------+
|
|
v
+----------------+
| MIDI OUT DEVICE|
| |
+----------------++----------------+
| MIDI IN DEVICE |
| |
+----------------+
|
|
v
+----------------+
| MASTER COMPUTER |
| |
+----------------+
|
|
v
+----------------+
| TCP |
| |
+----------------+
|
|
v
+----------------+
| SLAVE COMPUTER |
| |
| rMidiClient |
| |
+----------------+This is achieved by using the rMidiServer function on the master computer side to start a server that listens for incoming MIDI messages on a specific IP and port, and forwards them to a specific MIDI out device. The server also listens for MIDI messages from connected MIDI in device and sends them to the slave computer via the TCP protocol.
On the client/slave side, you can use the rMidiClient function to connect to the server and send MIDI messages.
The client also listens for incoming MIDI messages from the server and can handle them accordingly.Here is an example of how you can use the rMidiServer function on the master computer side:
```javascript
import { rMidiServer } from '#src/remote-midi';const server = rMidiServer({
host: '0.0.0.0', port: 7070, midiOutputDeviceName: 'vmidi-out', midiInputDeviceName: 'vmidi-in',
});
server.start();
```and here is an example of how you can use the rMidiClient function on the slave computer side:
```javascript
import { rMidiClient } from '#src/remote-midi';const { log } = console;
const client = rMidiClient({ host: '192.168.0.1', port: 7070 });
client
.start()
.on('data', () => log)
.send('cc', {
controller: 30,
value: 32,
channel: 0,
});
```