diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 9c582b7..8a10e0e 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="3" + android:versionName="0.91"> diff --git a/android/res/raw/rom1a.syx b/android/res/raw/rom1a.syx index ae79b46..027a9c0 100644 Binary files a/android/res/raw/rom1a.syx and b/android/res/raw/rom1a.syx differ diff --git a/android/src/com/levien/synthesizer/android/ui/PianoActivity2.java b/android/src/com/levien/synthesizer/android/ui/PianoActivity2.java index 1a9b09d..fc07be1 100644 --- a/android/src/com/levien/synthesizer/android/ui/PianoActivity2.java +++ b/android/src/com/levien/synthesizer/android/ui/PianoActivity2.java @@ -228,7 +228,7 @@ public class PianoActivity2 extends Activity { private void tryConnectUsb() { UsbManager usbManager = (UsbManager) getSystemService(Context.USB_SERVICE); HashMap deviceList = usbManager.getDeviceList(); - TextView label = (TextView)findViewById(R.id.volumeLabel); + TextView label = (TextView)findViewById(R.id.status); if (!deviceList.isEmpty()) { UsbDevice device = deviceList.values().iterator().next(); //label.setText("ic:" + device.getInterfaceCount()); @@ -240,7 +240,9 @@ public class PianoActivity2 extends Activity { //label.setText(endpoint.toString()); startUsbThread(connection, endpoint); } else { - label.setText("error opening device"); + if (label != null) { + label.setText("error opening device"); + } } } } diff --git a/android/src/com/levien/synthesizer/android/widgets/piano/PianoView.java b/android/src/com/levien/synthesizer/android/widgets/piano/PianoView.java index 6dd2884..18f3f8a 100644 --- a/android/src/com/levien/synthesizer/android/widgets/piano/PianoView.java +++ b/android/src/com/levien/synthesizer/android/widgets/piano/PianoView.java @@ -413,7 +413,7 @@ public class PianoView extends View { private PianoViewListener pianoViewListener_; // The number of simultaneous fingers supported by this control. - protected static final int FINGERS = 5; + protected static final int FINGERS = 10; // Whether to use pressure (doesn't work well on all hardware) private boolean usePressure_ = false; diff --git a/cpp/src/pitchenv.cc b/cpp/src/pitchenv.cc index 6c0780f..ee91b03 100644 --- a/cpp/src/pitchenv.cc +++ b/cpp/src/pitchenv.cc @@ -25,12 +25,31 @@ void PitchEnv::init(double sample_rate) { unit_ = N * (1 << 24) / (21.3 * sample_rate) + 0.5; } +static uint8_t ratetab[] = { + 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, + 12, 13, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 30, 31, 33, 34, 36, 37, 38, 39, 41, 42, 44, 46, 47, + 49, 51, 53, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 79, 82, + 85, 88, 91, 94, 98, 102, 106, 110, 115, 120, 125, 130, 135, 141, 147, + 153, 159, 165, 171, 178, 185, 193, 202, 211, 232, 243, 254, 255 +}; + +static int8_t pitchtab[] = { + -128, -116, -104, -95, -85, -76, -68, -61, -56, -52, -49, -46, -43, + -41, -39, -37, -35, -33, -32, -31, -30, -29, -28, -27, -26, -25, -24, + -23, -22, -21, -20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, + -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 38, 40, 43, 46, 49, 53, 58, 65, 73, + 82, 92, 103, 115, 127 +}; + void PitchEnv::set(const int r[4], const int l[4]) { for (int i = 0; i < 4; i++) { rates_[i] = r[i]; levels_[i] = l[i]; } - level_ = 0; + level_ = pitchtab[l[3]] << 19; down_ = true; advance(0); } @@ -61,25 +80,6 @@ void PitchEnv::keydown(bool d) { } } -static uint8_t ratetab[] = { - 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, - 12, 13, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 30, 31, 33, 34, 36, 37, 38, 39, 41, 42, 44, 46, 47, - 49, 51, 53, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 79, 82, - 85, 88, 91, 94, 98, 102, 106, 110, 115, 120, 125, 130, 135, 141, 147, - 153, 159, 165, 171, 178, 185, 193, 202, 211, 232, 243, 254, 255 -}; - -static int8_t pitchtab[] = { - -128, -116, -104, -95, -85, -76, -68, -61, -56, -52, -49, -46, -43, - -41, -39, -37, -35, -33, -32, -31, -30, -29, -28, -27, -26, -25, -24, - -23, -22, -21, -20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, - -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 38, 40, 43, 46, 49, 53, 58, 65, 73, - 82, 92, 103, 115, 127 -}; - void PitchEnv::advance(int newix) { ix_ = newix; if (ix_ < 4) { diff --git a/cpp/src/synth_unit.cc b/cpp/src/synth_unit.cc index 6dafc9f..546766a 100644 --- a/cpp/src/synth_unit.cc +++ b/cpp/src/synth_unit.cc @@ -160,7 +160,7 @@ int SynthUnit::ProcessMidiMessage(const uint8_t *buf, int buf_size) { int controller = buf[1]; int value = buf[2]; if (controller == 1) { - filter_control_[0] = 129423563 + value * 1019083; + filter_control_[0] = 142365917 + value * 917175; } else if (controller == 2) { filter_control_[1] = value * 528416; } else if (controller == 64) {