Show HN: Kord – Python tool for displaying guitar chords/scales on your terminal
github.com
github.com
I'm a self taught programmer who would like to share my fretboard visualization tool to any musicians/developers out there. It takes a root note and a scale/chord type as input and outputs a visual representation of your instrument's fretboard on your terminal along with the positions of corresponding notes. The tool supports several scales, modes, chords, instruments and tunings. Try running it with --help to get you started.
The fretboard.py application is actually part of the larger kord music framework I wrote.
It's a PyPI package that allows to do music theory stuff... feel free to read the kord documentation if you want to know more. If you are only interested in the fretboard tool, just scroll to the end of the README. :)
As the kord project grew in complexity I found myself lacking the time to complete it and ATM it's still a bit rough around the edges. The fretboard.py app is a tool that I regularly use and find extremely useful and I thought it would be cool to share it with the world.
I am creating this thread in the hope of: * letting other players make use of the fretboard tool * gathering feedback from programmers on my coding * gathering feedback from musicians on the music theory behind it * allowing collaboration if anyone is interested
Thanks for checking it out!
* I suspect you may have created the IO lib, bestia, to learn and because is fun, but if you use existing libs like Prompt-Toolkit [1] you can focus more time in the actual app vs infrastructure. Also libs like PT can do a lot of heavy lifting and boring stuff for you like enabling cross platform support (Windows!).
* I saw you used .json for tuning configuration, I guess it is ok but perhaps you could just have the tuning be plain python files? Not sure you gain too much by using JSON here.
* Speaking of json... could be interesting to make the _output_ of the app machine readable. So instead of focusing on pretty ANSI output, how would the app look if it generated the fretboards as pure data? One could then write a program to create ANSI or HTML or SVG and whatnot from the same data.
* There are a ton of music theory libraries out there, perhaps you could get some ideas from those. music21 seems to be interesting in this area (although quite heavy / big) [2].
As for the .json files I thought they would be a good way for non-developer end users to deal with their self created tunings without having to mess with the code itself.
Thanks for the links to the projects, I will try to take a look at them.
JSON is fine IMO
https://raw.githubusercontent.com/synestematic/bestia/master...
I've just had a quick look, and I've already found the fretboard.py app useful. I have a 9-string guitar (low C#, F#, B below the usual strings) which I've never really made much use of, and adding a new tuning to the .json file was easy enough, and straight away I can use it to map things out on the fretboard.
When I get some time, I want to look into using this to produce PDF output for worksheets as it'll be a lot quicker than my current workflow for producing scale diagrams for pupils.
Thanks!
For what it's worth, I agree with you, I find the bass frequencies on even standard-range guitars to not be all that useful. In my own music productions, that part of the spectrum belongs almost entirely to the kick drum & bass guitar. However, once you cut out the low-end mud, the rest of the guitar sounds very good!
I've played a few gigs with it where I've been swapping between bass and guitar and for that it's been great - tbh the first time I did it I was just doing it to wind up the guitarist I was playing with as he was rather conservative about gear selection, and this was the embodiment of everything he despised!
I bought a stick years ago, but could never get to grips with it (I did a year on it, but was still very basic), and I guess the 9 string filled the gap for that sort of thing, without being unplayable for me... Plus I got it for a steal on gumtree here in the UK as the seller had got so annoyed with no shows he sold it dirt cheap.
I can't say I'm nearly as good as I'd like to be, but I've managed to learn enough to track some basslines and chordal parts.
For anyone new to the Chapman Stick, check out http://stick.com . It is a wonderfully quirky musical instrument.
anyways, the main reason to have extra strings is to have a greater range. if you just want to play very low notes, you can downtune a regular six-string guitar pretty far, you could just get a bass, or you could get a baritone guitar for something in between.
here's an example of a riff that uses almost the entire range of an eight-string guitar: https://youtu.be/v9RIJ4XlUPU?t=66
It is interesting to see how similar our approaches to note algebra is. While my project is written in Rust, it looks like we calculate note names in a very similar way [1].
I also really like the way you are handling accidentals - by storing accidentals including double-sharps and double-flats alongside the notes. I am using a global variable which picks between using sharps or flats when showing accidentals - works fine for now but definitely does not cover all use cases. I'll see if your approach can solve some of the problems I've encountered.
Thank you again for sharing, I feel like I learned many useful things from just a cursory glance at Kord. Likewise, I hope you find Harmony Explorer interesting!
[0] https://github.com/tiniuclx/harmony-explorer
[1] https://github.com/tiniuclx/harmony-explorer/blob/master/src...
Those were almost all web-based, with only one fairly limited, somewhat meh command line tool. It's nice to see a more general and extensive command line tool.
I have a project with some similar features, written in Perl: https://github.com/whofferbert/key-mode
Mine has a few other features like progression generators and some tools to show keyboard type instruments as well, but is lacking some of the neat things your tool has, like the pure chord visualizer.
Perhaps when I have some free time, I will try to contribute some progression building logic to your project.
This was an experimental, proof-of-concept project, but some of you here may enjoy it :)
Thanks, I guess!
This is awesome:
>>> n1 = MusicNote('F', '#', 5)
>>> n2 = MusicNote('G', 'b', 5)
>>> n1, n2
(F⁵, G⁵)
>>> n1 == n2
True