Skip to content

Instantly share code, notes, and snippets.

@ddreier
Created April 25, 2016 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddreier/ecd0180546c02836a98cc1c41039fd1e to your computer and use it in GitHub Desktop.
Save ddreier/ecd0180546c02836a98cc1c41039fd1e to your computer and use it in GitHub Desktop.
var rtpmidi = require('rtpmidi');
var session = rtpmidi.manager.createSession({
localName: 'My RTPMidi Session',
bonjourName: 'Node Midi Client',
port: 5006
});
// Create a clock
var mtc = new rtpmidi.MTC();
mtc.setSource(session);
mtc.on('change', function() {
// Log the time code HH:MM:SS:FF
console.log('Position: ' + mtc.songPosition + ' Time: ' + mtc.getSMTPEString());
});
// Connect to a remote session
session.connect({ address: '192.168.1.5', port: 5004 });
session.on('message', function(deltaTime, message) {
console.log('Received a message', message);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment