Skip to content

Commit d9b6c15

Browse files
committed
📄🔉 Updated README for new audio features
1 parent 8de82dc commit d9b6c15

File tree

3 files changed

+22
-25
lines changed

3 files changed

+22
-25
lines changed

README.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
11
# The Virtual Keyboard
22

3-
A virtual piano keyboard app, written in Typescript and React. Suitable for teaching and learning!!
3+
A virtual piano keyboard app that runs in the browser, written using Typescript and React. Suitable for teaching and learning!!
4+
5+
![Demo image of virtual keyboard](./demo.png)
46

57
### Features
68
- Shows notes on the grand staff as you play them on the keyboard.
79
- Responds to keyboard and mouse input
8-
- Responds to MIDI input in Chrome and Edge browsers
9-
- Many settings to customize the functionality and display
10-
- Show/hide piano, staff, note names
10+
- Responds to MIDI keyboard input in Chrome and Edge browsers, using the Web MIDI API
11+
- Audio output (piano and synth sounds) via Tone.js
12+
- Many settings to customize the functionality and display:
13+
- Show/hide piano, staff, note names, keyboard shortcuts
1114
- Change the piano range
1215
- Make the notes sticky/sustain
1316
- Re-size the keyboard for small and big screens.
1417

15-
![Demo image of virtual keyboard](./demo.png)
16-
17-
### Technologies used
18-
- To display the music staff: [abcjs library](https://paulrosen.github.io/abcjs/)
19-
- To connect to MIDI devices: [Web MIDI API](https://developer.mozilla.org/en-US/docs/Web/API/Web_MIDI_API) and [JZZ](https://github.com/jazz-soft/JZZ) library
20-
- For React magic: uses custom hooks and useReducer for state logic (see `src/state` folder)
21-
- For CSS magic: uses Sass, CSS variables, calc(), etc. (see `src/styles` folder)
18+
### Libraries and features used
19+
- To display the music staff: the amazing [abcjs library](https://paulrosen.github.io/abcjs/) by Paul Rosen
20+
- To connect to MIDI devices: the [JZZ](https://github.com/jazz-soft/JZZ) library, which is a wrapper over the [Web MIDI API](https://developer.mozilla.org/en-US/docs/Web/API/Web_MIDI_API)
21+
- [Tone.js](https://tonejs.github.io/) for playing audio via the Web Audio API
22+
- Piano samples from the ["Little Lizard" library](https://linuxmusicians.com/viewtopic.php?t=12046)
23+
- React bells and whistles: uses custom hooks and useReducer for state logic (see `src/state` folder)
24+
- CSS bells andwhistles: uses Sass, CSS variables, calc(), etc. (see `src/styles` folder)
2225
- Settings are saved using browser's Local Storage
2326

2427
### In development
25-
- Touch support and audio output!
26-
27-
28-
28+
- Touch support
29+
- Offline mode (using service workers)
2930

30-
## Acknowledgements
31-
- Paul Rosen's amazing [abcjs library](https://paulrosen.github.io/abcjs/) for the music staff display
32-
- The [JZZ library](https://jazz-soft.net/doc/JZZ/jzz.html) for connecting to MIDI devices
33-
- The React team and [Create React App](https://github.com/facebook/create-react-app).
31+
## Inspirations
3432
- [This video](https://www.youtube.com/watch?v=kMf1XWVY2cA) from [Suboptimal Engineer](https://github.com/SuboptimalEng) for the initial setup, code, and inspiration
33+
- Examples of cool little music apps from [Chrome Music Lab](https://musiclab.chromeexperiments.com/)
3534

3635
## Available Scripts
3736

src/components/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import { Reducer, useReducer, useRef, useState } from 'react';
22

3-
import useKeyboardSettings from '../state/useKeyboardSettings';
3+
import { useKeyboardSettings } from '../state/useKeyboardSettings';
44
import { PianoKeysAction, pianoKeysReducer } from '../state/PianoKeysReducer';
55
import { useMouseListeners } from '../listeners/MouseListeners';
66
import { useKeyboardListeners } from '../listeners/KeyboardListeners';
77
import { useMIDIListeners } from '../listeners/MIDIListeners';
8+
import { usePlayer } from '../audio/usePlayer';
89

910
import Sidebar from './sidebar/Sidebar';
1011
import Piano from './piano/Piano';
1112
import Staff from './staff/Staff';
1213
import '../styles/main.scss';
1314

1415
import githubLogo from "../res/images/github-logo-default.png"
15-
import { usePlayer } from '../audio/usePlayer';
1616

1717
function App() {
1818

src/state/useKeyboardSettings.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ const INITIAL_SETTINGS: KeyboardSettings =
2727
};
2828

2929

30-
const useKeyboardSettings = () => {
30+
export const useKeyboardSettings = () => {
3131
const { settings, updateSetting } = useLocalStorage("kbd-settings", INITIAL_SETTINGS);
3232

3333
return { settings, updateSetting }
34-
}
35-
36-
export default useKeyboardSettings
34+
}

0 commit comments

Comments
 (0)