Simple monitor for displaying MIDI status for digital pianos.
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

16 righe
397 B

  1. import getKeyOctave from './getKeyOctave'
  2. import keyNames from './keyNames.json'
  3. interface GetKeyName {
  4. (key: number): string,
  5. }
  6. const getKeyName: GetKeyName = (key) => {
  7. const octave = getKeyOctave(key)
  8. const pitch = (Math.floor(key) % 12) as keyof typeof keyNames
  9. const keyName: string = keyNames[pitch] as unknown as string
  10. return `${keyName}${octave}`
  11. }
  12. export default getKeyName