fretboards 0.0.5 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/fretboards_render +82 -7
- data/fretboards.gemspec +1 -0
- data/lib/fretboards/version.rb +1 -1
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8f38b4dde148fa6891ffe83e6013de5f53a405a5107bac0b0ede0c20fd4bc0d
|
4
|
+
data.tar.gz: 319ff9148fa863aeb67adceae38bc76287098919c85566e3b1e51276f5b2d7cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87ac886d83ec05402278f8377751e127d3c25948ae388131dac81e42664061e30a646a83cb80290c6c78179743f217a68393aaaf38425ca0eb257cc082ab22f7
|
7
|
+
data.tar.gz: 6d4b57ea5aceb769ef23a878818f89966ba03aa8ff0aa5352c9d62970321286c127b9cae9869b40934517e75ddb5fb125d9e70ad7a7c392bfbb16bec7ca3523e
|
data/bin/fretboards_render
CHANGED
@@ -2,12 +2,87 @@
|
|
2
2
|
|
3
3
|
require "fretboards"
|
4
4
|
require "fretboards/renderer/svg"
|
5
|
+
require "docopt"
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
# puts terse.inspect
|
7
|
+
doc = <<DOCOPT
|
8
|
+
Output a SVG fretboard.
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
Usage:
|
11
|
+
#{__FILE__} [options] [<dots>...]
|
12
|
+
#{__FILE__} (--tuning=<tuning> | --guitar | --ukulele) [options] [<dots>...]
|
13
|
+
#{__FILE__} -h | --help
|
14
|
+
#{__FILE__} --version
|
15
|
+
|
16
|
+
Options:
|
17
|
+
--tuning=<tuning> Tuning of the instrument [default: g' c' e' a'].
|
18
|
+
--width=<width> Width of the fretboard [default: 108].
|
19
|
+
--height=<height> Height of the fretboard [default: 180].
|
20
|
+
--fret-count=<fret-count> Number of frets [default: 4].
|
21
|
+
--title=<title> Title of the fretboard [default: ].
|
22
|
+
-h --help Show this screen.
|
23
|
+
--version Show version.
|
24
|
+
|
25
|
+
Arguments:
|
26
|
+
<dots> Dots to be drawn on the fretboard. Defaults to 4 strings and ukulele tuning. Actual tuning pitches are only considered when passing the dot marks as pitches.
|
27
|
+
|
28
|
+
Dots are specified as a sequence of numbers, one per string, starting from 0. Use x for a muted string.
|
29
|
+
|
30
|
+
#{__FILE__} 0 2 1 2
|
31
|
+
|
32
|
+
You can also specify dots as pitches, a to g.
|
33
|
+
|
34
|
+
- Use `is` suffix for sharp, `es` for flat.
|
35
|
+
- Use `'` or `,` for octaves up or down. `c'` is middle C.
|
36
|
+
|
37
|
+
#{__FILE__} aes\\' d\\' f\\' b\\'
|
38
|
+
|
39
|
+
Draw guitar fretboard passing `--guitar` or `--guitar-7`:
|
40
|
+
|
41
|
+
#{__FILE__} --guitar x 3 2 0 1 0
|
42
|
+
|
43
|
+
Use `[` and `]` to indicate barres:
|
44
|
+
|
45
|
+
#{__FILE__} --guitar 1\\[ 3 3 2 1 1\\]
|
46
|
+
|
47
|
+
Mark a dot as root with `!`:
|
48
|
+
|
49
|
+
#{__FILE__} --guitar 3! 2 0 0 3 3
|
50
|
+
|
51
|
+
Annotate fingerings with `-`:
|
52
|
+
|
53
|
+
#{__FILE__} --guitar 3-2 2-1 0 0 3-3 3-4
|
54
|
+
|
55
|
+
To place multiple dots on the same string, use `/`:
|
56
|
+
|
57
|
+
#{__FILE__} --guitar 5/6 8/6 5/5 7/5 5/4 7/4 5/3 7/3 5/2 8/2 5/1 8/1
|
58
|
+
|
59
|
+
Report bugs at https://github.com/choan/fretboards/issues
|
60
|
+
DOCOPT
|
61
|
+
|
62
|
+
begin
|
63
|
+
arguments = Docopt::docopt(doc, version: ::Fretboards::VERSION)
|
64
|
+
rescue Docopt::Exit => e
|
65
|
+
puts e.message
|
66
|
+
exit
|
67
|
+
end
|
68
|
+
|
69
|
+
if arguments['--guitar']
|
70
|
+
arguments['--tuning'] = "e, a, d g b e'"
|
71
|
+
elsif arguments['--guitar-7']
|
72
|
+
arguments['--tuning'] = "b,, e, a, d g b e'"
|
73
|
+
elsif arguments['--ukulele']
|
74
|
+
arguments['--tuning'] = "g' c' e' a'"
|
75
|
+
end
|
76
|
+
|
77
|
+
terse = arguments['<dots>']
|
78
|
+
tuning = arguments['--tuning'].split(' ')
|
79
|
+
title = arguments['--title']
|
80
|
+
width = arguments['--width'].to_i
|
81
|
+
height = arguments['--height'].to_i
|
82
|
+
fret_count = arguments['--fret-count'].to_i
|
83
|
+
|
84
|
+
fb = Fretboards::Fretboard.new(:tuning => tuning)
|
85
|
+
fb.title = title unless title.empty?
|
86
|
+
fb.terse(terse)
|
87
|
+
renderer = Fretboards::Renderer::Svg.new(width: width, height: height, fret_count: fret_count)
|
88
|
+
puts renderer.render(fb)
|
data/fretboards.gemspec
CHANGED
data/lib/fretboards/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fretboards
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Choan Galvez
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: docopt
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.6.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.6.0
|
27
41
|
description: Allows defining instrument fretboard structures and representing them
|
28
42
|
as highly customizable SVG graphics.
|
29
43
|
email:
|
@@ -57,7 +71,7 @@ homepage: ''
|
|
57
71
|
licenses:
|
58
72
|
- MIT
|
59
73
|
metadata: {}
|
60
|
-
post_install_message:
|
74
|
+
post_install_message:
|
61
75
|
rdoc_options: []
|
62
76
|
require_paths:
|
63
77
|
- lib
|
@@ -72,8 +86,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
86
|
- !ruby/object:Gem::Version
|
73
87
|
version: '0'
|
74
88
|
requirements: []
|
75
|
-
rubygems_version: 3.
|
76
|
-
signing_key:
|
89
|
+
rubygems_version: 3.2.3
|
90
|
+
signing_key:
|
77
91
|
specification_version: 4
|
78
92
|
summary: Define and draw fretboards
|
79
93
|
test_files:
|