A little known feature of the keyboard control is that you can play it with the computer QWERTY keyboard e.g.
however the state of ctrl/shift/meta is not checked, meaning that e.g. both R and SHIFT-R will play F4.
Unfortunately CMD-R will also play F4 - which is leading to stuck notes when I refresh my midi app web page! You see, I use the standard CMD-R to reload the browser page (to load the latest code), and just before the reload, a F4 noteon is send to my midi device - because of the R in CMD-R. A subsequent noteoff is never send because the browser app has now just reloaded and is in a starting state, with no knowledge of what happened before.
Here is the webaudio-controls.js code which I think should be changed to check for the state of ctrl/shift/meta and only send keyboard events when no modifier key is pressed.
keydown(e){
let m=Math.floor((this.min+11)/12)*12;
let k=this.keycodes1.indexOf(e.keyCode);
if(k<0) {
k=this.keycodes2.indexOf(e.keyCode);
if(k>=0) k+=12;
}
if(k>=0){
k+=m;
if(this.currentKey!=k){
this.currentKey=k;
this.sendEventFromKey(1,k);
this.setNote(1,k);
}
}
}
Also, arguably this "playing via keyboard" feature should be documented and an attribute added to control whether the developer wants this feature on, as it could interfere in other ways with a web app.
A little known feature of the keyboard control is that you can play it with the computer QWERTY keyboard e.g.
however the state of ctrl/shift/meta is not checked, meaning that e.g. both
RandSHIFT-Rwill play F4.Unfortunately
CMD-Rwill also play F4 - which is leading to stuck notes when I refresh my midi app web page! You see, I use the standardCMD-Rto reload the browser page (to load the latest code), and just before the reload, a F4noteonis send to my midi device - because of theRinCMD-R. A subsequentnoteoffis never send because the browser app has now just reloaded and is in a starting state, with no knowledge of what happened before.Here is the
webaudio-controls.jscode which I think should be changed to check for the state of ctrl/shift/meta and only send keyboard events when no modifier key is pressed.Also, arguably this "playing via keyboard" feature should be documented and an attribute added to control whether the developer wants this feature on, as it could interfere in other ways with a web app.