-
Notifications
You must be signed in to change notification settings - Fork 937
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
music keyboard fix #4296
music keyboard fix #4296
Conversation
@walterbender @pikurasa This should solve the problem. Following changes I did :->
const durationInSeconds = selectedNotes[counter].duration.map(
(beatDuration) => (beatDuration * 60 * 4) / this.bpm
); And this solves the issue.
Here is a demo of musickeyboard. bpm.mp4 |
When you define BPM, you need to assign a note value to a beat. By default, we assign a quarter note. |
Pardo me sir, I am assuming you are talking about defining BPM in music blocks project. If so, then am I doing right here ? Duration of notes is same when note values are different or same in action block and music keyboaard. Is it an issue? |
I think you are doing it correctly. But try experimenting with, say, half notes. 90, 1/2 would be 90 half notes per minute -- twice as fast as 90 1/4 notes. |
@walterbender Yes sir it works. On changing the beat value to 1/2 it is faster. noteVal.mp4 |
I did some testing, and it is an improvement. Please let me do some more testing. In some of my testing, I'm not getting the expected results. I suspect that it has to do with changing BPM specifically, but I'm not sure yet. As an aside: We need to improve the UI/UX of this widget (which are probably outside the scope of fixing this issue). For example, it doesn't seem to ever reset its recording when metronome is turned off. This results in long rests, which is making it a bit more time consuming as I test it. Also, when a user changes the value for Note Value for Music Keyboard, it automatically changes the value for Beat Value to be the same number. The reverse, however, is not true. @Commanderk3 Meanwhile, while I'm testing it, please implement the following: The same BPM specified for Keyboard during recording should be exported within the generated Action Blocks (as its first contained block, above the notes). This will help guarantee that the user gets a similar playback compared to what they played (unless they change the values themselves). (Anticipating a follow-up question:) I don't think we need to export Meter as it doesn't effect the sound. |
@pikurasa Of course sir, I will start working on it. I also think the same about the Meter block. To be honest I am not sure how it works. It does not show any effect. |
The meter block has implications when you combine it with other features, such as "on every beat do" or "on strong beat do", or when you're counting beats or measures. |
Understood. Basically it is useful when no note value is defined to a beat. |
Earlier the music keyboard was not following BPM. Now the widget is following BPM.