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

play-1.js: add support for metronome + count-in #28

Open
joaocc opened this issue Sep 8, 2017 · 6 comments
Open

play-1.js: add support for metronome + count-in #28

joaocc opened this issue Sep 8, 2017 · 6 comments

Comments

@joaocc
Copy link

joaocc commented Sep 8, 2017

Hi,
Do you have anything lined up to (optionally) play a metronome sound on top of the current generated sound?
If this is the case, it would also be great to have a count-in of 1 or 2 bars (ie, just the metronome sound for 1 or 2 bars before starting the visual and audio).
Thx

@moinejf
Copy link
Owner

moinejf commented Sep 9, 2017

I have no use of a metronome, but you can do it yourself: just replace play.js and add the metronome before the call to toaudio5.play (the audiocontext is in 'ac' in the 'conf' object ).

@joaocc
Copy link
Author

joaocc commented Sep 9, 2017

How would you suggest we sync the metronome beats with the note outputs? Is there any callback that is being triggered on the tempo? Thx

@moinejf
Copy link
Owner

moinejf commented Sep 10, 2017

A simple solution: add a 'metronome' voice.
In your version of play.js, wrap the AbcPlay method 'add()'.
In add(), you get the symbol list which is sorted by time and the voice table.
Then, add a voice, insert the metronome notes in this voice and lnsert these notes at the right time in the symbol list.
For the metronome to start before the tune, shift all the 'time's of the symbols.

@joaocc
Copy link
Author

joaocc commented Sep 10, 2017

Thx! We will look into that.

@bwl21
Copy link
Contributor

bwl21 commented Nov 4, 2017

@joaocc did you implement @moinejf's proposal?

@joaocc
Copy link
Author

joaocc commented Nov 4, 2017

Not yet.
At this moment we have a "plain" metronome playing a bit before.
However, we will probably do a "silent" count-in (1 or 1/2 bar), followed by a 1 bar with metronome, and then start the playalong. Also, at the moment, we don't know if we have the js-fu to implement it the way @moinejf suggested.

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

3 participants