How to use the midi.js.chordOn function in midi

To help you get started, we’ve selected a few midi 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 djyde / Pciano / src / keyBinding.ts View on Github external
function playNote(note: any, velocity?: number = VELOCITY): void {
  console.log(note)
  if (Array.isArray(note)) {
    // play chord
    app.currentChord = note
    MIDI.chordOn(CHANNEL, note, velocity, DELAY)
    if (AUTO_CLICK_BASE) {
      MIDI.noteOn(CHANNEL, note[0] - 2 * 12, LEFT_HAND_VELOCITY, DELAY)
      app.currentNote = note[0] - 2 * 12
    }
  } else {
    app.currentNote = note
    MIDI.noteOn(CHANNEL, note, velocity, DELAY)
  }
}