Extended Pitch bend range. Register: +/- 1 octave.

pull/19/head
MrDham 5 years ago committed by GitHub
parent f995079ee8
commit f2a1bea3e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 30
      Open_Theremin_V3/application.cpp

@ -282,7 +282,7 @@ void Application::loop() {
// set wave frequency for each mode // set wave frequency for each mode
switch (_mode) { switch (_mode) {
case MUTE : /* NOTHING! */; break; case MUTE : /* NOTHING! */; break;
case NORMAL : setWavetableSampleAdvance(((pitchCalibrationBase-pitch_v)+2048-(pitchPotValue<<2))/registerValue); break; case NORMAL : setWavetableSampleAdvance(((pitchCalibrationBase-pitch_v)+2048-(pitchPotValue<<2))>>registerValue); break;
}; };
// HW_LED2_OFF; // HW_LED2_OFF;
@ -801,7 +801,19 @@ void Application::set_parameters ()
{ {
case 0: case 0:
// Transpose // Transpose
registerValue=4-(data_pot_value>>8); switch (data_pot_value >> 8)
{
case 0:
registerValue=3; // -1 Octave
break;
case 1:
case 2:
registerValue=2; // Center
break;
default:
registerValue=1; // +1 Octave
break;
}
break; break;
case 1: case 1:
@ -852,22 +864,28 @@ void Application::set_parameters ()
{ {
case 0: case 0:
midi_bend_range = 1; midi_bend_range = 1;
break; break;
case 1: case 1:
case 2:
midi_bend_range = 2; midi_bend_range = 2;
break; break;
case 2:
midi_bend_range = 4;
break;
case 3: case 3:
midi_bend_range = 5;
break;
case 4: case 4:
midi_bend_range = 7; midi_bend_range = 7;
break; break;
case 5: case 5:
case 6:
midi_bend_range = 12; midi_bend_range = 12;
break; break;
default: case 6:
midi_bend_range = 24; midi_bend_range = 24;
break; break;
default:
midi_bend_range = 48;
break;
} }
break; break;

Loading…
Cancel
Save