lib/midi.js
function (chords, settings) {
  var chordEvents = makeChordEvents(chords, settings);

  // Set all channels
  var setPatches = _.reduce(_.range(0xf), function (buffer, channel) {
    return Buffer.concat([buffer, makePatchEvent(channel, settings.chordPatch)]);
  }, new Buffer(0));

  var length = setPatches.length + chordEvents.length + trackFooter.length;

  return Buffer.concat([trackHeader, padNumber(length, 4), setPatches, chordEvents, trackFooter]);
}
function (chords, settings) {
  var chordEvents = makeChordEvents(chords, settings);

  // Set all channels
  var setPatches = _.reduce(_.range(0xf), function (buffer, channel) {
    return Buffer.concat([buffer, makePatchEvent(channel, settings.chordPatch)]);
  }, new Buffer(0));

  var length = setPatches.length + chordEvents.length + trackFooter.length;

  return Buffer.concat([trackHeader, padNumber(length, 4), setPatches, chordEvents, trackFooter]);
}
function ( chords , settings ) { var chordEvents = makeChordEvents ( chords , settings ) ; // Set all channels var setPatches = _ . reduce ( _ . range ( 0xf ) , function ( buffer , channel ) { return Buffer . concat ( [ buffer , makePatchEvent ( channel , settings . chordPatch ) ] ) ; } , new Buffer ( 0 ) ) ; var length = setPatches . length + chordEvents . length + trackFooter . length ; return Buffer . concat ( [ trackHeader , padNumber ( length , 4 ) , setPatches , chordEvents , trackFooter ] ) ; }
Return a buffer with a chord track
Return a buffer with a chord track