forked from ander/chords
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
59 lines (43 loc) · 1.71 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Chords
======
A chord generator lib for guitar-like instruments.
Using via gem (hosted at gemcutter.org)
---------------------------------------
$ sudo gem install chords
$ chords -h
Running irb under chords/lib:
-----------------------------
>> require 'chords'
=> true
>> include Chords
=> Object
>> Fretboard.standard.print E.major, :duplicates => 3, :max_fret_distance => 2
E: --0----0----0----0---12----7----0---12----7--
B: --9----0----0---12---12----9---12---12----9--
G: --9----9----1---13---13----9---13---13----9--
D: --9----9----2---14---14----9---14---14----9--
A: -11---11----2---14---14----7---14---14----7--
E: --0----0----0----0----0----0---12---12----7--
Total 9 fingerings.
=> nil
>>
Forked to work for mandolins?
====== (—kjell, 3/18/2010)
I don't particularly know what I'm doing, but I threw in a new chord finding
algorithm that I like better and I hope isn't completely broken. Tests probably
all fail. I'm using it to find mandolin chords and it's working to my liking.
It doesn't respect the order of the notes, so when you ask for a G.major it
hands back G.major (G, B, D) and what I believe are the first (B, D, G) and
second (D, G, B) inversions. I know nothing of music theory, to me a G chord
is all of the three above. (In fact to me a G chord is the shape my fingers
make starting at a particular spot on the fretboard, helas.)
I'm using it like this:
require 'chords'
include Chords
Fingering::DEFAULT_MAX_FRET_DISTANCE = 7 # Mandolins have teeny frets and 4 strings
DEFAULT_FRETBOARD = mando = Fretboard.new([G.new(1), D.new(1), A.new(2), E.new(3)], 17)
%w[C.major E.major.seventh A.major.seventh D.major.seventh F.major G.major.seventh].each do |c|
puts c
mando.print(eval(c))
puts
end