Coder Social home page Coder Social logo

guitarchords's Introduction

guitarchords

Generator for guitar chord diagrams

Example of diagram for Cadd9 chord

Web interface: https://swords.id.au/guitarchords/

This is a Python module, CLI program and website for generating guitar chord diagrams.

It uses an SVG template, and produces a PNG diagram for a given chord fingering definition.

The repository comes with a default template and chord definition list, but you are free to modify the template and/or the chords, or create your own from scratch.

Command-line program

Usage

generate_chord_diagrams.py [-t TEMPLATE_FILE] [-f CHORDS_FILE] [-d OUTPUT_DIR]

By default, generate_chord_diagrams.py will expect to find an SVG template file named chord_base.svg in the current directory, and to receive a YAML chord definition document on standard input. It will write out the generated chord diagrams as SVG to a directory named build/. All of these defaults can be overridden with command-line arguments.

Dependencies

  • Python 3
  • pyyaml pip package
  • Inkscape or similar, if you want to export the diagrams to raster format

Installation

Copy generate_chord_diagrams.py (and optionally chord_base.svg and chords.yaml) to your computer.

Chord definition format

Chords are defined as objects with two required properties:

  • name
  • strings

The string property must be a list of strings from highest pitch to lowest pitch. Each string should be one of the following values:

  • An open string, indicated by uppercase letter O
  • A muted string, indicated by uppercase letter X
  • A fretted string, indicated by a 2-element list of the finger number, followed by the fret number.

Fingers are numbered from the index finger as 1, to the little finger as 4. The thumb is indicated with uppercase letter T.

For example, the Cadd9 chord defined in YAML is:

- name: Cadd9
  strings:
    - [4, 3]
    - [3, 3]
    - O
    - [1, 2]
    - [2, 3]
    - X

This has the meaning:

  • The first string (the high E string) is fretted with the fourth finger on the third fret.
  • The second string (B) is fretted with the third finger on the third fret.
  • The third string (G) is played open.
  • The fourth string (D) is fretted with the first finger on the second fret.
  • The fifth string (A) is fretted with the second finger on the third fret.
  • The sixth string (low E) is muted.

Website

gcdg

https://swords.id.au/guitarchords/

This is a Python Flask web application, with Semantic UI for styling.

The site features presets for a range of common chords, as well as the ability to create a custom chord fingering and generate a diagram for it.

Credits

Written by Brendan Jurd

guitarchords's People

Contributors

direvus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.