chordy 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +3 -0
- data/Gemfile +3 -3
- data/README.rdoc +302 -97
- data/Rakefile +12 -5
- data/VERSION +1 -0
- data/lib/chordy.rb +96 -75
- data/lib/chordy/chord.rb +228 -0
- data/lib/chordy/chords/a.rb +84 -0
- data/lib/chordy/chords/a_sharp.rb +86 -0
- data/lib/chordy/chords/b.rb +83 -0
- data/lib/chordy/chords/c.rb +84 -0
- data/lib/chordy/chords/c_sharp.rb +86 -0
- data/lib/chordy/chords/d.rb +84 -0
- data/lib/chordy/chords/d_sharp.rb +86 -0
- data/lib/chordy/chords/e.rb +84 -0
- data/lib/chordy/chords/f.rb +84 -0
- data/lib/chordy/chords/f_sharp.rb +86 -0
- data/lib/chordy/chords/g.rb +84 -0
- data/lib/chordy/chords/g_sharp.rb +86 -0
- data/lib/chordy/util/section.rb +18 -0
- data/lib/chordy/util/text.rb +7 -0
- data/lib/chordy/util/tuning.rb +113 -0
- data/test/helper.rb +1 -1
- data/test/test_chordy.rb +16 -11
- metadata +25 -24
- data/lib/a_chords.rb +0 -81
- data/lib/a_sharp_chords.rb +0 -83
- data/lib/b_chords.rb +0 -81
- data/lib/c_chords.rb +0 -81
- data/lib/c_sharp_chords.rb +0 -83
- data/lib/chord.rb +0 -193
- data/lib/d_chords.rb +0 -81
- data/lib/d_sharp_chords.rb +0 -83
- data/lib/e_chords.rb +0 -81
- data/lib/f_chords.rb +0 -81
- data/lib/f_sharp_chords.rb +0 -83
- data/lib/g_chords.rb +0 -81
- data/lib/g_sharp_chords.rb +0 -83
- data/lib/section.rb +0 -13
- data/lib/text.rb +0 -11
- data/lib/tuning.rb +0 -109
@@ -0,0 +1,18 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Util
|
4
|
+
|
5
|
+
class Section
|
6
|
+
attr_accessor :separator_length
|
7
|
+
|
8
|
+
def initialize(title="", separator_length=40)
|
9
|
+
@title = title
|
10
|
+
@separator_length = separator_length
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_s
|
14
|
+
title_str = @title.to_s
|
15
|
+
title_str.rjust(title_str.length + 2, "-").ljust(@separator_length, "-")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,113 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Util
|
4
|
+
|
5
|
+
module Tuning
|
6
|
+
|
7
|
+
def is_tuning? tuning
|
8
|
+
Tuning.instance_methods.include? tuning.to_s
|
9
|
+
true
|
10
|
+
end
|
11
|
+
|
12
|
+
def tuning_6_standard
|
13
|
+
["e", "a", "d", "g", "b", "e"]
|
14
|
+
end
|
15
|
+
|
16
|
+
def tuning_6_a
|
17
|
+
["a", "d", "g", "c", "e", "a"]
|
18
|
+
end
|
19
|
+
|
20
|
+
def tuning_6_b
|
21
|
+
["b", "e", "a", "d", "f#", "b"]
|
22
|
+
end
|
23
|
+
|
24
|
+
def tuning_6_c
|
25
|
+
["c", "f", "a#", "d#", "g", "c"]
|
26
|
+
end
|
27
|
+
|
28
|
+
def tuning_6_d
|
29
|
+
["d", "g", "c", "f", "a", "d"]
|
30
|
+
end
|
31
|
+
|
32
|
+
def tuning_6_drop_a
|
33
|
+
["a", "e", "a", "d", "f#", "b"]
|
34
|
+
end
|
35
|
+
|
36
|
+
def tuning_6_drop_c
|
37
|
+
["c", "g", "c", "f", "a", "d"]
|
38
|
+
end
|
39
|
+
|
40
|
+
def tuning_6_drop_d
|
41
|
+
["d", "a", "d", "g", "b", "e"]
|
42
|
+
end
|
43
|
+
|
44
|
+
def tuning_7_standard
|
45
|
+
["b", "e", "a", "d", "g", "b", "e"]
|
46
|
+
end
|
47
|
+
|
48
|
+
def tuning_7_a
|
49
|
+
["a", "d", "g", "c", "f", "a", "d"]
|
50
|
+
end
|
51
|
+
|
52
|
+
def tuning_7_a_sharp
|
53
|
+
["a#", "d#", "g#", "c#", "f#", "a#", "d#"]
|
54
|
+
end
|
55
|
+
|
56
|
+
def tuning_7_c
|
57
|
+
["c", "f", "a#", "d#", "g#", "c", "f"]
|
58
|
+
end
|
59
|
+
|
60
|
+
def tuning_7_d
|
61
|
+
["d", "g", "c", "f", "a#", "d", "g"]
|
62
|
+
end
|
63
|
+
|
64
|
+
def tuning_7_drop_a
|
65
|
+
["a", "e", "a", "d", "f#", "b", "e"]
|
66
|
+
end
|
67
|
+
|
68
|
+
def tuning_7_drop_g
|
69
|
+
["g", "d", "g", "c", "f", "a", "d"]
|
70
|
+
end
|
71
|
+
|
72
|
+
def tuning_7_drop_g_sharp
|
73
|
+
["g#", "d#", "g#", "c#", "f#", "a#", "d#"]
|
74
|
+
end
|
75
|
+
|
76
|
+
def tuning_8_standard
|
77
|
+
["f#", "b", "e", "a", "d", "g", "b", "e"]
|
78
|
+
end
|
79
|
+
|
80
|
+
def tuning_8_a
|
81
|
+
["a", "d", "g", "c", "f", "a", "d", "g"]
|
82
|
+
end
|
83
|
+
|
84
|
+
def tuning_8_e
|
85
|
+
["e", "a", "d", "g", "c", "f", "a", "d"]
|
86
|
+
end
|
87
|
+
|
88
|
+
def tuning_8_f
|
89
|
+
["fb", "bb", "eb", "ab", "db", "gb", "bb", "eb"]
|
90
|
+
end
|
91
|
+
|
92
|
+
def tuning_8_drop_d_sharp
|
93
|
+
["eb", "bb", "eb", "ab", "db", "gb", "bb", "eb"]
|
94
|
+
end
|
95
|
+
|
96
|
+
def tuning_8_drop_e
|
97
|
+
["e", "b", "e", "a", "d", "g", "b", "e"]
|
98
|
+
end
|
99
|
+
|
100
|
+
alias :tuning_standard :tuning_6_standard
|
101
|
+
alias :tuning_a :tuning_6_a
|
102
|
+
alias :tuning_b :tuning_6_b
|
103
|
+
alias :tuning_c :tuning_6_c
|
104
|
+
alias :tuning_d :tuning_6_d
|
105
|
+
alias :tuning_drop_a :tuning_6_drop_a
|
106
|
+
alias :tuning_drop_c :tuning_6_drop_c
|
107
|
+
alias :tuning_drop_d :tuning_6_drop_d
|
108
|
+
alias :tuning_7 :tuning_7_standard
|
109
|
+
alias :tuning_7_a! :tuning_7_a_sharp
|
110
|
+
alias :tuning_7_drop_g! :tuning_7_drop_g_sharp
|
111
|
+
alias :tuning_8_drop_d! :tuning_8_drop_d_sharp
|
112
|
+
end
|
113
|
+
end
|
data/test/helper.rb
CHANGED
@@ -13,7 +13,7 @@ end
|
|
13
13
|
require 'test/unit'
|
14
14
|
require 'shoulda'
|
15
15
|
|
16
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
16
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib', 'chordy'))
|
17
17
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
18
18
|
require 'chordy'
|
19
19
|
|
data/test/test_chordy.rb
CHANGED
@@ -3,14 +3,24 @@
|
|
3
3
|
require 'helper'
|
4
4
|
|
5
5
|
class TestChordy < Test::Unit::TestCase
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
def test_chord
|
7
|
+
Chord.new(:M, 6)
|
8
|
+
end
|
9
|
+
|
10
|
+
should "have methods and constants for all chord flags" do
|
11
|
+
c = test_chord
|
12
|
+
methods = c.methods
|
13
|
+
class_flags = Chord::CHORD_FLAGS
|
10
14
|
consts = Chord.constants
|
11
15
|
|
12
|
-
|
13
|
-
|
16
|
+
# class methods
|
17
|
+
class_flags.each { |f| assert(consts.include?(f.upcase.to_sym), "no constant '#{f}' in Chord") }
|
18
|
+
class_flags.each { |method| assert(methods.include?(method.to_sym), "no class method '#{method}' in Chord") }
|
19
|
+
|
20
|
+
instance_flags = class_flags.select { |c| c!= "dont_play"}.map { |c| "play_" + c.to_s }
|
21
|
+
|
22
|
+
# instance methods
|
23
|
+
instance_flags.each { |method| assert(methods.include?(method.to_sym), "no instance method '#{method}' in Chord") }
|
14
24
|
end
|
15
25
|
|
16
26
|
should "knows all chord types" do
|
@@ -32,11 +42,6 @@ class TestChordy < Test::Unit::TestCase
|
|
32
42
|
end
|
33
43
|
end
|
34
44
|
|
35
|
-
should "know all effects" do
|
36
|
-
# TODO implement
|
37
|
-
true
|
38
|
-
end
|
39
|
-
|
40
45
|
should "have 6,7 or 8 strings" do
|
41
46
|
# TODO implement
|
42
47
|
true
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chordy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: shoulda
|
@@ -92,13 +92,13 @@ dependencies:
|
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: 1.8.4
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
|
-
name:
|
95
|
+
name: jekyll
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
97
97
|
none: false
|
98
98
|
requirements:
|
99
99
|
- - ! '>='
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
101
|
+
version: 0.11.2
|
102
102
|
type: :development
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -106,9 +106,9 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
109
|
+
version: 0.11.2
|
110
110
|
- !ruby/object:Gem::Dependency
|
111
|
-
name:
|
111
|
+
name: debugger
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
113
113
|
none: false
|
114
114
|
requirements:
|
@@ -123,7 +123,7 @@ dependencies:
|
|
123
123
|
- - ! '>='
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
|
-
description:
|
126
|
+
description: A Ruby DSL for printing guitar chords diagrams
|
127
127
|
email: akhil.wali.10@gmail.com
|
128
128
|
executables: []
|
129
129
|
extensions: []
|
@@ -136,24 +136,25 @@ files:
|
|
136
136
|
- LICENSE.rdoc
|
137
137
|
- README.rdoc
|
138
138
|
- Rakefile
|
139
|
-
-
|
140
|
-
- lib/a_sharp_chords.rb
|
141
|
-
- lib/b_chords.rb
|
142
|
-
- lib/c_chords.rb
|
143
|
-
- lib/c_sharp_chords.rb
|
144
|
-
- lib/chord.rb
|
139
|
+
- VERSION
|
145
140
|
- lib/chordy.rb
|
141
|
+
- lib/chordy/chord.rb
|
142
|
+
- lib/chordy/chords/a.rb
|
143
|
+
- lib/chordy/chords/a_sharp.rb
|
144
|
+
- lib/chordy/chords/b.rb
|
145
|
+
- lib/chordy/chords/c.rb
|
146
|
+
- lib/chordy/chords/c_sharp.rb
|
147
|
+
- lib/chordy/chords/d.rb
|
148
|
+
- lib/chordy/chords/d_sharp.rb
|
149
|
+
- lib/chordy/chords/e.rb
|
150
|
+
- lib/chordy/chords/f.rb
|
151
|
+
- lib/chordy/chords/f_sharp.rb
|
152
|
+
- lib/chordy/chords/g.rb
|
153
|
+
- lib/chordy/chords/g_sharp.rb
|
154
|
+
- lib/chordy/util/section.rb
|
155
|
+
- lib/chordy/util/text.rb
|
156
|
+
- lib/chordy/util/tuning.rb
|
146
157
|
- lib/chordy_script.rb
|
147
|
-
- lib/d_chords.rb
|
148
|
-
- lib/d_sharp_chords.rb
|
149
|
-
- lib/e_chords.rb
|
150
|
-
- lib/f_chords.rb
|
151
|
-
- lib/f_sharp_chords.rb
|
152
|
-
- lib/g_chords.rb
|
153
|
-
- lib/g_sharp_chords.rb
|
154
|
-
- lib/section.rb
|
155
|
-
- lib/text.rb
|
156
|
-
- lib/tuning.rb
|
157
158
|
- test/helper.rb
|
158
159
|
- test/test_chordy.rb
|
159
160
|
homepage: http://github.com/darth10/chordy
|
@@ -171,7 +172,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
171
172
|
version: '0'
|
172
173
|
segments:
|
173
174
|
- 0
|
174
|
-
hash: -
|
175
|
+
hash: -115352785
|
175
176
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
177
|
none: false
|
177
178
|
requirements:
|
data/lib/a_chords.rb
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'chord'
|
4
|
-
|
5
|
-
class A < Chord
|
6
|
-
def play_major
|
7
|
-
[0, 0, 2, 2, 2, 0]
|
8
|
-
end
|
9
|
-
|
10
|
-
def play_minor
|
11
|
-
[0, 0, 2, 2, 1, 0]
|
12
|
-
end
|
13
|
-
|
14
|
-
def play_dominant_7
|
15
|
-
[0, 0, 2, 0, 2, 0]
|
16
|
-
end
|
17
|
-
|
18
|
-
def play_dominant_7_5
|
19
|
-
[-1, 0, 1, 0, 2, 3]
|
20
|
-
end
|
21
|
-
|
22
|
-
def play_major_6
|
23
|
-
[0, 0, 2, 2, 2, 2]
|
24
|
-
end
|
25
|
-
|
26
|
-
def play_major_7
|
27
|
-
[0, 0, 2, 1, 2, 0]
|
28
|
-
end
|
29
|
-
|
30
|
-
def play_major_9
|
31
|
-
[-1, 2, 2, 2, 2, 3]
|
32
|
-
end
|
33
|
-
|
34
|
-
def play_minor_6
|
35
|
-
[2, 0, 2, 2, 1, 2]
|
36
|
-
end
|
37
|
-
|
38
|
-
def play_minor_7
|
39
|
-
[0, 0, 2, 0, 1, 0]
|
40
|
-
end
|
41
|
-
|
42
|
-
def play_half_diminished_7
|
43
|
-
[-1, 0, 1, 0, 1, 3]
|
44
|
-
end
|
45
|
-
|
46
|
-
def play_minor_major_7
|
47
|
-
[0, 0, 2, 1, 1, 0]
|
48
|
-
end
|
49
|
-
|
50
|
-
def play_augmented_5
|
51
|
-
[1, 0, 3, 2, 2, 1]
|
52
|
-
end
|
53
|
-
|
54
|
-
def play_augmented_7
|
55
|
-
[1, 4, 3, 0, 2, 1]
|
56
|
-
end
|
57
|
-
|
58
|
-
def play_augmented_major_7
|
59
|
-
[-1, 0, -1, 1, 2, 1]
|
60
|
-
end
|
61
|
-
|
62
|
-
def play_diminished_5
|
63
|
-
[5, 6, 7, 5, 4, 5]
|
64
|
-
end
|
65
|
-
|
66
|
-
def play_diminished_7
|
67
|
-
[-1, -1, 1, 2, 1, 2]
|
68
|
-
end
|
69
|
-
|
70
|
-
def play_diminished_9
|
71
|
-
[2, -1, 5, 3, 2, 5]
|
72
|
-
end
|
73
|
-
|
74
|
-
def play_suspended_4
|
75
|
-
[0, 0, 2, 2, 3, 0]
|
76
|
-
end
|
77
|
-
|
78
|
-
def play_suspended_7
|
79
|
-
[0, 0, 2, 0, 3, 0]
|
80
|
-
end
|
81
|
-
end
|
data/lib/a_sharp_chords.rb
DELETED
@@ -1,83 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'chord'
|
4
|
-
|
5
|
-
class ASharp < Chord
|
6
|
-
def play_major
|
7
|
-
[1, 1, 3, 3, 3, 1]
|
8
|
-
end
|
9
|
-
|
10
|
-
def play_minor
|
11
|
-
[1, 1, 3, 3, 2, 1]
|
12
|
-
end
|
13
|
-
|
14
|
-
def play_dominant_7
|
15
|
-
[1, 1, 3, 1, 3, 1]
|
16
|
-
end
|
17
|
-
|
18
|
-
def play_dominant_7_5
|
19
|
-
[0, 1, 2, 1, 3, 4]
|
20
|
-
end
|
21
|
-
|
22
|
-
def play_major_6
|
23
|
-
[1, 1, 3, 3, 3, 3]
|
24
|
-
end
|
25
|
-
|
26
|
-
def play_major_7
|
27
|
-
[1, 1, 3, 2, 3, 1]
|
28
|
-
end
|
29
|
-
|
30
|
-
def play_major_9
|
31
|
-
[-1, 1, 0, 1, 1, 1]
|
32
|
-
end
|
33
|
-
|
34
|
-
def play_minor_6
|
35
|
-
[-1, -1, 3, 3, 2, 3]
|
36
|
-
end
|
37
|
-
|
38
|
-
def play_minor_7
|
39
|
-
[1, 1, 3, 1, 2, 1]
|
40
|
-
end
|
41
|
-
|
42
|
-
def play_half_diminished_7
|
43
|
-
[1, 1, 2, 1, 2, 4]
|
44
|
-
end
|
45
|
-
|
46
|
-
def play_minor_major_7
|
47
|
-
[1, 1, 3, 2, 2, 1]
|
48
|
-
end
|
49
|
-
|
50
|
-
def play_augmented_5
|
51
|
-
[2, -1, 4, 3, 3, 2]
|
52
|
-
end
|
53
|
-
|
54
|
-
def play_augmented_7
|
55
|
-
[-1, 1, 4, 1, 3, 2]
|
56
|
-
end
|
57
|
-
|
58
|
-
def play_augmented_major_7
|
59
|
-
[-1, 1, 0, 2, 3, 2]
|
60
|
-
end
|
61
|
-
|
62
|
-
def play_diminished_5
|
63
|
-
[0, 1, 2, 3, 2, 0]
|
64
|
-
end
|
65
|
-
|
66
|
-
def play_diminished_7
|
67
|
-
[-1, -1, 2, 3, 2, 3]
|
68
|
-
end
|
69
|
-
|
70
|
-
def play_diminished_9
|
71
|
-
[1, 1, 0, 1, 0, 1]
|
72
|
-
end
|
73
|
-
|
74
|
-
def play_suspended_4
|
75
|
-
[1, 1, 1, 3, 4, 1]
|
76
|
-
end
|
77
|
-
|
78
|
-
def play_suspended_7
|
79
|
-
[1, 1, 1, 1, 3, 1]
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
BFlat = ASharp
|