A lot of fun so far ! Thanks for making this
There might be an actual issue in your case, but this feels to me like https://www.linuxatemyram.com/
I’m expecting mapping will write a lot of map data to files in your world folder which might explain the apparent high ram usage. Try looking at disk usage while the issue occur maybe ?
Open source Not […] allow […] commercial applications
For some definitions of open source, this is contradictory (FOSS). Some non FOSS licenses do limit commercial use while making the source available, this could be a possibility for you.
But, I’d instead recommend that you check if a copyleft license such as the GPL provide enough protections for your use case.
I don’t have the information regarding xmodmap, but here are two other options which I am using if you are interested.
I recommend https://github.com/kmonad/kmonad
Maybe look into PipeWire, Reaper in jack mode works fine connected to PipeWire for me, without any of the problems you mentioned.
It is quite possible that your desktop audio already uses PipeWire depending on your distribution, you would need to look at latency settings if you want live playback.