Project

jamming

0.0
No commit activity in last 3 years
No release in over 3 years
A Ruby library to generate images of guitar chords
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0.0
~> 1.5.1
>= 0

Runtime

 Project Readme

jamming

Jamming is a Ruby library to generate images of guitar chords.

Installation

gem install jamming

or if you are using Bundler, add this line to your Gemfile:

gem "jamming"

Usage

File.open("/tmp/old_good_jimi.png", 'w') do |f|
   chord = Jamming::Chord.new("0-7-6-7-8-x")
   f.write chord.to_png(:label => "Em7#9")
end

This will write Em7#9, The Jimi Hendrix Chord, to /tmp/old_good_jimi.png:

Em7#9 - The Jimi Hendrix Chord

Auto labels

Jamming has an internal database with some chords that lets her auto-identify some chords. So, for example:

 File.open("/tmp/a_major.png", 'w') do |f|
     chord = Jamming::Chord.new("x-0-2-2-2-0")
     f.write chord.to_png
 end

will generate an image like this:

A Major

(Notice the A label even if you never explicitly declared it.)

If you'd like to override this behavior, pass :label => false to the to_png method (Use exactly :label => false, as :label => nil still triggers the auto-labeling behavior).

If you find a chord that is not auto-labeled but you'd like it to be, please add it to this file and send a pull request.

Front-end

Jamming is better served with a front-end that takes care of generating the images for you. Check out this tiny Sinatra app that does just that.

Thanks

Some code based on ander/chords, thanks!

Contributing to jamming

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
  • Fork the project
  • Start a feature/bugfix branch
  • Commit and push until you are happy with your contribution
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright

Copyright (c) 2010 Andrés Mejía (Aprender guitarra). See LICENSE.txt for further details.

Other important notes

You suck if you don't play guitar, kthxbai.