+ int nPitch = note.getPitch(), nChan = note.getChannel();
+ switch (nPitch) {
+ case 90:
+ if (dbtwn(getNow() - Tap1,5000,300*1000)) { // hackish tapping mechanism
+ double bpm = 32.*60000./(getNow()-Tap1);
+ while (bpm < 20) bpm*=2;
+ while (bpm > 40) bpm/=2;
+ lx.tempo.setBpm(bpm); lx.tempo.trigger(); Tap1=0; println("Tap Set - " + bpm + " bpm");
+ }
+ break;
+