head_music 0.23.2 → 0.23.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb1e01b3119838d06ece395586b5ba1a83d8b432f01d6bc63dfbea324f48be1c
4
- data.tar.gz: 3f6ac1484a66455949d27fe1af7b53e7becdfddaf66093e151d89ad31b31ffa5
3
+ metadata.gz: 0c9d3d90728c4751d6a84e85709800a2afa51eee3f15f21f37dc7ec1a4c9897a
4
+ data.tar.gz: 1d70bf4966c1ffb0cff66468d52a49a52a712b341a5ac9849482c64d5f406988
5
5
  SHA512:
6
- metadata.gz: fa9f404bd1a24082020cf72d0daef7ac68f3b954ab692fec5b3c1f23ecb3a913786550127a9de543b8f88aa0a3370e3c321867cf453ab26cca3cf98ee5b81bfb
7
- data.tar.gz: '08bae5514fb6dc84f35cbaf44b16e8ab001688e379a640c462769e950193fb9b1361a018ef29d8a048e256de535a71fe3796336511f65b6cc6fbad40ab1d9209'
6
+ metadata.gz: 52447f9c047fcf064f5710a833202129bf878971080eb6aab54b0cce8921fb5381fefc999cba7ee8ca3a15de87f9f04843a39eaf1283efeef9516e8c0e92e20e
7
+ data.tar.gz: a4c5039cd26a401e50e83fb53425e9aeae6d134bf0f96d99a84a9b9b1e19ddbb0dcb7bc50e573abb008ee8af7d7373c1a0804ad97116933919dcff86cb625dc1
@@ -5,28 +5,81 @@ class HeadMusic::Clef
5
5
  include HeadMusic::NamedRudiment
6
6
 
7
7
  CLEFS = [
8
- { pitch: 'G4', line: 2, names: %w[treble G-clef], modern: true },
9
- { pitch: 'G4', line: 1, names: ['French', 'French violin'] },
10
- { pitch: 'G3', line: 2, names: ['choral tenor', 'tenor', 'tenor G-clef'], modern: true },
11
-
12
- { pitch: 'F3', line: 3, names: ['baritone'] },
13
- { pitch: 'F3', line: 4, names: %w[bass F-clef], modern: true },
14
- { pitch: 'F3', line: 5, names: ['sub-bass'] },
15
-
16
- { pitch: 'C4', line: 1, names: ['soprano'] },
17
- { pitch: 'C4', line: 2, names: ['mezzo-soprano'] },
18
- { pitch: 'C4', line: 3, names: %w[alto viola counter-tenor countertenor C-clef], modern: true },
19
- { pitch: 'C4', line: 4, names: ['tenor', 'tenor C-clef'], modern: true },
20
- { pitch: 'C4', line: 5, names: ['baritone', 'baritone C-clef'] },
21
-
22
- { pitch: nil, line: 3, names: %w[neutral percussion] },
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::Symbol
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)
@@ -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, :symbol
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: :symbol
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
- @symbol = HeadMusic::Symbol.new(
77
+ @musical_symbol = HeadMusic::MusicalSymbol.new(
78
78
  unicode: attributes[:unicode],
79
79
  ascii: attributes[:ascii],
80
80
  html_entity: attributes[:html_entity]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HeadMusic
4
- VERSION = '0.23.2'
4
+ VERSION = '0.23.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: head_music
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.2
4
+ version: 0.23.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Head