The reason Beep.Voice.duration documented in READ ME because it is not finished yet !;) Theres a line in the source code that literally says "Now they are not doing anything, just here, as a stand for the future." This applies to .duration , .attack , etc. Theres requires a request to implement some of these functions here , but I had to do some important things since this request was submitted; You will need to take a closer look as soon as Ive finished fixing some of the larger structural problems. (I promise!)
Your approach, meanwhile, seems right for the money. Ive reduced it a bit and made it 200 milliseconds, not 20, so I could do a little more here:
var voice = new Beep.Voice('4Dβ') voice.play() setTimeout( function(){ voice.pause() }, 200 )
I saw that you used rather small notes in your code example, for example, β1A ββ. If you just test this on regular laptop speakers - this is the place I go to often, you may find that the tone is too low for your speakers; You will hear a ticking or dead silence. So donβt worry: this is not a mistake, just a hardware problem :)
source share