Skip to content
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

Metronome support #886

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft

Conversation

presidento
Copy link

@presidento presidento commented Feb 12, 2023

ABC notation does not have metronome support. There is a workaround of using drum pattern, which can be quite complicated if the meter changes frequently. Also there is a bug in abcjs if the meter changes. (#849)

We can add a "metronomeVolume" parameter and abcjs can automatically calculates drum strings every time when meter changes.

Example:

M: C
L: 1/4
z4 | [M:3/4] z3 | [M:2/4] z2 | [M:6/8] z3 | [M:4/4] z4  ||

@presidento
Copy link
Author

At this moment this is the workaround I use for metronome. If you like the idea I can move forward and make production ready.

@paulrosen
Copy link
Owner

What's the interface you were planning on using for this? The tempo and the metronome ticks need to be passed in, at least. It seems like this is exactly duplicating the existing "drum" parameter. I agree that the drum parameter is cumbersome to set up and use, but that is part of the ABC standard so I think we're stuck with it. I'd prefer fixing the bug in drum. I'll be testing that PR soon.

@presidento
Copy link
Author

presidento commented Mar 14, 2023

I have about 250 small sheet musics on my site for those who cannot play some key melodies of songs by ear. For them I add metronome and pad to make practicing easier. Here is an example: https://kottak.mefju.hu/s/891

I do not code metronome drum parameter manually for all of those sheet musics. Previously I generated the drum parameters directly to ABC strings in a pre-processing phase, but when the meter changes it can be complicated. For example it is not trivial how to change this ABC notation with a script to add the proper drum parameters each time when meter changes:

M: 4/4
K: Db
L: 1/8
A, (A,D) | "Db"F3DE2(D>B,) | [M:6/4] (A,D3)-D4 z C (DF) | [M:4/4] "Db/F"A3D"Gb2"B2(A>F) |
"Db5/Ab"E8- | E4 z A (Ac) | "Gb/Bb"d3G (cB)(AG) | [M:6/4] "Db/AB"A4D4 "Gb/Bb"zD (DE) | "Db/Ab"F3A F3E D4 | [M:4/4] "Db"D8 ||

With the changes of this PR adding metronome for this ABC is pretty easy and works well for me (try it at https://kottak.mefju.hu/s/784). Yes, it duplicates the existing "drum" parameter, except it is very easy to use if you want a standard metronome and nothing else. (Which can be an initialization parameter of abcjs, not coded in ABC string.) And the drum parameter can be used for complex drum patterns if somebody needs it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants