Giter VIP home page Giter VIP logo

chordimagegenerator's Introduction

Chord Image Generator

Attention!

This is forked from https://github.com/einaregilsson/ChordImageGenerator to keep the project maintained.
The original maintainer passed away sadly, but this fork is still actively maintained.

Chord Image Generator is a small .NET library to generate images of guitar chords. It can display chord boxes, starting frets, barred chords, fingerings and open and muted strings.

Here's a blog post explaining more about the library.

Image of a D Chord Image of a A Chord Image of a A Chord

There is a small example website at https://chordgenerator.luetzners.de where you can try different chords and see how they are constructed. But basically it is just done by constructing the right url, name of the file is the name of the chord, finger positions (p), finger numbers (f) and size (s) are querystring parameters. E.g. the chords above are the following urls:

There is nothing web specific about the actual image generation. It can be saved to any stream so you could just as easily use it in a desktop application.

Using the project

This project has been updated to use .NET Core 6.0. Clone the repository from GitHub, then go into the folder where it is and run:

dotnet restore
dotnet run

That should start a local web server on port 5000, access it as http://localhost:5000/ .

If you're on a Mac you will need to install mono-libgdiplus like this: brew install mono-libgdiplus.

If you're on Linux, you'll need to install libgdiplus, e.g. sudo apt install libgdiplus.

The project should run on a Mac and on Linux but the drawing might not look exactly the same as it does on Windows, because of GDI+ differences.

The source is licensed under the MIT License. You are also free to link directly to chordgenerator.luetzners.de, although I give no guarantees about uptime or reliability.

Running with Docker

You can also run this web server as a Docker container.

docker run -p 5000:80 rluetzner/chordimagegenerator:latest

chordimagegenerator's People

Contributors

rluetzner avatar psifidotos avatar gzur avatar

Stargazers

ksuudilla avatar Kyle Abent avatar Jai Luthra avatar James Pilcher avatar

Watchers

Kyle Abent avatar  avatar Jim Kernicky avatar

chordimagegenerator's Issues

Long chordnames are cut off

Here's an example for F#13b9 (on size 2):
image

It's even worse on size 1:
image

I think ideally, size should refer to the fretboard and give an upper limit for the font size. If the text is too long however, it should shrink to fit neatly on top of the fretboard.

Chordnames do not allow '+' signs

Here is a +2 chord that I'm cutting and pasting from an old tab that I did:
Chord generated with Einar's hosted version

I tried to create the same chord today; and, while it allows me to type the + symbol in the box, to name the chord, this is how it ends up appearing:
Chord generated with chordgenerator.luetzners.de

In addition to trying the + symbol on my keyboard, I even tried alt code 43 (which is the + symbol) as a "work around" but that didn't solve the problem either.

Replace System.Drawing

Since .Net 6.0 the System.Drawing library is Windows-only. For now it works when we build the project with Docker (for whatever reason that is), but it will stop working eventually.

To make this truly platform independent, we should replace System.Drawing with a platform independent library.

I've seen a bunch of options in this StackOverflow answer. I've already looked at a few of these. While there are options that try to bridge the gap between System.Drawing and these newer libraries, none of them seem to support the Bitmap/Graphic algorithm we're using right now to generate the image.

I think in the end, it'll be the best to rewrite the code step by step (e.g. method by method) and compare the new image to the one generated with that part from the old code.

I think we should go with ImageSharp. The API is completely different, but seems pretty intuitive and I like that it's all native .Net code. Although it's a mixed license, Chord Generator falls into the open source category, so we can freely use this library.

Barre chord being wrongly drawn

I think a bug was introduced when enabling the barre option. Previously, if I used this fret position: x46464, it would generate this chord image:

image

Now, enabling the full barre draws this:
image

And disabling it, it draws this:
image

I believe the 6th fret notes should not be drawn as a barre, since in this case it would mean the 3rd string would also be pressed on the 6th fret which is not intended.

Low resolution chords become muddy - the string mute 'x' looks almost like a dot

Chord generated with Einar's hosted service
Chord generated with chordgenerator.luetzners.de

There's an issue regarding the optics of the chords in size 1 (which is what I use); and, that's the look of the X above the strings (that are not to be played).

If you'll observe the chords above, notice you can easily read the X on the low E string of the A+2 chord (which came from an old tab). Note on the A 2 chord, that I created today, the X now appears as a dot. Is this a font issue that can be easily addressed? I think you'll agree the A+2 x's are easier to read, right?

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.