Tuning text
sharpoblunto
Over the event horizon, toward the singularity
News
Projects
About
Follow on Bluesky<br>RSS<br>Follow on GitHub
Tuning text
Posted on Aug 19, 2026
programming
automation
While the venerable keyboard and a good text editor are sufficient for most forms of text manipulation, there are cases where more specific tasks call for more specific hardware solutions. One such task I’ve found myself doing more recently is editing numerical/float values in large JSON files. I have a game engine Junkship.net that has a JSON config file full of all sorts of magic numbers that control rendering, controls, world generation etc. and my engine will hot reload those values on changes to the config file. The workflow for editing these values gets pretty tedious because its mostly small increments/decrements to the values, and often there are multiple values which interact with each other and need to be edited at the same time.
So I thought to myself is there some hardware that I could use that would allow fine manipulation of numerical values as well as quick editing of multiple values in parallel? Turns out that music production has this exact same problem and has built all sorts of cool hardware solutions - namely the MIDI controller! These come in all shapes and sizes, consisting of knobs, dials, switches, buttons etc. but in my case I wanted a small device with a bunch of rotary encoder knobs (with click buttons), and after looking around for a bit I determined that the Intech EN16 would be ideal for my usecase.
Once I had it hooked up, I needed to figure out how to actually map the interactions effectively into a text editor. The method I ended up going for was to have each knobs button press ‘capture’ any value under the cursor that matched a int/float regex, and once captured, the knobs rotary motion would increment or decrement that value, regardless of what other edits were going on or where the cursor went after the capture, pressing the knob again would ‘release’ that value. Each knob can capture a different value, so its possible to edit a dozen different values via knob control at the same time. To decide what the increment/decrement value should be for a captured value, I default to the least significant power of 10 in the value e.g. when capturing 10.2, the increment value becomes 0.1. To make it a bit easier to edit the increment/decrement as well as navigating between captured values I specified a navigation knob which cycles between the next/previous capturable value in the document, and added another knob that multiplies/divides the currently captured values multiplier by 10.
I built all this into a vibe coded Neovim plugin, which after a few tweaks worked basically the way I wanted. This is the part of the project that honestly would have probably prevented me from being bothered if I had to re-learn Lua & do it by hand, but in this case it was very quick to have a working version up & running. Below is a quick screengrab showing the editing working in action. The highlights in parenthesis represent captured values and when the values change up/down thats me using the knob controllers to bump the values.
Watch the knob-controlled editing demo.
Please enable JavaScript to view the comments powered by Disqus.<br>comments powered by Disqus
News Archive
▶ 2026
Tuning text
▶ 2025
Zima Blue
▶ 2024
Adventures in programmer archaeology
▶ 2021
Forays into 3D printing
▶ 2020
Redundancy
▶ 2018
Digital shades
▶ 2016
Come on and Slam and welcome to the (game) Jam
Building an automated garden watering system with a Raspberry Pi, Node, React & HomeKit
Unit testing React components in libraries using npm link
▶ 2015
Funemployment project one - Pixel art Hong Kong
▶ 2014
Carlos the Jekyll
Getting a tolerable windows command line
▶ 2013
The Dukebox of Hazzard, open source at last
Perhaps the elderly are on to something…
▶ 2012
Panau Island and the Zombie apocalypse
Since we last spoke
I’m not a rockstar or a poet (at least while coding)
▶ 2011
Strange times
Coloring the void
▶ 2010
Welcome to sky Valley (otherwise known as what I spent last month doing in Minecraft)
Nightmare scenarios, universal parables, and debugging
Bus ride
Catastrophe and the cure
Better living through statistics
Walden 2.0
First post!
▶ 2009
Exponential routine maintenance
Who is getting all teh lolz?
Enter the Automaton
▶ 2008
Silverlight 2.0 released to the internets
New Zealand leading the way in draconian copyright infringement law
Hearing voices
Silverlight, one step forward, one step sideways
Regarding the reconstruction of a site with additional dynamism
Silverlight redux
Tomfoolery with Lua
why do people split movies into 700mb blocks?
Mobile torrentry
▶ 2007
c# project dependancy visualization
Mapping boost::signals to .net events
Film extravaganza
The trip to c++/cli with unexpected results
Regarding silverlight, services and somesuch.
Disclaimer:...