head_music 0.23.2 → 0.23.3
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/lib/head_music/clef.rb +70 -16
- data/lib/head_music/musical_symbol.rb +1 -1
- data/lib/head_music/sign.rb +3 -3
- data/lib/head_music/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: 0c9d3d90728c4751d6a84e85709800a2afa51eee3f15f21f37dc7ec1a4c9897a
|
|
4
|
+
data.tar.gz: 1d70bf4966c1ffb0cff66468d52a49a52a712b341a5ac9849482c64d5f406988
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 52447f9c047fcf064f5710a833202129bf878971080eb6aab54b0cce8921fb5381fefc999cba7ee8ca3a15de87f9f04843a39eaf1283efeef9516e8c0e92e20e
|
|
7
|
+
data.tar.gz: a4c5039cd26a401e50e83fb53425e9aeae6d134bf0f96d99a84a9b9b1e19ddbb0dcb7bc50e573abb008ee8af7d7373c1a0804ad97116933919dcff86cb625dc1
|
data/lib/head_music/clef.rb
CHANGED
|
@@ -5,28 +5,81 @@ class HeadMusic::Clef
|
|
|
5
5
|
include HeadMusic::NamedRudiment
|
|
6
6
|
|
|
7
7
|
CLEFS = [
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
{
|
|
9
|
+
pitch: 'G4', line: 2,
|
|
10
|
+
names: %w[treble G-clef],
|
|
11
|
+
modern: true,
|
|
12
|
+
unicode: '𝄞', html_entity: '𝄞',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
pitch: 'G4', line: 1,
|
|
16
|
+
names: ['French', 'French violin'],
|
|
17
|
+
unicode: '𝄞', html_entity: '𝄞',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
pitch: 'G3', line: 2,
|
|
21
|
+
names: ['choral tenor', 'tenor', 'tenor G-clef'],
|
|
22
|
+
modern: true,
|
|
23
|
+
unicode: '𝄠', html_entity: '𝄠',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
pitch: 'F3', line: 3,
|
|
27
|
+
names: ['baritone'],
|
|
28
|
+
unicode: '𝄢', html_entity: '𝄢',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
pitch: 'F3', line: 4,
|
|
32
|
+
names: %w[bass F-clef],
|
|
33
|
+
modern: true,
|
|
34
|
+
unicode: '𝄢', html_entity: '𝄢',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
pitch: 'F3', line: 5,
|
|
38
|
+
names: ['sub-bass'],
|
|
39
|
+
unicode: '𝄢', html_entity: '𝄢',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
pitch: 'C4', line: 1,
|
|
43
|
+
names: ['soprano'],
|
|
44
|
+
unicode: '𝄡', html_entity: '𝄡',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
pitch: 'C4', line: 2,
|
|
48
|
+
names: ['mezzo-soprano'],
|
|
49
|
+
unicode: '𝄡', html_entity: '𝄡',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
pitch: 'C4', line: 3,
|
|
53
|
+
names: %w[alto viola counter-tenor countertenor C-clef],
|
|
54
|
+
modern: true,
|
|
55
|
+
unicode: '𝄡', html_entity: '𝄡',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
pitch: 'C4', line: 4,
|
|
59
|
+
names: ['tenor', 'tenor C-clef'],
|
|
60
|
+
modern: true,
|
|
61
|
+
unicode: '𝄡', html_entity: '𝄡',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
pitch: 'C4', line: 5,
|
|
65
|
+
names: ['baritone', 'baritone C-clef'],
|
|
66
|
+
unicode: '𝄡', html_entity: '𝄡',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
pitch: nil, line: 3,
|
|
70
|
+
names: %w[neutral percussion],
|
|
71
|
+
modern: true,
|
|
72
|
+
unicode: '𝄥', html_entity: '𝄥',
|
|
73
|
+
},
|
|
23
74
|
].freeze
|
|
24
75
|
|
|
25
76
|
def self.get(name)
|
|
26
77
|
get_by_name(name)
|
|
27
78
|
end
|
|
28
79
|
|
|
29
|
-
attr_reader :pitch, :line
|
|
80
|
+
attr_reader :pitch, :line, :musical_symbol
|
|
81
|
+
|
|
82
|
+
delegate :ascii, :html_entity, :unicode, to: :musical_symbol
|
|
30
83
|
|
|
31
84
|
def initialize(name)
|
|
32
85
|
@name = name.to_s
|
|
@@ -34,6 +87,7 @@ class HeadMusic::Clef
|
|
|
34
87
|
@pitch = HeadMusic::Pitch.get(clef_data[:pitch])
|
|
35
88
|
@line = clef_data[:line]
|
|
36
89
|
@modern = clef_data[:modern]
|
|
90
|
+
@musical_symbol = HeadMusic::MusicalSymbol.new(clef_data.slice(:ascii, :html_entity, :unicode))
|
|
37
91
|
end
|
|
38
92
|
|
|
39
93
|
def clef_type
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# A symbol is a mark or sign that signifies a particular rudiment of music
|
|
4
|
-
class HeadMusic::
|
|
4
|
+
class HeadMusic::MusicalSymbol
|
|
5
5
|
attr_reader :ascii, :unicode, :html_entity
|
|
6
6
|
|
|
7
7
|
def initialize(ascii: nil, unicode: nil, html_entity: nil)
|
data/lib/head_music/sign.rb
CHANGED
|
@@ -6,7 +6,7 @@ require 'head_music/musical_symbol'
|
|
|
6
6
|
class HeadMusic::Sign
|
|
7
7
|
include Comparable
|
|
8
8
|
|
|
9
|
-
attr_reader :identifier, :cents, :
|
|
9
|
+
attr_reader :identifier, :cents, :musical_symbol
|
|
10
10
|
|
|
11
11
|
def self.all
|
|
12
12
|
@all ||= [
|
|
@@ -66,7 +66,7 @@ class HeadMusic::Sign
|
|
|
66
66
|
cents <=> other.cents
|
|
67
67
|
end
|
|
68
68
|
|
|
69
|
-
delegate :ascii, :html_entity, :unicode, to: :
|
|
69
|
+
delegate :ascii, :html_entity, :unicode, to: :musical_symbol
|
|
70
70
|
|
|
71
71
|
private
|
|
72
72
|
|
|
@@ -74,7 +74,7 @@ class HeadMusic::Sign
|
|
|
74
74
|
@identifier = attributes[:identifier]
|
|
75
75
|
@cents = attributes[:cents]
|
|
76
76
|
|
|
77
|
-
@
|
|
77
|
+
@musical_symbol = HeadMusic::MusicalSymbol.new(
|
|
78
78
|
unicode: attributes[:unicode],
|
|
79
79
|
ascii: attributes[:ascii],
|
|
80
80
|
html_entity: attributes[:html_entity]
|
data/lib/head_music/version.rb
CHANGED