Skip to content

Repository files navigation

PocketSynth

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).

Why the odd MIDI path

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).

Layout

  • 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_scale
  • Strip.gd — soft per-note circles, fade on release
  • samples/{keys,marimba,pad}/n{24..102}.wav — one WAV every 6 semitones, generated by tools/make_samples.py (numpy, additive synthesis)
  • deploy/ports/ — the complete PortMaster-style bundle for the SD card

Controls (on device, via gptokeyb)

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

"Can't Go Wrong" mode & arpeggiator (v2)

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.

Build & deploy

  1. Open in Godot 3.5.2 → Project → Export → Linux/X11 → Export PCK/Zipdeploy/ports/pocketsynth/game.pck
  2. Copy deploy/ports/* to the SD card's ports/ folder (delete the card's old pocketsynth/ first — cp -R nests into existing dirs), then sync.
  3. 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.

Credits & license

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.2 runtime
  • 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.

About

A pocket sampler synthesizer: Korg microKEY2 → R36S retro handheld → Godot 3.5, via a bash rawmidi→UDP MIDI bridge on ArkOS

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages