frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Terpstra Keyboard

http://terpstrakeyboard.com/web-app/keys.htm
110•xeonmc•3h ago

Comments

squircle•2h ago
First thing I did when I started playing with LLMs was vibe code a bunch of shitty virtual instruments. Roll your own, folks! Good fun.
steveBK123•2h ago
Pretty cool
awongh•2h ago
This is cool!

I want to try to build a hardware midi keyboard using mechanical hall effect switches like this: https://mechanicalkeyboards.com/products/wuque-studio-dash-5...

There's a few physical keyboards out there but many are super super expensive.

maxdamantus•1h ago
I've kind of done this, just without the actual "build" part—I instead use a Wooting computer keyboard (which has the hall effect switches you're referring to), and I've written some program to emit MIDI based on key velocity.

I've been using it very frequently for a few years, and can confirm it's quite fun to use, though I don't have much experience playing other keyboard instruments and haven't tried to learn it seriously enough to make proper use of chords etc.

Demo of me playing here, though try not to mind the messy desk and bad recording setup (one-hand, MIDI going through phone due to lack of speakers): https://drive.google.com/file/d/1qZuFlK9GybX5aP5tGi54AvTTFKd...

The layout I use is not a regular piano layout, but a B-griff layout, as used on a bayan (Russian accordion). I made a demo site for playing with the layout (keyboard or touchscreen), but without velocity sensitivity: https://maxdamantus.gitlab.io/bayan/

The B-griff/C-griff layouts naturally fit computer keyboards, and I'd argue they're better in general than piano layouts for various reasons. There's also this cool video of someone using two Commodores for similar effect: https://youtube.com/watch?v=EBCYvoC4muc

EDIT: turns out the Terpstra keyboard is also able to work using B-griff: http://terpstrakeyboard.com/web-app/keys.htm?fundamental=261...

awongh•1h ago
> I've written some program to emit MIDI based on key velocity.

nice! Is the velocity code on the firmware side? Is that why it's not included on the demo site?

maxdamantus•19m ago
No, it's on the software (computer) side. It's not in the demo site because I created that in 2019 [0] for use with a regular keyboard (since I was having issues with the software I'd previously been using for playing MIDI). I only upgraded to the Wooting keyboard in late 2021.

I've been meaning to look into adding Wooting support, just haven't got round to it. This would require either WebUSB or WebHID which are still "experimental", and I'm not sure if there will be latency issues.

The program I created for computing velocity and emitting MIDI is here [1]. When it's listening for keyboard data it does it in another thread so that it can attach fairly accurate timestamps to the key events, without being subject to pauses from Gtk or something. If there's inconsistency between the key event times and the relative timestamps, the velocity detection can easily be quite far off. I've noticed this in Wooting's own MIDI application [2]. Hopefully WebUSB/WebHID includes timestamps in the data, so it doesn't have to be subject to JS GC pauses.

As well as the Rust program above (possibly Linux-only, though should be easily adaptable to work on Windows/macOS), I've written an Android app that does the same thing so I can use it without a computer (though in Android you have to take control of the USB device rather than just read the HID data), but I haven't uploaded the code anywhere.

[0] https://gitlab.com/Maxdamantus/bayan

[1] https://gist.github.com/Maxdamantus/c5d5133cab1ef3596ac589d2...

[2] https://github.com/WootingKb/wooting-analog-midi ... as well as issues with timestamp jitter, this application seems overall a bit bloated for my taste (web-based app using Tauri), and it's inconvenient since it will continue to generate MIDI when you're focused on other applications, so you'd have to close and open it (slow startup time too) each time you want to use it. their timestamp jitter occurs because the Wooting SDK (at least at the time, haven't looked at it recently) worked by running a thread that would update a shared HashMap and you would have to poll that hash map; it wasn't possible to see all updates, and there were no timestamps attached. I avoided the SDK and instead just read the data directly from the "hidraw" device.

Cthulhu_•2h ago
Fun fact, anyone with a surname that ends with the -stra or -sma suffix has their origins in Frisia [0], a region in current-day Netherlands and Germany that retained their independence in the Roman era. Terpstra specifically refers to someone living on a terp, an artificial hill (because there's no hills in the Netherlands lololol) that people would live on or retreat to with the intermittent floodings.

This in turn is why the Netherlands is so big when it comes to dairy and cheese; grass was one of the few things that would grow consistently and survive the floods, cows eat grass, cheese and butter can be preserved to last through winter, etc.

[0] https://en.wikipedia.org/wiki/Frisia

docdeek•2h ago
Very interesting. The only Terpstra I knew of before this link was Niki Terpstra, one of only three Dutch winners of both Paris-Roubaix and the Tour of Flanders.
agos•1h ago
I also recall one Brett Terpstra, maker of Marked app and kind of a known name in the indie Mac developer scene
futura_heavy•39m ago
I thought this was him debuting a new project.
thechao•1h ago
Dijkstra!
cwbrandsma•1h ago
And you will forever have your name mispronounced by English speakers that can’t wrap their tongues around the -sma or -stra ending.

Things like TerpSON, TerpSmith, Terp….

One time while voting the lady working there butchered my name 8 times, she literally could not get it right.

jeroenhd•1h ago
To be fair to an English speaker reading your name from paper: some native English speakers are taught to read by recognizing words by their first letter and their shape, and skipping the word to later fill in the blanks when they don't recognize the word. The lady may have simply never been taught how to sound out unfamiliar letter combinations, and may have been trying her best to make sense of the unrecognizable mess of letters she saw in front of her.

https://www.apmreports.org/episode/2019/08/22/whats-wrong-ho...

cwbrandsma•42m ago
She wasn't even reading it, I was telling her my name, all she had to do was repeat it and she couldn't do it.
quink•1h ago
> she literally could not get it right

Eh, they get their revenge. As any Australian of a certain age can tell you TelSTRA could not get it right, for any value of right, without expending an equivalent effort to moving a mountain.

quotz•1h ago
Another fun fact, from Wikipedia, the name Frisia "stems from Latin Frisii, an ethnonym used for a group of ancient tribes in modern-day Northwestern Germany, possibly being a loanword of Proto-Germanic *frisaz, meaning "curly, crisp", presumably referring to the hair of the tribesmen."

In German Frisur, and in south slavic languages Фризура, means hairstyle, which is also related to the english word Frizz

vintermann•1h ago
I think this is a reference to the muse Terpsichore, though?

We also have at least one -stra river in Norway, Vinstra. Don't know if anyone has it as last name, though.

Aachen•1h ago
I'm impressed how responsive the keys are! Will definitely be checking out on desktop if I can see how the audio rendering code works (unless someone here already knows). I presume the audio synthesis API and ontouchstart but maybe there's something clever in addition like prerendering the audio samples rather than synthesising them on press

Maybe it also helps that I've got a headphone jack plugged in instead of the Bluetooth I'm used to from listening to things during the day, but even so, my touchscreen just doesn't feel this responsive normally, including in games. It's on my list of things to check the delay of, but since my phone's 960 fps camera is the equipment I use to check that, it is a bit tricky

Edit: ontouchstart calls noteOn method https://github.com/wcgbg/terpstrakeyboard/blob/03d526a0ed5c7...

This eventually calls into audio api start with 0 delay https://github.com/wcgbg/terpstrakeyboard/blob/03d526a0ed5c7...

The data to play was retrieved from the server (based on the instrument you selected) and parsed ahead of time https://github.com/wcgbg/terpstrakeyboard/blob/03d526a0ed5c7...

It loads samples at four frequencies and plays the nearest one at the appropriate rate (proportional to the target frequency) https://github.com/wcgbg/terpstrakeyboard/blob/03d526a0ed5c7...

The settings.audioContext variable is simply an instance of the web audio API as expected (with a fallback to support Safari/webkit) https://github.com/wcgbg/terpstrakeyboard/blob/03d526a0ed5c7...

This gainNode it's connecting is just about playback volume it seems https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioCo... and "audioContext.destination", MDN says, you can think of as a speaker device

So nothing too special here: of course preloading server data but then simply creating a new sound source during ontouchstart is enough. I guess delay in other software comes from the extra cruft they have such as big libraries (and Bluetooth, in the cases where I use that), not from any actual delay in touchscreen or audio rendering

dist-epoch•1h ago
responsive, but there is a small click between notes. maybe they start mid phase
Aachen•1h ago
What browser and OS is that? I experience no clicks on Android 10 with a chromium webview-based browser
mikepurvis•1h ago
Butter-smooth for me on Window 11 + Firefox
matteason•1h ago
I had a quick look - it's sample-based (eg organ has 4 preloaded samples, http://terpstrakeyboard.com/web-app/sounds/organ440.mp3 plus 110, 220 and 880Hz variants), and different notes are created by adjusting the playbackRate of the closest sample

It's also all just vanilla JS which probably helps keep it snappy

randomtoast•1h ago
Somehow I cannot open the website.
aniviacat•1h ago
It's HTTP only, maybe that's why?
amne•21m ago
The article link is missing the scheme so the browser will default to https. I get an error about the CNAME mismatching the Host on https for example.
_joel•1h ago
This would be great for Klingon Opera :) https://www.youtube.com/watch?v=1LjcBv-OWtQ
gbuk2013•1h ago
Sound is not quite right - C## should sound like D but it’s slightly off.
kevinwang•59m ago
Looks like the default settings correspond to a 31-note scale instead of the usual 12-tone scale. https://en.m.wikipedia.org/wiki/31_equal_temperament
bluGill•53m ago
I've been trying to design a keyboard that can be used with the feet - something that I can play like dance dance revolution, while playing something else with my hands (mandolin), thus making me a one man band. Figuring out what a good layout would be is the first step and so far everything I've thought of either lacks useful notes, is too big to reach useful notes, or the keys are too close together. If anyone has ideas on how to do this I'd love help. (or better yet do this as I don't have must time to work on it)
hobs•9m ago
I'd probably be thinking foot pedals and chording if I needed a lot of options.
addandsubtract•19m ago
TIL MacBook keyboards only send 6 key presses at once.
neuroelectron•8m ago
iPad maxes out at 10

https://imgur.com/a/01OYs3o

Relationships outside an appropriate age range

https://flowingdata.com/2025/06/18/relationships-outside-an-appropriate-age-range/
1•janpio•37s ago•0 comments

A Love Letter to Physical Whiteboards

https://brodzinski.com/2025/06/physical-whiteboards.html
1•flail•1m ago•0 comments

FerriteCon 2025

https://ferrite-fem.github.io/FerriteCon/2025/
1•darboux•2m ago•1 comments

Refactoring More and Faster

https://elijahpotter.dev/articles/refactoring_more_and_faster
2•chilipepperhott•3m ago•0 comments

color-identifiers-mode: Emacs minor mode to highlight each identifier uniquely

https://github.com/ankurdave/color-identifiers-mode
1•tosh•3m ago•0 comments

Astronomers capture most detailed thousand-colour image of a galaxy

https://www.eso.org/public/news/eso2510/
1•geox•4m ago•0 comments

Is a giant web of ocean currents headed for collapse? The race is on to find out

https://www.nature.com/articles/d41586-025-01885-4
1•rntn•4m ago•0 comments

How People Decided It's OK to Wear AirPods Anywhere, Anytime

https://www.wsj.com/lifestyle/workplace/how-people-decided-its-ok-to-wear-airpods-anywhere-anytime-34823672
2•bookofjoe•5m ago•1 comments

Show HN: I built a website to roast hilarious AI conversations

https://www.zonk.wtf
1•jeylau•6m ago•1 comments

The Submarine (2005)

https://www.paulgraham.com/submarine.html
1•ksec•7m ago•0 comments

Show HN: Trieve CLI – Terminal-Based LLM Agent Loop with Search Tool for PDFs

https://github.com/devflowinc/trieve/tree/main/clients/cli
2•skeptrune•8m ago•0 comments

Introducing the Ultra Plan

https://www.cursor.com/en/blog/new-tier
1•lambda-science•8m ago•0 comments

The plight of the misunderstood memory ordering

https://www.grayolson.me/blog/posts/misunderstood-memory-ordering/
2•todsacerdoti•8m ago•0 comments

Barry Vercoe, who made coding sound accessible to all, has died

https://mixmasterworld.com/barry-vercoe-who-made-coding-sound-accessible-to-all-has-died/
1•hecanjog•10m ago•0 comments

Size matters: Sharks follow two-thirds scaling law, proving theory

https://phys.org/news/2025-06-size-sharks-thirds-scaling-law.html
1•pseudolus•10m ago•0 comments

Siri, Can I Speak to Someone Smarter? – By OMC

https://omc345.substack.com/p/siri-can-i-speak-to-someone-smarter
1•rbanffy•10m ago•0 comments

Coffee Consumption and Mortality Among US Adults: A Prospective Cohort Study

https://www.sciencedirect.com/science/article/abs/pii/S002231662500286X
1•gnabgib•11m ago•0 comments

Antenna Matching: Basics of Matching a mobile antenna to 50 ohms Coax

http://www.k0bg.com/match.html
1•joebig•12m ago•0 comments

Mario Kart World had a significantly larger dev team than past entries

https://automaton-media.com/en/news/mario-kart-world-had-a-significantly-larger-dev-team-than-past-entries-with-art-related-positions-increasing-threefold/
2•alazsengul•13m ago•0 comments

Expert Generalists

https://martinfowler.com/articles/expert-generalist.html
1•ajhenaor•13m ago•0 comments

Governments are ditching Windows and Microsoft Office

https://www.windowscentral.com/software-apps/windows-11/goverments-are-ditching-windows-and-microsoft-office-new-letter-reveals-the-real-costs-of-switching-to-windows-11
5•DocFeind•14m ago•0 comments

Ask HN: Has anyone seen this before in any ChatGPT?

1•HereticGlaux•14m ago•0 comments

Edmund McMillen Breaks Down His Game Design History (Meat Boy, Binding of Isaac) [video]

https://www.youtube.com/watch?v=_97zYunu2w0
1•ydnaclementine•16m ago•0 comments

Show HN: I built new type of dev environment for agentic coding

https://github.com/stravu/crystal
2•jbentley1•17m ago•0 comments

Show HN: Graphtune – A tiny AI-assisted graph algorithm scheduler (with a story)

1•lixiasky•20m ago•0 comments

Future AI processors said to consume up to 15,360 watts of power

https://www.tomshardware.com/pc-components/cooling/future-ai-processors-said-to-consume-up-to-15-360w-massive-power-draw-will-demand-exotic-immersion-and-embedded-cooling-tech
1•speckx•21m ago•0 comments

Powerful solar flare erupts from sun triggering radio blackouts across NA

https://www.space.com/astronomy/sun/powerful-solar-flare-erupts-from-sun-triggering-radio-blackouts-across-north-america-video
2•dontTREATonme•22m ago•0 comments

Show HN: I built a web app to edit photos with a prompt using Flux Kontext

https://www.theinfluencer.ai/ai-photo-editor
1•zzsshh•23m ago•0 comments

Testing MongoDB in Node with the MongoDB Memory Server

https://blog.appsignal.com/2025/06/18/testing-mongodb-in-node-with-the-mongodb-memory-server.html
1•amalinovic•23m ago•0 comments

GCC, glibc, stack unwinding and relocations – A war story

https://blog.sergiodj.net/posts/gcc-glibc-stack-unwinding-relocations-bug/
1•JNRowe•24m ago•0 comments