outro_rails 0.1.8 → 0.1.9
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/app/views/outro_rails/instruments/_guitar_figure.html.erb +4 -2
- data/app/views/outro_rails/instruments/_guitar_midi.html.erb +4 -2
- data/app/views/outro_rails/instruments/_piano_figure.html.erb +15 -6
- data/app/views/outro_rails/instruments/_piano_midi.html.erb +4 -2
- data/lib/outro_rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: be553169a45e21824a1d92e6287d3777e7bf78839cce188fe86d708d40496f26
|
|
4
|
+
data.tar.gz: 186d0ebf8b817cc88fde9561873e9949ed8f200658c0265f25162cfec56e9471
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9c6dc62087ae7a8a0c7e393ef4ad6767a846205e3fd87a797b6e7c9c6546f0da1c4be21056e48b3a797cb82352f51b057a729a3f828f15b4eb02b3d3ac68adad
|
|
7
|
+
data.tar.gz: 0dce5f67e95e032c29638e1da8799b626482f37efebb60ff7ec1daf678992732b54c42fbe34a1b30dd86a0e5ce17633e61b24b9d8a0d4b311bf6e83f97e94a35
|
|
@@ -36,12 +36,14 @@
|
|
|
36
36
|
highlight_frets = guitar_positions(
|
|
37
37
|
Array(local_assigns.fetch(:highlight_frets, [])).select(&complete)
|
|
38
38
|
)
|
|
39
|
-
highlight_color = local_assigns.fetch(:highlight_color,
|
|
39
|
+
highlight_color = local_assigns.fetch(:highlight_color,
|
|
40
|
+
"var(--outro-accent, #2f6bed)")
|
|
40
41
|
root_frets = guitar_positions(
|
|
41
42
|
Array(local_assigns.fetch(:root_frets, [])).select(&complete)
|
|
42
43
|
)
|
|
43
44
|
highlight_frets |= root_frets
|
|
44
|
-
root_color = local_assigns.fetch(:root_color,
|
|
45
|
+
root_color = local_assigns.fetch(:root_color,
|
|
46
|
+
"var(--outro-root, #d1495b)")
|
|
45
47
|
prefer = local_assigns.fetch(:prefer, "sharps").to_sym
|
|
46
48
|
|
|
47
49
|
open_midis = guitar_open_midis(tuning) # { 1 => 64, ..., 6 => 40 }
|
|
@@ -29,9 +29,11 @@
|
|
|
29
29
|
default_tuning = OutroRails::InstrumentsHelper::GUITAR_STANDARD_TUNING
|
|
30
30
|
tuning = local_assigns.fetch(:tuning, default_tuning)
|
|
31
31
|
highlight_frets = guitar_positions(local_assigns.fetch(:highlight_frets, []))
|
|
32
|
-
highlight_color = local_assigns.fetch(:highlight_color,
|
|
32
|
+
highlight_color = local_assigns.fetch(:highlight_color,
|
|
33
|
+
"var(--outro-accent, #2f6bed)")
|
|
33
34
|
root_frets = guitar_positions(local_assigns.fetch(:root_frets, []))
|
|
34
|
-
root_color = local_assigns.fetch(:root_color,
|
|
35
|
+
root_color = local_assigns.fetch(:root_color,
|
|
36
|
+
"var(--outro-root, #d1495b)")
|
|
35
37
|
prefer = local_assigns.fetch(:prefer, 'sharps')
|
|
36
38
|
|
|
37
39
|
start_fret, end_fret = end_fret, start_fret if start_fret > end_fret
|
|
@@ -18,9 +18,11 @@
|
|
|
18
18
|
start_note = local_assigns.fetch(:start_note, nil).presence || "C3"
|
|
19
19
|
end_note = local_assigns.fetch(:end_note, nil).presence || "C5"
|
|
20
20
|
highlight_keys = Array(local_assigns.fetch(:highlight_keys, []))
|
|
21
|
-
highlight_color = local_assigns.fetch(:highlight_color,
|
|
21
|
+
highlight_color = local_assigns.fetch(:highlight_color,
|
|
22
|
+
"var(--outro-accent, #2f6bed)")
|
|
22
23
|
root_keys = Array(local_assigns.fetch(:root_keys, []))
|
|
23
|
-
root_color = local_assigns.fetch(:root_color,
|
|
24
|
+
root_color = local_assigns.fetch(:root_color,
|
|
25
|
+
"var(--outro-root, #d1495b)")
|
|
24
26
|
prefer = local_assigns.fetch(:prefer, "sharps").to_sym
|
|
25
27
|
|
|
26
28
|
keys = piano_keys_between(start_note, end_note, prefer: prefer)
|
|
@@ -29,6 +31,8 @@
|
|
|
29
31
|
|
|
30
32
|
white_w, white_h = 14, 46 # viewBox units
|
|
31
33
|
black_w, black_h = 8.5, 28
|
|
34
|
+
stroke_w = 0.75
|
|
35
|
+
pad = stroke_w / 2.0
|
|
32
36
|
|
|
33
37
|
whites = []
|
|
34
38
|
blacks = []
|
|
@@ -60,23 +64,28 @@
|
|
|
60
64
|
else
|
|
61
65
|
"Piano keyboard from #{start_note} to #{end_note}"
|
|
62
66
|
end
|
|
67
|
+
|
|
68
|
+
width = [white_index, 1].max * white_w
|
|
69
|
+
vb_w = width + (pad * 2)
|
|
70
|
+
vb_h = white_h + (pad * 2)
|
|
63
71
|
%>
|
|
64
72
|
|
|
65
73
|
<svg class="outro-figure__svg outro-figure__svg--piano"
|
|
66
|
-
viewBox="
|
|
67
|
-
width="<%= (
|
|
74
|
+
viewBox="<%= -pad %> <%= -pad %> <%= vb_w %> <%= vb_h %>"
|
|
75
|
+
width="<%= (vb_w * 0.9).round %>"
|
|
76
|
+
height="<%= (vb_h * 0.9).round %>"
|
|
68
77
|
role="img"
|
|
69
78
|
aria-label="<%= label %>">
|
|
70
79
|
<% whites.each do |key| %>
|
|
71
80
|
<rect x="<%= key[:x] %>" y="0"
|
|
72
81
|
width="<%= white_w %>" height="<%= white_h %>"
|
|
73
82
|
rx="1.5" fill="<%= fill_for.call(key) %>"
|
|
74
|
-
stroke="#444444" stroke-width="
|
|
83
|
+
stroke="#444444" stroke-width="<%= stroke_w %>" />
|
|
75
84
|
<% end %>
|
|
76
85
|
<% blacks.each do |key| %>
|
|
77
86
|
<rect x="<%= key[:x] %>" y="0"
|
|
78
87
|
width="<%= black_w %>" height="<%= black_h %>"
|
|
79
88
|
rx="1.5" fill="<%= fill_for.call(key) %>"
|
|
80
|
-
stroke="#111111" stroke-width="
|
|
89
|
+
stroke="#111111" stroke-width="<%= stroke_w %>" />
|
|
81
90
|
<% end %>
|
|
82
91
|
</svg>
|
|
@@ -21,9 +21,11 @@
|
|
|
21
21
|
start_note = local_assigns.fetch(:start_note, "C3")
|
|
22
22
|
end_note = local_assigns.fetch(:end_note, "C5")
|
|
23
23
|
highlight_keys = Array(local_assigns.fetch(:highlight_keys, []))
|
|
24
|
-
highlight_color = local_assigns.fetch(:highlight_color,
|
|
24
|
+
highlight_color = local_assigns.fetch(:highlight_color,
|
|
25
|
+
"var(--outro-accent, #2f6bed)")
|
|
25
26
|
root_keys = Array(local_assigns.fetch(:root_keys, []))
|
|
26
|
-
root_color = local_assigns.fetch(:root_color,
|
|
27
|
+
root_color = local_assigns.fetch(:root_color,
|
|
28
|
+
"var(--outro-root, #d1495b)")
|
|
27
29
|
prefer = local_assigns.fetch(:prefer, 'sharps').to_sym
|
|
28
30
|
|
|
29
31
|
keys = piano_keys_between(start_note, end_note, prefer: prefer)
|
data/lib/outro_rails/version.rb
CHANGED