sergovia 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/TODO.md +1 -0
- data/bin/sergovia +5 -0
- data/lib/sergovia/chord.rb +4 -0
- data/lib/sergovia/fingering.rb +12 -0
- data/lib/sergovia/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a0a27d74a545668bb4ffca88f0a0c2e1fd8a675b
|
|
4
|
+
data.tar.gz: 9171d6e444e2ace6698377a4d45fe4a13da7f5ec
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f5bf74100437b1e3762775da4194167543dbaec06c1c62a937058bd8ed0808d6633b53acb76b5a95469620956a8ba3f1b953c87708b2e4a93f4c20db249f0095
|
|
7
|
+
data.tar.gz: 65db3ce9aecfd6e15d5be8a0955376488f1d4e60991582ce03949340ba441c47f10251f8a8f66731c9896bc0569a0578528ca6af2504d5812142593d92baccd4
|
data/README.md
CHANGED
|
@@ -18,7 +18,7 @@ In this example, we ask sergovia how to play the notes of an open E chord. Sergo
|
|
|
18
18
|
@playability=1.0>]
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
Next we'll ask how many ways there are to play a C major triad starting on the lowest C on the standard tuned guitar. We see that there are 8 ways, but that only 3 of those are easily playable. One of them is maybe possible, but very hard. The remaining 4 are unplayable.
|
|
21
|
+
Next we'll ask how many ways there are to play a C major triad in a closed voicing starting on the lowest C on the standard tuned guitar. We see that there are 8 ways, but that only 3 of those are easily playable. One of them is maybe possible, but very hard. The remaining 4 are unplayable.
|
|
22
22
|
|
|
23
23
|
```ruby
|
|
24
24
|
Sergovia::Chord.new('c3,e3,g3').fingerings
|
data/TODO.md
CHANGED
data/bin/sergovia
ADDED
data/lib/sergovia/chord.rb
CHANGED
|
@@ -11,5 +11,9 @@ module Sergovia
|
|
|
11
11
|
def fingerings
|
|
12
12
|
Transcriber.new(tuning: tuning, frets: frets).fingerings(@pitch_string)
|
|
13
13
|
end
|
|
14
|
+
|
|
15
|
+
def to_tab
|
|
16
|
+
fingerings.select{ |f| f.playability > 0.0 }.map(&:to_tab).transpose.map { |string| string.join("--") }.join("\n")
|
|
17
|
+
end
|
|
14
18
|
end
|
|
15
19
|
end
|
data/lib/sergovia/fingering.rb
CHANGED
|
@@ -6,5 +6,17 @@ module Sergovia
|
|
|
6
6
|
@notes = notes
|
|
7
7
|
@playability = playability
|
|
8
8
|
end
|
|
9
|
+
|
|
10
|
+
def to_tab
|
|
11
|
+
(1..6).map do |i|
|
|
12
|
+
@notes.select { |note| note.string == i }.first || Note.new(fret: ' x', string: i, pitch: nil)
|
|
13
|
+
end.sort_by(&:string).map do |note|
|
|
14
|
+
if note.fret == " x"
|
|
15
|
+
note.fret
|
|
16
|
+
else
|
|
17
|
+
"%2d" % note.fret
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
9
21
|
end
|
|
10
22
|
end
|
data/lib/sergovia/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sergovia
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joe Cannatti
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-06-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -56,7 +56,8 @@ description: Sergovia is a Ruby implementation of a simple alogrithm that comput
|
|
|
56
56
|
how playable a chord is on the guitar.
|
|
57
57
|
email:
|
|
58
58
|
- joecannatti@gmail.com
|
|
59
|
-
executables:
|
|
59
|
+
executables:
|
|
60
|
+
- sergovia
|
|
60
61
|
extensions: []
|
|
61
62
|
extra_rdoc_files: []
|
|
62
63
|
files:
|
|
@@ -66,6 +67,7 @@ files:
|
|
|
66
67
|
- README.md
|
|
67
68
|
- Rakefile
|
|
68
69
|
- TODO.md
|
|
70
|
+
- bin/sergovia
|
|
69
71
|
- lib/sergovia.rb
|
|
70
72
|
- lib/sergovia/chord.rb
|
|
71
73
|
- lib/sergovia/fingering.rb
|