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 is stuck at 4 beats in the bar #698

Open
tbar0970 opened this issue May 27, 2024 · 4 comments
Open

Metronome is stuck at 4 beats in the bar #698

tbar0970 opened this issue May 27, 2024 · 4 comments

Comments

@tbar0970
Copy link

It would be really great to make this configurable.

const QUARTERS_PER_BAR = 4;

I wonder if anyone can suggest a workaround in the meantime?

@notwaldorf
Copy link
Collaborator

I think what you’re looking for is the clicksPerQuarter property, which is public. That constant just says there are 4 quarters in a whole thing, which is the only number of quarters you can have, but it’s then used to calculate how many clicks you actually have in the bar like this:

const clicksInBar = QUARTERS_PER_BAR * this.clicksPerQuarter

So if you change clicksPerQuarter on the metronome object to be something other than 1 (the default), you’ll have more than 4 clicks in the bar.

@tbar0970
Copy link
Author

I did note the clicksPerQuarter property, but it is different.

In 3/4 time there are 3 quarter notes in each bar. I might want 2 clicks for each quarter note - 6 clicks in total, with the first of the 6 accented (high note). This is currently impossible - the accented click has to be a multiple of 4.

I have managed to fork my own version of the class to add a new quartersPerBar property. If i have time i will try to submit a PR.

@notwaldorf
Copy link
Collaborator

Ahhhh yes you’re right, my bad. I forgot about good old 3/4 and friends

@notwaldorf notwaldorf reopened this Jun 1, 2024
@notwaldorf
Copy link
Collaborator

@tbar0970 one thing you could do is set the clicksPerQuarter property to 0.75 — that would make the math for clicksInBar correct, though you might run into float number nonsense. The real fix would be to just make that const a property.

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

No branches or pull requests

2 participants