A pocket sampler synthesizer for the R36S handheld (RK3326 / ArkOS):
Korg microKEY2 → USB OTG → midi_bridge.sh (rawmidi → UDP) → Godot 3.5 sampler.
Built in a day as a portable music tool for speech-therapy sessions.
📖 Full field manual (how it works, troubleshooting, the ArkOS audio-hijack story): https://harmonicsystems.github.io/pocketsynth/
Godot 3.5.x ONLY — do not open in Godot 4 (it silently converts and breaks the project).
The FRT runtime (Godot 3.5 for ARM handhelds) has no MIDI driver, and Godot 3
can't open /dev/snd char devices. So the launcher runs midi_bridge.sh,
which reads raw MIDI bytes from /dev/snd/midiC*D* and forwards them as UDP
datagrams to 127.0.0.1:9000; MidiInput.gd parses them. Proven end-to-end
on the device (2026-07-06).
Main.gd/Main.tscn— UI wiring (cream low-stimulation palette)MidiInput.gd— UDP listener + MIDI byte parser (running status, rt-filter)Sampler.gd— 10-voice sample playback, nearest-sample + pitch_scaleStrip.gd— soft per-note circles, fade on releasesamples/{keys,marimba,pad}/n{24..102}.wav— one WAV every 6 semitones, generated bytools/make_samples.py(numpy, additive synthesis)deploy/ports/— the complete PortMaster-style bundle for the SD card
D-pad left/right = instrument · up/down = volume · A = test note · B = all notes off · X = arpeggiator on/off · Y = cycle scale · L1/R1 = key root down/up · L2/R2 = arp tempo · Select = arp pattern · Start = quit
Incoming notes snap to the selected key/scale — the default is pentatonic major, where every key on the keyboard sounds right in any combination (the Orff-method trick). Scales: penta major/minor, major, natural minor, free play. The arpeggiator plays held keys as a pattern (up / down / up-down / random, 60–180 steps per minute) instead of sounding them directly — hold a quantized cluster with the pad instrument for instant ambient music.
- Open in Godot 3.5.2 →
Project → Export → Linux/X11 → Export PCK/Zip→deploy/ports/pocketsynth/game.pck - Copy
deploy/ports/*to the SD card'sports/folder (delete the card's oldpocketsynth/first —cp -Rnests into existing dirs), thensync. - On device: charger in the DC port (hot-plugging USB without it browns out the console), Korg on the OTG port, launch PocketSynth from Ports.
MIT licensed (see LICENSE). Standing on the shoulders of:
- Godot Engine 3.5.2 (MIT)
- FRT — Emanuele Fornara's Godot platform
port for small ARM boards (MIT); bundled here as the PortMaster
frt_3.5.2runtime - PortMaster — runtime packaging and the launcher/gptokeyb conventions this project follows
- gptokeyb — gamepad→keyboard mapping on device
Not affiliated with Korg; the microKEY2 is simply the class-compliant MIDI
keyboard this was built and tested with. Any class-compliant USB MIDI
keyboard should work — if it's not a Korg, note the udev vendor filter in
deploy/ports/FixKorgAudio.sh (id 0944) when using that optional fix.