#chord #guitar #ascii #cli

app aschord

A command line tool for showing how to play guitar chords

7 releases

Uses old Rust 2015

0.3.4 Nov 1, 2022
0.3.3 Sep 18, 2022
0.2.1 Sep 18, 2022
0.1.0 Sep 17, 2022

#1182 in Command line utilities

21 downloads per month

MIT/Apache

22KB
515 lines

Ascii Chord

A command line tool for showing how to play guitar chords

Usage

For a single chord:

$ aschord get G

This is how you play 'G' chord: 
     ◯ ◯  
┌─┬─┬─┬─┬─┐
 │ │ │ │ │
├─┼─┼─┼─┼─┤
 ◯ │ │ │ │
├─┼─┼─┼─┼─┤
 │ │ │ │ ◯
└─┴─┴─┴─┴─┘

For multiple chords:

$ aschord list Em Esus4 Asus2 F

Em             Esus4          Asus2          F              
     ◯ ◯ ◯    ◯       ◯ ◯    x ◯     ◯ ◯                   
╒═╤═╤═╤═╤═╕    ╒═╤═╤═╤═╤═╕    ╒═╤═╤═╤═╤═╕    ╒═╤═╤═╤═╤═╕    
 │ │ │ │ │    │ │ │ │ │ │    │ │ │ │ │ │    ◯-------◯-◯    
├─┼─┼─┼─┼─┤    ├─┼─┼─┼─┼─┤    ├─┼─┼─┼─┼─┤    ├─┼─┼─┼─┼─┤    
 ◯ ◯ │ │ │    │ ◯ ◯ ◯ │ │    │ │ ◯ ◯ │ │    │ │ │ ◯ │ │    
├─┼─┼─┼─┼─┤    ├─┼─┼─┼─┼─┤    ├─┼─┼─┼─┼─┤    ├─┼─┼─┼─┼─┤    
 │ │ │ │ │    │ │ │ │ │ │    │ │ │ │ │ │    │ ◯ ◯ │ │ │    
├─┼─┼─┼─┼─┤    ├─┼─┼─┼─┼─┤    ├─┼─┼─┼─┼─┤    ├─┼─┼─┼─┼─┤    
 │ │ │ │ │    │ │ │ │ │ │    │ │ │ │ │ │    │ │ │ │ │ │    
└─┴─┴─┴─┴─┘    └─┴─┴─┴─┴─┘    └─┴─┴─┴─┴─┘    └─┴─┴─┴─┴─┘   

For different ways to play the same chord:

$ aschord list Bm --style full-name

B minor           B minor (no bar)
                  x x             
╒═╤═╤═╤═╤═╕       ╒═╤═╤═╤═╤═╕     
 │ │ │ │ │       │ │ │ │ │ │     
├─┼─┼─┼─┼─┤       ├─┼─┼─┼─┼─┤     
◯-◯-------◯       │ │ │ │ │ ◯     
├─┼─┼─┼─┼─┤       ├─┼─┼─┼─┼─┤     
 │ │ │ ◯ │       │ │ │ │ ◯ │     
├─┼─┼─┼─┼─┤       ├─┼─┼─┼─┼─┤     
 │ ◯ ◯ │ │       │ │ ◯ ◯ │ │     
└─┴─┴─┴─┴─┘       └─┴─┴─┴─┴─┘     

For multiple chords with full names:

$ aschord list Em Esus4 Asus2 F --style full-name

E minor          E suspended 4th  A suspended 2nd  F major    
     ◯ ◯ ◯      ◯       ◯ ◯      x ◯     ◯ ◯                 
╒═╤═╤═╤═╤═╕      ╒═╤═╤═╤═╤═╕      ╒═╤═╤═╤═╤═╕      ╒═╤═╤═╤═╤═╕
 │ │ │ │ │      │ │ │ │ │ │      │ │ │ │ │ │      ◯-------◯-◯
├─┼─┼─┼─┼─┤      ├─┼─┼─┼─┼─┤      ├─┼─┼─┼─┼─┤      ├─┼─┼─┼─┼─┤
 ◯ ◯ │ │ │      │ ◯ ◯ ◯ │ │      │ │ ◯ ◯ │ │      │ │ │ ◯ │ │
├─┼─┼─┼─┼─┤      ├─┼─┼─┼─┼─┤      ├─┼─┼─┼─┼─┤      ├─┼─┼─┼─┼─┤
 │ │ │ │ │      │ │ │ │ │ │      │ │ │ │ │ │      │ ◯ ◯ │ │ │
├─┼─┼─┼─┼─┤      ├─┼─┼─┼─┼─┤      ├─┼─┼─┼─┼─┤      ├─┼─┼─┼─┼─┤
 │ │ │ │ │      │ │ │ │ │ │      │ │ │ │ │ │      │ │ │ │ │ │
└─┴─┴─┴─┴─┘      └─┴─┴─┴─┴─┘      └─┴─┴─┴─┴─┘      └─┴─┴─┴─┴─┘

Changing the style of the output:

$ aschord -f ♥ get G    
This is how you play 'G major' chord: 
     ◯ ◯  
╒═╤═╤═╤═╤═╕
 │ │ │ │ │
├─┼─┼─┼─┼─┤
 ♥ │ │ │ │
├─┼─┼─┼─┼─┤
 │ │ │ │ ♥
├─┼─┼─┼─┼─┤
 │ │ │ │ │
└─┴─┴─┴─┴─┘

For all support chords:

$ aschord all

Also see all supported chords here (auto-generated, do not edit).

Installation

Install local version:

git clone git@github.com:yzhong52/ascii_chord.git
cd ascii_chord
cargo install --path .

Install from https://crates.io/crates/aschord:

cargo install aschord

Development

Build & Run

Show a single chord:

cargo run -- G

Show multiple chords:

cargo run -- list Em Esus4 Asus2 Fm D Am

Show all chords:

cargo run -- all

Unit Tests

cargo test

Release

cargo publish

Dependencies

~1.3–1.9MB
~36K SLoC