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 MIDI constants #26

Closed MarquisdeGeek closed 1 month ago

MarquisdeGeek commented 2 months ago

Using numbers like 144 for note on, or 38 to switch to a bass guitar, is a little opaque for my tastes so I've added all the names from the General MIDI spec to self-document my generative music.

Julusian commented 2 months ago

I'm open to merging this, but I think the exports of the values need better names.

Perhaps this could exported from midi.js as:

Constants: {
  Instruments,
  Drums,
  Notes,
  Messages,
}
MarquisdeGeek commented 2 months ago

The instrument and drum lists are only valid for GM (General MIDI) instruments, so would need a designation. Would suggest GMDrums, instead of GeneralMIDIDrums to avoid making the names too long?

Julusian commented 2 months ago

I feel like 'GM' doesn't convey enough meaning to explain anything. Perhaps this would be better added as a comment on the export/documentation, that should be visible to users when looking to use the values

MarquisdeGeek commented 1 month ago

Bump for the above changes, as suggested.