lib/midi.js
function (chords, settings) {
  var events = _.reduce(chords, function (arr, obj) {
    var time = noteLength(obj.duration, settings);
    var chord = obj.chord.inOctave(settings.chordOctave).chord;

    arr.push(makeChordEvent(0, true, 1, chord, settings.chordVelocity)); // On
    arr.push(makeChordEvent(time, false, 1, chord, settings.chordVelocity)); // Off

    return arr;
  }, []);

  return Buffer.concat(events);
}
function (chords, settings) {
  var events = _.reduce(chords, function (arr, obj) {
    var time = noteLength(obj.duration, settings);
    var chord = obj.chord.inOctave(settings.chordOctave).chord;

    arr.push(makeChordEvent(0, true, 1, chord, settings.chordVelocity)); // On
    arr.push(makeChordEvent(time, false, 1, chord, settings.chordVelocity)); // Off

    return arr;
  }, []);

  return Buffer.concat(events);
}
function ( chords , settings ) { var events = _ . reduce ( chords , function ( arr , obj ) { var time = noteLength ( obj . duration , settings ) ; var chord = obj . chord . inOctave ( settings . chordOctave ) . chord ; arr . push ( makeChordEvent ( 0 , true , 1 , chord , settings . chordVelocity ) ) ; // On arr . push ( makeChordEvent ( time , false , 1 , chord , settings . chordVelocity ) ) ; // Off return arr ; } , [ ] ) ; return Buffer . concat ( events ) ; }
Given chord data, return a buffer containing note events
Given chord data return a buffer containing note events