coltrane 3.1.3 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/lib/coltrane/commands/chords.rb +18 -8
- data/lib/coltrane/commands/command.rb +12 -1
- data/lib/coltrane/commands/notes.rb +5 -1
- data/lib/coltrane/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 389f01b2c9f2a783e912534f02c9b0a1506f3c9bb4274f3c08c7e94eb18559d6
|
4
|
+
data.tar.gz: d2550c127ae11b1798559d41195b3905c6481019195e1a634e54386e14e66215
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a5ee68e12b83f27ea1f0da1e74efad208548a6d1376bcc75e828f64c777b24964ac1ce40ee7a9df1e9c9555e3228565335e233938f68231cd656eb64e14057f
|
7
|
+
data.tar.gz: 4b84d5abe27a48bf6dff5942860d16be8ae77b18cccff75f507eee1f5de078a8caac1b31fb7333b83181b08b4a7af44241c9ba7a3f8e63288c397e520edd8add
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -32,18 +32,28 @@ module Coltrane
|
|
32
32
|
|
33
33
|
def on_model
|
34
34
|
case on
|
35
|
-
when :text
|
36
|
-
when :guitar
|
37
|
-
when :ukulele, :ukelele
|
38
|
-
when :bass
|
39
|
-
when :piano
|
40
|
-
when :'guitar-frets'
|
41
|
-
when :'ukulele-frets',
|
35
|
+
when :text then chord
|
36
|
+
when :guitar then Representation::Guitar.find_chords(chord).first(voicings)
|
37
|
+
when :ukulele, :ukelele then Representation::Ukulele.find_chords(chord).first(voicings)
|
38
|
+
when :bass then Representation::Bass.find_notes(chord.notes)
|
39
|
+
when :piano then Representation::Piano.find_notes(chord.notes)
|
40
|
+
when :'guitar-frets' then Representation::Guitar.find_notes(chord.notes)
|
41
|
+
when :'ukulele-frets', :'ukelele-frets' then Representation::Ukulele.find_notes(chord.notes)
|
42
|
+
when /custom_guitar_frets/ then custom_guitar_notes
|
43
|
+
when /custom_guitar/ then custom_guitar_chords.first(voicings)
|
42
44
|
end
|
43
45
|
end
|
44
46
|
|
47
|
+
def custom_guitar_notes
|
48
|
+
Representation::Guitar::NoteSet.new(chord.notes, guitar: custom_guitar)
|
49
|
+
end
|
50
|
+
|
51
|
+
def custom_guitar_chords
|
52
|
+
Representation::Guitar::Chord.find(chord, guitar: custom_guitar)
|
53
|
+
end
|
54
|
+
|
45
55
|
def layout_horizontal?
|
46
|
-
|
56
|
+
on.to_s =~ /guitar|ukulele|ukelele|bass|piano/
|
47
57
|
end
|
48
58
|
|
49
59
|
def renderer_options
|
@@ -5,7 +5,9 @@ module Coltrane
|
|
5
5
|
on: [
|
6
6
|
'--on <INSTRUMENT>',
|
7
7
|
'Shows the notes on the given instrument/representation type. ' \
|
8
|
-
'Can be piano, guitar, ukulele, bass
|
8
|
+
'Can be text, piano, guitar, ukulele, bass.' \
|
9
|
+
'You can also provide a custom guitar using the following format:' \
|
10
|
+
'--on custom_guitar=D2-A3-D3-B3-C3'
|
9
11
|
],
|
10
12
|
|
11
13
|
flavor: [
|
@@ -21,6 +23,15 @@ module Coltrane
|
|
21
23
|
]
|
22
24
|
}
|
23
25
|
|
26
|
+
def custom_guitar
|
27
|
+
on
|
28
|
+
.to_s
|
29
|
+
.split('=')
|
30
|
+
.fetch(1)
|
31
|
+
.split('-')
|
32
|
+
.yield_self { |tuning| Representation::Guitar.new(tuning: tuning) }
|
33
|
+
end
|
34
|
+
|
24
35
|
def render
|
25
36
|
puts "\n" + Renderers::TextRenderer.render(
|
26
37
|
representation, **renderer_options
|
@@ -21,7 +21,7 @@ module Coltrane
|
|
21
21
|
|
22
22
|
def on_model
|
23
23
|
case on.to_sym
|
24
|
-
when
|
24
|
+
when /custom_guitar/ then custom_guitar_notes
|
25
25
|
when :guitar then Representation::Guitar.find_notes(notes)
|
26
26
|
when :ukulele, :ukelele then Representation::Ukulele.find_notes(notes)
|
27
27
|
when :bass then Representation::Bass.find_notes(notes)
|
@@ -29,6 +29,10 @@ module Coltrane
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
+
def custom_guitar_notes
|
33
|
+
Representation::Guitar::NoteSet.new(notes, guitar: custom_guitar)
|
34
|
+
end
|
35
|
+
|
32
36
|
def self.mercenary_init(program)
|
33
37
|
program.command(:notes) do |c|
|
34
38
|
c.alias(:note)
|
data/lib/coltrane/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coltrane
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pedro Maciel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-reader
|