Musical keyboard component written in React.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

11 rindas
387 B

  1. import getKeyXOffset from './getKeyXOffset'
  2. import isNaturalKey from './isNaturalKey'
  3. // expect firstKey and lastKey within the same octave
  4. export default (firstKey: number, lastKey: number) => (
  5. // see if there are missing higher notes
  6. getKeyXOffset(lastKey) + (isNaturalKey(lastKey) ? 1 / 7 : 1 / 7 * 18/36)
  7. // see if there are missing lower notes
  8. - getKeyXOffset(firstKey)
  9. )