Julusian / node-midi

A node.js wrapper for RtMidi providing MIDI I/O
https://www.npmjs.com/package/@julusian/midi
MIT License
22 stars 7 forks source link

feat: Add setBufferSize method to MIDI Input #18

Closed lozjackson closed 3 months ago

lozjackson commented 3 months ago

As mentioned in #15, we (Focusrite/Novation) would like to use this library, but we have a specific requirement to be able to send large MIDI messages, much bigger than the default 2048 buffer size allows. We're currently using a our own fork of the original node-midi library, but would like to use this fork instead since it works with more modern versions of Node.

This PR adds a setBufferSize(size: number, count?: number): void method to the MIDI Input. This allow the buffer size to be changed, for example:

input.setBufferSize(4096) // set the buffer size to 4k

Optionally set the buffer count too

input.setBufferSize(2048, 8) // set the buffer count to 8

Fixes #15