head_music 2.0.0 → 2.0.1
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/TODO.md +1 -0
- data/lib/head_music/chromatic_interval.rb +16 -3
- data/lib/head_music/locales/de.yml +7 -0
- data/lib/head_music/locales/en.yml +21 -0
- data/lib/head_music/locales/es.yml +7 -0
- data/lib/head_music/locales/fr.yml +7 -0
- data/lib/head_music/locales/it.yml +7 -0
- data/lib/head_music/locales/ru.yml +7 -0
- data/lib/head_music/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: c2b4bf3672dec05430ee66153014df39ebd585bdfe683d1269d31f32fb2b6c13
|
4
|
+
data.tar.gz: 4516d7312a57ff182e33620dfb1169761f0d2fe2030979379ecf2412144ca101
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6219c398ddbdf7245fee263e916d299ae518b158883761fb7e89894808fa91142008f66c883007d715625d150806b520cab3e3418d87b955e02d4862c03ad3c8
|
7
|
+
data.tar.gz: 6c67afe62906e12ea8b4c91e2ef27ed99d41b3c501d2999369ed6cd5df9430c9ac5fec4fa1c33d9d1e4b2399930ca0fadcdac4bcbd4842ec433aa1477aaf824d
|
data/TODO.md
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
# A chromatic interval is the distance between two pitches measured in half-steps.
|
4
4
|
class HeadMusic::ChromaticInterval
|
5
5
|
include Comparable
|
6
|
+
include HeadMusic::Named
|
6
7
|
|
7
8
|
private_class_method :new
|
8
9
|
|
9
|
-
# TODO: include the Named module
|
10
10
|
NAMES = %w[
|
11
11
|
perfect_unison minor_second major_second minor_third major_third perfect_fourth tritone perfect_fifth
|
12
12
|
minor_sixth major_sixth minor_seventh major_seventh perfect_octave
|
@@ -21,8 +21,21 @@ class HeadMusic::ChromaticInterval
|
|
21
21
|
@intervals[semitones] ||= new(semitones.to_i)
|
22
22
|
end
|
23
23
|
|
24
|
-
def initialize(
|
25
|
-
|
24
|
+
def initialize(identifier)
|
25
|
+
if identifier.to_s.strip =~ /^\D/i
|
26
|
+
candidate = identifier.to_s.downcase.gsub(/\W+/, "_")
|
27
|
+
semitones = NAMES.index(candidate) || identifier.to_i
|
28
|
+
end
|
29
|
+
@semitones = semitones || identifier.to_i
|
30
|
+
set_name
|
31
|
+
end
|
32
|
+
|
33
|
+
def set_name
|
34
|
+
candidate = semitones
|
35
|
+
while name.nil? && candidate > 0
|
36
|
+
self.name = NAMES[candidate]
|
37
|
+
candidate -= 12
|
38
|
+
end
|
26
39
|
end
|
27
40
|
|
28
41
|
def simple
|
@@ -114,6 +114,13 @@ de:
|
|
114
114
|
voice: Stimme
|
115
115
|
xylophone: Xylophon
|
116
116
|
zither: Zither
|
117
|
+
locales:
|
118
|
+
de: Deutsch
|
119
|
+
en: Englisch
|
120
|
+
es: Spanisch
|
121
|
+
fr: Französisch
|
122
|
+
it: Italienisch
|
123
|
+
ru: Russisch
|
117
124
|
reference_pitches:
|
118
125
|
chamber_tone: Kammerton
|
119
126
|
choir_tone: Chorton
|
@@ -1,4 +1,18 @@
|
|
1
1
|
en:
|
2
|
+
chromatic_intervals:
|
3
|
+
perfect_unison: perfect unison
|
4
|
+
minor_second: minor second
|
5
|
+
major_second: major second
|
6
|
+
minor_third: minor third
|
7
|
+
major_third: major third
|
8
|
+
perfect_fourth: perfect fourth
|
9
|
+
tritone: tritone
|
10
|
+
perfect_fifth: perfect fifth
|
11
|
+
minor_sixth: minor sixth
|
12
|
+
major_sixth: major sixth
|
13
|
+
minor_seventh: minor seventh
|
14
|
+
major_seventh: major seventh
|
15
|
+
perfect_octave: perfect octave
|
2
16
|
clefs:
|
3
17
|
alto_clef: alto clef
|
4
18
|
baritone_c_clef: baritone C-clef
|
@@ -162,6 +176,13 @@ en:
|
|
162
176
|
woodblock: woodblock
|
163
177
|
xylophone: xylophone
|
164
178
|
zither: zither
|
179
|
+
locales:
|
180
|
+
de: German
|
181
|
+
en: English
|
182
|
+
es: Spanish
|
183
|
+
fr: French
|
184
|
+
it: Italian
|
185
|
+
ru: Russian
|
165
186
|
reference_pitches:
|
166
187
|
a440: A440
|
167
188
|
baroque: Baroque pitch
|
data/lib/head_music/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: head_music
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Head
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|