abcjs icon indicating copy to clipboard operation
abcjs copied to clipboard

Drum track not working as a metronome

Open olefrank opened this issue 2 years ago • 1 comments

I'm trying to add a simple metronome beat along with notes in the melody. I would like it to be configurable so that I can turn the metronome on/off clicking a button.

I tried the examples in the docs like https://paulrosen.github.io/abcjs/audio/synthesized-sound.html#drum-parameter:

var synthControl = new ABCJS.synth.SynthController({
  options: {
    drum: "dddd 76 77 77 77 60 30 30 30", 
  }
});

This however only plays one bar. So if I have a melody of 6 bars, I tried to just multiply it up by number of bars:

{
  drum: 'dddddddddddddddddddddddd 76 77 77 77 76 77 77 77 76 77 77 77 76 77 77 77 76 77 77 77 76 77 77 77 60 30 30 30 60 30 30 30 60 30 30 30 60 30 30 30 60 30 30 30 60 30 30 30',
  drumBars: 6,
}

Besides being a bit silly, this seems to layer drum tracks so it becomes louder and louder for each bar.. It seems like a bug to me.

What is the correct way of adding a metronome to a melody?

Thanks Ole

olefrank avatar Aug 24 '23 12:08 olefrank

This sounds like a bug somewhere. I don't quite understand the initial problem - the first thing you tried should have repeated that one bar over and over. You are saying that didn't happen? Because that should have worked. If you have an example I'll look at it.

The string is for 4/4 time, too. Is that what your music is?

For the second one, I'm not sure. That's a pretty fragile and confusing syntax and I've never done anything like that.

paulrosen avatar Sep 04 '23 14:09 paulrosen