Pure React chord name output from virtual piano keys. With a focus on ui ux display across multiple devices, Specifically mobile
-
Features:
-
Piano GUI:
-
Do active notes
-
markup css
-
12 Note input
-
[] Remove cursor from key its annoying
-
Black note
-
White note
-
friendly note name in class not C#
-
Piano Component Controls:
- Note click handler
- key down long press state (useEffect ?)
- key up
- Max Keys
- Key layout x2 (octaves)
- Fix key press logic on and off
- Reset feature
- Error Boundries
- interval name
- Note click handler
-
ChordName Components
- Jest Test and config for all chord types
- Handle no chord in jsx
-
UX
- Longpress to hold down note / touch
- Repeat play
- Maby do this one level up ?
-
UI
- Create a card component
- keyboard for all screens
- Redo wireframe grid in bootstrap
- Currently too much padding
- [] Rotate keyboard
- [] Name Keys overlay
- Add responsive keyboard
-
Context:
- Add note to noteInput
- Remove note from noteInput
- Restructure notes data to include octave
- Could be a threat as it will require a lot of refactoring
- Sort notes by pitch
- Object mutation for notesReducer
-
Harmony HOC:
- Harmony
-
Simple Chords
-
Output root
-
Major min 7th dims etc
-
Inversions
- any simple chords can be inverted
- library js theory plugin
- Decide on whether to keep 0 - 7 Tone logic or Stacked Interval logic
- normlize naming convention
-
Advanced chords
-
Look for alts to derive note id the "flat" Eb prblem.
-
~~ [] Change this to functional component ?? ~~
-
Needs extra octave
-
simplify switch getChord? make recursive
-
Do stacked intervals
-
Recheck no chordname found output
-
Add inversion logic
- Logic on when to apply inversion to chord name
- Hide undefined output
- Dont show first inversion
- Fix inversions order/degree output
- Run Jest test cases
- Where to handle inversion ?
- Potentially now we will have multiple chord names
- up to now we dont have a way to derive a chord from a scale
-
Compromise either reducer complexity or getChord complexity
-
Pass notes to context like this "A4" the current data structure is too complex [x] This is a nice output for info
F7 7th Dominant 7th, Major Minor 7th F, A, C, D♯ 1, 3, 5, ♭7 View- Formula using diatonic scale 1 3 5
- Detect scale
- Return notes of scale
- Test cases
majorminoraugmenteddiminished- BUG: 11th 13th chords
- [x]: Fix Playback
- Sort Notes
- []
- 8 types of 7th
- ([x]7,
maj7, m7, m(maj7),[x]dim7, [x] 7b5, [x]7#5, [x]m7b5)
- ([x]7,
ninth (major/minor)eleventh (major/minor)13th (major/minor)sixth (major/minor)sus2- Over 2 octave test
-[x] Write Amin chord for two octave test
- Logic for counting up to notes on next octave (+12)
- sus4
- 2
- Write test case for an inversion
- Add logic accordingly
- invert the input 2 times run getChord
- Check if a chord has been found or not
- Output inversion with the lowest degree
- Add logic accordingly
- [] Format these notes
- [] Rename react chord finder to something different
-
- Harmony
-
when or if you need to check length of input etc do it here in constuctor params notesInput
-
Reproduce audio:
- Play sound
-
How to reproduce in browser
-
How to reproduce in react
- Hello world player with howler and require
const Sounds = new Howl({ src: ["/sound.mp3"]})
- Hello world player with howler and require
-
Install Howler
-
look at integration
-
Setup core tested integration with note
-
Integarate fully
-
Optimization!
-
BUG where not actually playing the ocrt
-
Where to store sound files ? Public ¿?
-
Play two ocaves
- could be public but may cause performance issues go with src
-
Preload
- In Constants Unlikely a requirement using react wrapper
-
[ ]HACK: stop slicing (0,1)
-
- Play sound
-
ALLBUGS:
-
Configure esbuild to use new jsx transformation: Missing Dependancy react plugin
-
8 Key press crashes
-
Simplify array handling from constants
-
Fix piano padding layout
-
Decide on Component Structure & naming
-
Install Bootstrap
-
Install classnames
-
UI Color (make this more highlighted on black key)
-
Fix padding default issue @normalize using import and priority swith
-
Chord name needs to run every time a note is added or removed
-
Keyup doesnt retrigger chord name
-
ol, ul { /* padding-left: 2rem; */}layout issue -
Migrate to React Vite
- Investigate react-app to vite
-
Setup proper Tests for chord names
-
[] Fix redundant code in css
.black:active { -
Output no chord found
-
[] Jest not running
-
Deployment
- Build for prod
-
Config:
- Re do config and reinstall
Component Tree:
App.js
-> Instrument
-> Piano
-> Keys
onClick handlers
state setNotes
-> Key
-
Can getChord imporved ?
- Recursion
-
Where to handle chord name ? In context ? or directly in component
- Directly in component to levarage state updates
-
How we can we optimize events and state updates
- The sort on notes could cause issues when coming to do inversions
-
How to handle inversion ?
-
Env variables ?
-
Classes = dna
-
Utilize tonal.js ?
-
Treats:
- When adding an extra octave will need to add a new note object in context
- Smells like useEffect and useRef could be levaraged to get around this setState issue
interface HarmonyProps {?
A project to better understand audio player integration and its implementation in react
- Install vite
- Soundfont player install
- Install necessary files
- Maintain notes
- Hello world test
- Full compnent test
- Create repo
- Analysis
-
How is sound triggered specifically
-
How does m.vargas handle his audio
-
What are resources materials like for topp 5 audio js plugins
- Howl
- Free
- has dedicated wrapper ()[https://github.com/ManuelVargas1251/Chord-Finder/blob/master/src/js/sound.js]
- More resources: https://khoanguyen.me/react-howler/
- https://github.com/goldfire/howler.js#documentation -Web Audio API and falls back to HTML5 Audio
- tone.js
- Seen examples of this looks viabkle
- Free
- Howl
-
Try Soundfont
- has adsr
- library of sounds
-
Investigate Performance
-
Weakness:
-
tricky to integrate integration is weak
-
Oportunites: If this has lots of instruments it could be usefull indeed
-
[] A diagram might help
- [] Events actions
- [] Context
export default window.AudioContext || window.webkitAudioContext;
-
Treats:
- AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page
-
How to map the laptop keys to piano notes. Map the audio with key press. How to render the piano keyboard in react.
Requirements:
- Chord name to key output
- Scale display
- [] chord progression component
- Changeable active color
- Optimization
- [] Handle inversion
- [] Docs / Diagram
- Typescript ?