Included is demo project CT-synth, which is a polyphonic synthesizer that can be played with an on-screen keyboard or with a real MIDI keyboard connected via USB. An Android tablet can be used if it has USB-host capability. The connection is done with an on-the-go (OTG) cable. PulseAudio (Linux) or OpenSLES (Android) is used for sound. No Jack interface for Linux is provided, mainly to get no conflicts if e.g. a browser is running.
The path to a suitable TrueType font file is more or less hard-coded in ct-widgets.cpp, but any other TTF font library can be used instead.
For the synthesizer go to CT-projects/CT-synth/linux and again type 'make'. If all goes well, program 'ct-synth' is created. You can try it using the mouse. If you click the button 'flip keyboard', then the keyboard will be replaced by a short manual explaining what all those sliders are for. If you created a new patch, you can hit the 'P' key, then your patch will be printed to the terminal. You can copy/paste it to file patch.cpp, and recompile. If you run the program with option -h the available options are printed. With options -mx and -my the screen dimensions can be scaled.
If you have a MIDI keyboard available, it can be connected via USB. Press the red button to establish the connection. If the system recognizes the keyboard, the red button will turn to green and you can play. Any keyboard with a class-compliant MIDI interface should work. The control knobs for pitch bend and modulation should function as expected.
The connection with a MIDI keyboard is slightly different from Linux: if you plug it in, Android will display a list of all appropriate apps that are installed on your device. Choose 'CT Synth Ftor'. Touch the red button. It should turn to green, and not turn to red again. If the keyboard was plugged-in already before the app was started, then a different popup screen may appear, asking you for permission to access the USB device.
The app uses the so-called immersive mode. Thus, if you are missing the back-, home- and list icons, give a swipe gesture at the top of the screen, they will appear for a short time.
Notice that 'adb logcat' is not available when the USB connection is occupied by the MIDI keyboard. The adb tool can also be used via a wifi connection, however this is rather impractical. It is simpler to remove the connection to the MIDI keyboard and re-connect the computer. Previous adb messages are still present on the device.
My own code is free, the code that I borrowed from others is indicated as such.
w dot boeke at upcmail dot nl