How to use the easymidi.getOutputs function in easymidi

To help you get started, we’ve selected a few easymidi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Pomax / midi-with-node / server.js View on Github external
var path = require('path'),
    express = require('express'),
    app = express(),
    socketio = require('socket.io'),
    easymidi  = require('easymidi'),
    deviceName = 'NodeJS MIDI out',
    verbose = process.argv.indexOf("--verbose")>-1;

if (process.platform === "win32") {
  // find the loopmidi 'NodeJS MIDI out' virtual port
  var outputs = easymidi.getOutputs();
  outputs.some(name => {
    console.log(name, deviceName);
    if (name.toLowerCase().indexOf(deviceName.toLowerCase()) > -1) {
      out = new easymidi.Output(name);
      return true;
    }
    return false;
  });
} else {
  out = new easymidi.Output(deviceName, true);
}

app.use(express.static(path.join(__dirname,'public')));

app.get('/socket.io.js', function(req, res) {
  res.sendFile('socket.io.js', {
github samhiatt / node-ableton-push2 / scripts / show_ports.js View on Github external
var easymidi = require('easymidi');

console.log('Input ports: \n\t'+easymidi.getInputs().join('\n\t'));
console.log('Output ports: \n\t'+easymidi.getOutputs().join('\n\t'));

process.exit(0);

easymidi

Simple event-based MIDI messaging

MIT
Latest version published 1 year ago

Package Health Score

52 / 100
Full package analysis