New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Play white keys when touched anywhere in its area #345
Conversation
@abaresk is attempting to deploy a commit to the Ryohei Kameyama's projects Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@abaresk Very nice! It looks better than before. One small suggestion: you could simplify the code by adjusting the rendering logic to draw white keys first, then black keys. This change would allow you to remove the below code. signal/src/main/components/PianoRoll/PianoKeys.tsx Lines 60 to 67 in 521809f
It looks like below: for (let i = 0; i < numberOfKeys; i++) {
const isWhite = ...
if (isWhite) {
drawWhiteKey(...)
}
}
for (let i = 0; i < numberOfKeys; i++) {
const isBlack = ...
if (isBlack) {
drawBlackKey(...)
}
} |
I updated the rendering logic according to your suggestions. There still is some complexity as the white key height depends on its neighboring black keys. Let me know how this looks to you! |
Very clean code! Thanks. |
This highlights and accepts touch inputs from the entire area of a white key, including the tabs underneath black keys: