{"id":13753960,"url":"https://github.com/cardonabits/haxo-hw","last_synced_at":"2025-05-09T21:36:35.025Z","repository":{"id":39364511,"uuid":"364542979","full_name":"cardonabits/haxo-hw","owner":"cardonabits","description":"Haxophone, an electronic musical instrument that resembles a saxophone","archived":false,"fork":false,"pushed_at":"2025-02-24T11:17:07.000Z","size":36263,"stargazers_count":634,"open_issues_count":4,"forks_count":18,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-05-05T17:09:51.338Z","etag":null,"topics":["diy","electronics","kicad","pcb","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"XSLT","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cardonabits.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-05T10:42:57.000Z","updated_at":"2025-03-27T18:47:42.000Z","dependencies_parsed_at":"2023-09-24T12:27:14.739Z","dependency_job_id":"e15608fe-a4b7-4f73-9769-0cf3a79bba3a","html_url":"https://github.com/cardonabits/haxo-hw","commit_stats":null,"previous_names":["cardonabits/haxo-hw"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cardonabits%2Fhaxo-hw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cardonabits%2Fhaxo-hw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cardonabits%2Fhaxo-hw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cardonabits%2Fhaxo-hw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cardonabits","download_url":"https://codeload.github.com/cardonabits/haxo-hw/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253329090,"owners_count":21891575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diy","electronics","kicad","pcb","raspberry-pi"],"created_at":"2024-08-03T09:01:35.768Z","updated_at":"2025-05-09T21:36:35.018Z","avatar_url":"https://github.com/cardonabits.png","language":"XSLT","funding_links":[],"categories":["XSLT"],"sub_categories":[],"readme":"## Table of Contents\n\n\u003c!-- toc --\u003e\n\n- [What is a haxophone](#what-is-a-haxophone)\n- [Project Goals](#project-goals)\n  * [Goals](#goals)\n  * [Non-Goals](#non-goals)\n- [How does it work?](#how-does-it-work)\n- [Mechanical Design](#mechanical-design)\n- [Electrical Design](#electrical-design)\n  * [Keyboard](#keyboard)\n  * [Audio Amplifier](#audio-amplifier)\n  * [Pinout](#pinout)\n- [Tools/Stack](#toolsstack)\n- [Software](#software)\n- [Manufacturing](#manufacturing)\n- [Bill of Materials](#bill-of-materials)\n- [Assembly Instructions](#assembly-instructions)\n- [TODO list](#todo-list)\n- [License and Contributions](#license-and-contributions)\n- [Acknowledgements](#acknowledgements)\n\n\u003c!-- tocstop --\u003e\n\n## What is a haxophone\n\nA haxophone is an electronic musical instrument that resembles a saxophone.\nIt is designed to be an inexpensive and fully customizable travel saxophone.\nYou will never get the same expressiveness or depth of sound of a real\nsaxophone.  But with a haxophone you should be able to play alone or with\nfriends wherever you might be.  The mechanical keys and unique ergonomics give\nit a different kind of satisfying feel.\n\nhttps://user-images.githubusercontent.com/676181/133919454-f654cb48-cca9-4b6e-bcb5-27de6ea2deb8.mp4\n\nThe design is fully open, software and hardware.  This means that you can make\nit your own, from changing the type of key switches to making your own note and\ninstrument mappings.\n\n![Haxophone Prototype v0.5](docs/images/haxophone-main.png)\n![Haxophone Prototype v0.5](docs/images/haxophone-black.png)\n\n## Project Goals\n\n### Goals\n\n1. Build a travel saxophone that is fun and satisfying to play.\n2. Build an instrument with the same fingering as a saxophone so that muscle\n   memory developed on the haxophone is directly transferrable to your main\nhorn.\n3. Keep the cost low, below $100 USD.\n4. Easy to manufacture.\n5. Keep the design simple, sturdy and repairable to minimize maintenance cost.\n   Using widely available and battle-tested mechanical keys from computer\nkeyboards is one example of this principle in use.\n6. Fully hackable and customizable.\n\n### Non-Goals\n\n1. A haxophone is not designed to be a saxophone replacement.\n\n## How does it work?\n\nThe haxophone is designed as a HAT (Hardware Attached on Top) for the Raspberry\nPi family of single-board computers.\n\nThe haxophone HAT is a special type of keyboard laid out in the same way as\nsaxophones are.  It also includes a mouthpiece and a pressure sensor to detect\nbreath intensity.  The HAT also includes an audio amplifier so it does not rely\non the amplifier that is built into the [Raspberry Pi\n3](https://www.raspberrypi.org/products/raspberry-pi-3-model-b-plus/) and\n[Raspberry Pi 4](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/).\nBecause of that, the HAT will also work with the least expensive of the Pi's,\nthe [Raspberry Pi\nZero](https://www.raspberrypi.org/products/raspberry-pi-zero/).\n\n![Block Diagram](docs/images/block-diagram.png)\n\nThe software that runs on the Raspberry Pi is:\n\n1. [haxo-rs](https://github.com/jcard0na/haxo-rs):  This is the driver that\n   detects key presses, breath and converts it into notes.  It's written in\n   Rust, and compiled on the Raspberry Pi into a native application.\n2. [fluidsynth](https://github.com/FluidSynth/fluidsynth):  This is the\n   synthesizer software that will convert notes into sounds.\n\n\n## Mechanical Design\n\nIn order to keep costs down, the HAT PCB (printed circuit board) is an integral\npart of the physical structure of the Haxophone.  This means that key switches,\nthumb rests, mouthpiece and the Raspberry Pi are all attached directly to the\nPCB.  The side keys (left palm and right knuckle keys) are mounted on smaller\nPCBs and attached to the main PCB via right angle metal brackets.  This smaller\nPCBs are detachable pannels from the design.  This brings down the\nmanufacturing cost.\n\n![renders](docs/images/renders.png)\n\n![renders](docs/images/haxophone-pcb.png)\n\nFor improved ergonomics, a few parts are designed to be 3D printed.  These are\nthe mouthpiece neck, the left thumb rest, and the right thumb rest, that also\nincorporates a strap hook.  The source 3D models for those parts are included\nin the repository.\n\n![3dparts](docs/images/3dparts.png)\n\n## Electrical Design\n\nThe haxophone hat is comprised of three subsystems:  a keyboard, a pressure\nsensor and an audio amplifier.\n\n### Keyboard\n\nThe keyboard is organized as a 3x8 matrix.  The diagram below shows the mapping\nfrom saxophone keys to keyboard column/row values.\n\n![matrix](docs/images/fingering-matrix.png)\n\nNote that due to PCB size constraints, a design decision was made to not\ninclude a high F# key.  This key is not present in all saxophones, as that\nnote can be played using alternate fingerings with other keys.  The most common\nmappings of the high F# are already configured on the haxophone.  If you are\nused to a less common configuration, the software is easy to extend.\n\nAlso note that at the moment the matrix is not completely used:  keys (col 0,\nrow 7) and (col 2, row 3) are unused.\n\n### Audio Amplifier\n\nThe haxophone HAT includes an audio amplifier and a 3.5mm mini-jack.  This\nallows connecting the haxophone to headphones or to an external amplifier.\n\n### Pinout\n\nThe diagram below shows how the HAT connects to the Raspberry Pi.  The keyboard\nmatrix uses discrete GPIOs, the pressure sensor uses I2C and the audio\namplifier, I2S.\n\n![](docs/images/hat-pinout.png)\n\nYou can refer to the diagram below from Raspberry Pi Spy if you need to locate\nthose pins on the Raspberry Pi header.\n![](https://www.raspberrypi-spy.co.uk/wp-content/uploads/2012/06/Raspberry-Pi-GPIO-Header-with-Photo.png)\n\n## Tools/Stack\n\nThe circuit board is designed with awesome [Kicad](https://www.kicad.org/).\n\nAll 3D models are designed with [Freecad](https://www.freecadweb.org/), the\nopen source 3D parametric modeler.\n\nThe code is written in [Rust](https://www.rust-lang.org) just for the pleasure\nand reliability of it.\n\n## Software\n\nSee [haxo-rs](https://github.com/jcard0na/haxo-rs) for details about the software that runs on all Raspberry Pis.\n\nAlternatively, you can explore [haxo-ino](https://github.com/langeroo/haxo-ino), a port of `haxo-rs` for [RP2040 boards](https://www.waveshare.com/rp2040-pizero.htm).  When using this board the audio port of the Haxophone will be disabled and notes will only be sent out as MIDI.  However, if your intent is to use the Haxophone exclusively as a MIDI Controller, this approach has some advantages:\n  * Lower USB latency: while we lack precise data, haxo-ino likely achieves better latency by not running Linux, thereby avoiding the associated USB overhead.\n  * Very fast boot: `haxo-ino` boots in less than 2s, which is way faster, than `haxo-rs`, even on the fastest Pi.\n  * Better connector:  the rp2040-pizero uses a type-C USB connector, which is just better than Micro USB used on the Pi's.\n\n## Manufacturing\n\nThe circuit boards were manufactured by JLPCB, who also assembled the surface mount parts.\n\n## Bill of Materials\n\nThe table below shows the main parts required to build a full Haxophone.  Prices are rough estimates based on purchases made for prototypes.  Shipping costs or taxes not included.\n\n| Qty | Part Description | Manufacturer | MPN | Supplier | Estimated cost USD (at quantity 5) |\n| :--- | :---        |     :---:      |          :---: |  :---: | ---: |\n| 1 | Partially-assembled Haxo HAT PCB (small SMD parts populated) | N/A | N/A | Several  | $15 |\n| 1 | Differential pressure SMD sensor | NXP | MPXV7007DP | Arrow |  ~$10~ Post-Covid: $24     |\n| 1 | Set of 3D printed parts | N/A | N/A | Several  | $4 |\n| 1 | 30cm Food grade Silicon Tube ID:3mm/OD:6mm | JUNZHIDA | N/A | Amazon | $2 |\n| 22 | Tactile-feedback 5-pin mechanical switches | Cherry MX | MX-Brown | Banggood | $11 |\n| 22 | Keycaps For Mechanical Keyboards | [Many options!](https://esckeyboard.com/) |  | | $10  |\n| 2 | 4-pin 0.1in Pin Header Con Right Angle | Samtec | TSW-102-25-T-D-RA | Arrow | $2 |\n| 2 | 4-pin 0.1in Pin Socket Con Straight |  TE Connectivity | 215309-2 | Arrow | $2 |\n| 1 | 40-pin 0.1in Pin Header Connector | TE Connectivity | 2-535542-0 |  Arrow | $2 |\n| 6 | Mounting Bracket L-shape | Keystone | 612 | Mouser | $1.5 |\n| 18 | 4-40 1/4 screws and nuts stainless | Keystone | 9900, 4694 | Mouser | $1 |\n| 4 | M2/7mm machine screws flat head stainless | Master-Carr | 92010A003 | Master-Carr | $0.5 |\n| 3 | 7/16in aluminum spacers | Fascomp | FC1636-440-A | Mouser | $1 |\n| 1 | Sax Mouthpiece + Reed | N/A | N/A | N/A | Bring your own (but optional) |\n| 1 | Neck Strap | N/A | N/A | N/A | Bring your own (but optional) |\n| 1 | Raspberry Pi Zero | Broadcom | Raspberry Pi Zero | Many | $5 |\n| 1 | 16 GB SD Card | Many | N/A | Many | $6 |\n| ~**Total**~ | | | | | ~**$73**~ (Pre-Covid) |\n| **Total** | | | | | **$97** (Post-Covid) |\n\n## Assembly Instructions\n\nSee [Assembly Guide](docs/assembly.md)\n\n## TODO list\n\nIf you would like to help claim one of [the open issues](https://github.com/jcard0na/haxo-hw/issues) or [create a new one](https://github.com/jcard0na/haxo-hw/issues/new/choose) for yourself.\nIf you prefer to stay in software land, head out to [the software issues](https://github.com/jcard0na/haxo-rs/issues).\n\n## License and Contributions\n\nSee [License](LICENSE).\nWe'll gladly accept contributions via Pull Requests.  Contributions are\naccepted under the same [License](LICENSE) of the project, as captured in\n[github's terms of\nservice](https://docs.github.com/en/github/site-policy/github-terms-of-service#6-contributions-under-repository-license).\n\nIf you plan to contribute a major feature or improvement, consider posting your proposed design as an issue before implementing it.\n\n## Acknowledgements\n\n[Ben Gonzales](https://gonzos.net/projects) has been a great source of inspiration and encouragement.  His [midi-Sax](https://gonzos.net/projects/midi-wind-controller-building-my-own/) is a great project worth checking out.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcardonabits%2Fhaxo-hw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcardonabits%2Fhaxo-hw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcardonabits%2Fhaxo-hw/lists"}