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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e7fe6512760c2fefbc46909b4140adcc48af41c
4
- data.tar.gz: d48b7b9bebf1811684896913df9c8dfd2d73b6e1
3
+ metadata.gz: a0a27d74a545668bb4ffca88f0a0c2e1fd8a675b
4
+ data.tar.gz: 9171d6e444e2ace6698377a4d45fe4a13da7f5ec
5
5
  SHA512:
6
- metadata.gz: a7833f4a85b7ce2b075d54c441aa67e06275c4763f3b6b40bef293373d4872908179dfe09c82f4fea3aca876b580abfb83da0e6c0d17ef7dbd24b51cb0fa23cb
7
- data.tar.gz: 7aa0d1c0839f1743b692a3ba39f2cc6402d399810e355ca5b6fcd47285b4ae67e3f56ac7d9ffb8e005e4b99619658fd66d7630d9857b97bd65febd428aca72fc
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
@@ -1,3 +1,4 @@
1
+ add to_tab
1
2
  * Basic ordering
2
3
  * Stretch DONE
3
4
  * Make stretch less all or nothing DONE
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'sergovia'
4
+
5
+ p Sergovia::Chord.new(ARGV.first)
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Sergovia
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
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.1
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-03-31 00:00:00.000000000 Z
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