BEAT SPEED DIFFERENCE SENSITIVITY TEST
I have confirmed this test works in Firefox and Chrome.
It didn’t work for me in Safari.
If anything goes wrong, just reload the page.
After you ,
click .
            |
|
Testing Beat Speed Difference Sensitivity (BSDS) of: | |
Current level: | |
Consecutive correct answers at this BSDS: | |
Your Choice: |
Vist howtotunepianos.com for more free piano tuning lessons, videos, and resources.
In order to improve your tunings, you need to improve your Beat Speed Detection
as well as your Beat Speed Difference Sensitivity.
//faster = [447.5, 447, 446.5, 446, 445.75, 445.63, 445.5, 445.4, 445.3, 445.25, 445.2, 445.15, 445.1, 445.05]; //slower = [443.33,443.57,443.85,444.17,444.35,444.44,444.55,444.63,444.72,444.76,444.81,444.85,444.9,444.95];
function instructions() {
alert("BEAT SPEED DIFFERENCE SENSITIVITY TEST INSTRUCTIONS\n\ \n\ Confirm the setup values and then press START.\n\ \n\ The setup values should be 15% and 9 bps.\n\ If they are listed as NaN, then your browser does not support the javascript used to make this app.\n\ \n\ After 1 second, you will hear a beat speed of 9 beats per second. (9 bps)\n\ Then you will hear another beat speed that is randomly faster or slower than 9 bps.\n\ Simply click whether you hear the 2nd beat speed as faster or slower than the 1st beat speed.\n\ \n\ Then there will be a pause of 1 second, and then you will hear the 9 bps beat speed again,\n\ followed by a randomly generated faster or slower beat speed\n\ \n\ Click NEW BEAT SPEED if you want to hear another randonly generated beat speed.\n\ You can use this button if you are not sure of a beat speed.\n\ ") }
function scoring() {
alert("BEAT SPEED DIFFERENCE SENSITIVITY TEST SCORING\n\ \n\ You will start out hearing the 2nd beat speed as being 15% faster or slower than 9 bps.\n\ If you get three in a row correct, the beat speed difference will get smaller.\n\ If you get one wrong, your beat speed difference will increase\n\ \n\ To be scored at that new, larger beat speed difference, you will need to get three more correct in a row.\n\ To be scored at a certain beat speed difference sensitivity, you will need to get six correct, and none wrong, at that beat speed difference.\n\ \n\ Try to get below 6%, the threshold for tuning equal temperament.\n\ You should be able to get lower than 6%, regardless of musical training or aural piano tuning experience.") }
function setup() { /* levelString = document.startingValues.bsdStart.value; level = Number(levelString);
refBpsString = document.startingValues.bpsStart.value; refBps = Number(refBpsString); */
//Setup level = 4; refBps = 9;
faster = [ 440+((bsd[0]+1)*refBps), 440+((bsd[1]+1)*refBps), 440+((bsd[2]+1)*refBps), 440+((bsd[3]+1)*refBps), 440+((bsd[4]+1)*refBps), 440+((bsd[5]+1)*refBps), 440+((bsd[6]+1)*refBps), 440+((bsd[7]+1)*refBps), 440+((bsd[8]+1)*refBps), 440+((bsd[9]+1)*refBps), 440+((bsd[10]+1)*refBps), 440+((bsd[11]+1)*refBps), 440+((bsd[12]+1)*refBps), 440+((bsd[13]+1)*refBps), 440+((bsd[14]+1)*refBps), 440+((bsd[15]+1)*refBps) ];
slower = [ 440 + refBps/(bsd[0]+1), 440 + refBps/(bsd[1]+1), 440 + refBps/(bsd[2]+1), 440 + refBps/(bsd[3]+1), 440 + refBps/(bsd[4]+1), 440 + refBps/(bsd[5]+1), 440 + refBps/(bsd[6]+1), 440 + refBps/(bsd[7]+1), 440 + refBps/(bsd[8]+1), 440 + refBps/(bsd[9]+1), 440 + refBps/(bsd[10]+1), 440 + refBps/(bsd[11]+1), 440 + refBps/(bsd[12]+1), 440 + refBps/(bsd[13]+1), 440 + refBps/(bsd[14]+1), 440 + refBps/(bsd[15]+1)
];
alert("Test has been set up with the following parameters:\n\ Starting beat speed difference: " + bsd[level]*100 + "%\n\ Reference beat speed: " + refBps + "bps\n\ Click OK to continue."); }
//END OF SETUP FUNCTION
//INITIALIZING VARIABLES
bsd = [0.5, 0.4, 0.3, 0.2, 0.1, 0.06, 0.05, 0.04, 0.03, 0.02, 0.01, 0.005, 0.0025]; passed = [0,0,0,0,0,0,0,0,0,0,0,0,0,0]; conCorrect = 0;
level = 0; choice = "empty";
document.getElementById("bsd").innerHTML = "50%"; document.getElementById("currentLevel").innerHTML = level + 1; document.getElementById("currentLevel").innerHTML = level + 1; document.getElementById("currentLevel").innerHTML = level + 1;
// Initialize the Audio Context var context = new AudioContext(); // Create audio container with webkit prefix
// Declare variables in the global scope so they can be disconnected var a440, a445, constRef, moveablePitch; var a440Gain, a445Gain, constRefGain, moveablePitchain;
//DONE INITIALIZING VARIABLES
//FUNCTIONS
//Return a pitch that gives the required bsd randomly faster or slower function getPitch() { var coin = Math.random();
if (coin > 0.5) { return faster[level]; } else { return slower[level]; } }
//Do if user chooses faster function fasterChoice() { constRef.stop(0); // Stop oscillator after 0 seconds constRef.disconnect(); // Disconnect oscillator so it can be picked up by browser's garbage collector moveablePitch.stop(0); // Stop oscillator after 0 seconds moveablePitch.disconnect(); // Disconnect oscillator so it can be picked up by browser's garbage collector
choice = "Faster";
if (difference > refBps) { //Correct? document.getElementById("Choice").innerHTML = "Correct"; conCorrect = conCorrect + 1; document.getElementById("curConCorrect").innerHTML = conCorrect;
if (conCorrect > 2) { //if third correct if (passed[level] === 1) { //2nd time completing this level var r = confirm("Your Beat Speed Sensitivity is " + bsd[level]*100 + "%\n\Do you want to play again?"); if (r === true) { //Play again bsd = 0.5 window.location.reload(); } else { //Finished playing alert("Thanks for playing.\n\Please subscribe to howtotunepianos.com"); return; } } else { //1st time completing this level passed[level] = 1; level = level + 1; if (level > 15) { //highest level var r = confirm("You got the highest level!\n\Your Beat Speed Sensitivity is 0.25%!\n\Do you want to play Again?"); if (r === true) { //Play again window.location.reload(); } else { //Finished playing alert("Thanks for playing.\n\Please subscribe to howtotunepianos.com"); return; } } else { //Not at highest level yet. Setup for next level. document.getElementById("currentLevel").innerHTML = level + 1; document.getElementById("bsd").innerHTML = bsd[level]*100 + "%"; conCorrect = 0; document.getElementById("curConCorrect").innerHTML = " "; } } } else { //Not third correct document.getElementById("curConCorrect").innerHTML = conCorrect; } } else { //if wrong document.getElementById("Choice").innerHTML = "Wrong"; conCorrect = 0 level = level - 1; if (level < 0) { //failed first level var r = confirm("Your Beat Speed Sensitivity is " + bsd*100 + "%\n\Do you want to play Again?"); if (r === true) { //Play again window.location.reload(); } else { //Finished playing alert("Thanks for playing.\n\Please subscribe to howtotunepianos.com"); return; } } } choice = "empty"; playInterval() var clearChoice = setTimeout(function(){ document.getElementById("Choice").innerHTML = ""; },3000); } function stopTest() { window.location.reload(); } //Do if user chooses slower function slowerChoice() { constRef.stop(0); // Stop oscillator after 0 seconds constRef.disconnect(); // Disconnect oscillator so it can be picked up by browser�s garbage collector moveablePitch.stop(0); // Stop oscillator after 0 seconds moveablePitch.disconnect(); // Disconnect oscillator so it can be picked up by browser�s garbage collector choice = "Slower"; if (difference < refBps) { //Correct? document.getElementById("Choice").innerHTML = "Correct"; conCorrect = conCorrect + 1; document.getElementById("curConCorrect").innerHTML = conCorrect; if (conCorrect > 2) { //if third correct if (passed[level] === 1) { //2nd time completing this level var r = confirm("Your Beat Speed Sensitivity is " + bsd[level]*100 + "%\n\Do you want to play again?"); if (r === true) { //Play again window.location.reload(); } else { //Finished playing alert("Thanks for playing.\n\Please subscribe to howtotunepianos.com"); return; } } else { //1st time completing this level passed[level] = 1; level = level + 1; if (level > 15) { //highest level var r = confirm("You got the highest level!\n\Your Beat Speed Difference Sensitivity is 0.25%!\n\Do you want to play Again?"); if (r === true) { //Play again window.location.reload(); } else { //Finished playing alert("Thanks for playing.\n\Please subscribe to howtotunepianos.com"); return; } } else { //Not at highest level yet. Setup for next level. document.getElementById("currentLevel").innerHTML = level + 1; document.getElementById("bsd").innerHTML = bsd[level]*100 + "%"; conCorrect = 0; document.getElementById("curConCorrect").innerHTML = " "; } } } else { //Not third correct document.getElementById("curConCorrect").innerHTML = conCorrect; } } else { //if wrong document.getElementById("Choice").innerHTML = "Wrong"; conCorrect = 0 level = level - 1; if (level < 0) { //failed first level var r = confirm("Your Beat Speed Difference Sensitivity is " + bsd*100 + "%\n\Do you want to play Again?"); if (r === true) { //Play again window.location.reload(); } else { //Finished playing alert("Thanks for playing.\n\Please subscribe to howtotunepianos.com"); return; } } } choice = "empty"; playInterval() var clearChoice = setTimeout(function(){ document.getElementById("Choice").innerHTML = ""; },3000); } function playInterval(){ pitch = getPitch(); document.getElementById("bsd").innerHTML = bsd[level]*100 + "%"; document.getElementById("currentLevel").innerHTML = level + 1; difference = pitch - 440; // Play a440 immediately for 2s var playA440 = setTimeout(function(){ a440 = context.createOscillator(); // Create sound source a440.type = "sine"; // Sine wave a440.frequency.value = 440; // Frequency in hertz (passed from input button) a440.start(0); // Play oscillator instantly a440Gain = context.createGain(); // Create gain node a440Gain.gain.value = 1; // Set gain to full volume a440.connect(a440Gain); // Connect oscillator to gain a440Gain.connect(context.destination); // Connect gain to output },1500); var stopA440 = setTimeout(function(){ a440Gain.gain.value = 0; // Set gain to zero a440.stop(0); // Stop oscillator after 0 seconds a440.disconnect(); // Disconnect oscillator so it can be picked up by browser�s garbage collector },3000); // Play a445 immediately for 2s var playA445 = setTimeout(function(){ a445 = context.createOscillator(); // Create sound source a445.type = "sine"; // Sine wave a445.frequency.value = 440 + refBps; // Frequency in hertz (passed from input button) a445.start(0); // Play oscillator instantly a445Gain = context.createGain(); // Create gain node a445Gain.gain.value = 1; // Set gain to full volume a445.connect(a445Gain); // Connect oscillator to gain a445Gain.connect(context.destination); // Connect gain to output },1500); var stopA445 = setTimeout(function(){ a445Gain.gain.value = 0; // Set gain to zero a445.stop(0); // Stop oscillator after 0 seconds a445.disconnect(); // Disconnect oscillator so it can be picked up by browser�s garbage collector },3000); // Play constRef after 2s for 2s var playConstRef = setTimeout(function(){ constRef = context.createOscillator(); // Create sound source constRef.type = "sine"; // Sine wave constRef.frequency.value = 440; // Frequency in hertz (passed from input button) constRef.start(0); // Play oscillator instantly constRefGain = context.createGain(); // Create gain node constRefGain.gain.value = 1; // Set gain to full volume constRef.connect(constRefGain); // Connect oscillator to gain constRefGain.connect(context.destination); // Connect gain to output },3500); var stopConstRef = setTimeout(function(){ constRef.stop(0); // Stop oscillator after 0 seconds constRef.disconnect(); // Disconnect oscillator so it can be picked up by browser�s garbage collector },6800); // Play moveablePitch after 2s for 2s var playMoveablePitch = setTimeout(function(){ moveablePitch = context.createOscillator(); // Create sound source moveablePitch.type = "sine"; // Sine wave moveablePitch.frequency.value = pitch; // Frequency in hertz (passed from input button) moveablePitch.start(0); // Play oscillator instantly moveablePitchGain = context.createGain(); // Create gain node moveablePitchGain.gain.value = 1; // Set gain to full volume moveablePitch.connect(moveablePitchGain); // Connect oscillator to gain moveablePitchGain.connect(context.destination); // Connect gain to output },3500); var stopA445 = setTimeout(function(){ moveablePitch.stop(0); // Stop oscillator after 0 seconds moveablePitch.disconnect(); // Disconnect oscillator so it can be picked up by browser�s garbage collector },6800); }