Skip to content

Instantly share code, notes, and snippets.

@jens-a-e
Created May 14, 2023 05:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jens-a-e/e669db1b9c85079605f1f1e6de87db8f to your computer and use it in GitHub Desktop.
Save jens-a-e/e669db1b9c85079605f1f1e6de87db8f to your computer and use it in GitHub Desktop.
// A one liner to convert a decimal MIDI note pitch to human readable notation
const midiNote2Name = (i, offset=-2) => `${["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"][i%12]}${Math.floor(i / 12) + offset}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment