head_music 6.0.1 → 7.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.
@@ -92,16 +92,18 @@ en:
92
92
  shaken: shaken
93
93
  single_reed: single-reed
94
94
  string: string
95
- strings: strings
96
95
  stringed_instrument: stringed instrument
96
+ strings: strings
97
97
  struck: struck
98
98
  voice: voice
99
99
  wind: wind
100
100
  wind_instrument: wind instrument
101
101
  wood: wood
102
102
  woodwind: woodwind
103
+ instrument_with_pitch_designation: "%{instrument} in %{pitch_designation}"
103
104
  instrument_voices:
104
105
  piccolo: piccolo
106
+ sopranino: sopranino
105
107
  soprano: soprano
106
108
  mezzo_soprano: mezzo-soprano
107
109
  alto: alto
@@ -109,105 +111,163 @@ en:
109
111
  baritone: baritone
110
112
  bass: bass
111
113
  contrabass: contrabass
112
- octobass: octobass
114
+ subcontrabass: subcontrabass
113
115
  instruments:
114
116
  accordion: accordion
115
117
  alto_clarinet: alto clarinet
116
118
  alto_flute: alto flute
119
+ alto_recorder: alto recorder
120
+ alto_saxophone: alto saxophone
117
121
  alto_voice: alto
118
122
  arpeggione: arpeggione
119
123
  bagpipe: bagpipe
124
+ bagpipes: bagpipes
120
125
  banjo: banjo
121
126
  baritone_horn: baritone horn
127
+ baritone_oboe: baritone oboe
128
+ baritone_saxophone: baritone saxophone
122
129
  baritone_voice: baritone
130
+ bass: bass
123
131
  bass_clarinet: bass clarinet
124
132
  bass_drum: bass drum
125
133
  bass_guitar: bass guitar
126
134
  bass_oboe: bass oboe
135
+ bass_recorder: bass recorder
136
+ bass_saxophone: bass saxophone
127
137
  bass_trombone: bass trombone
128
138
  bass_trumpet: bass trumpet
129
- bass_trumpet_in_b_flat: bass trumpet in B♭
130
- bass_trumpet_in_c: bass trumpet in C
131
- bass_trumpet_in_e_flat: bass trumpet in E♭
132
139
  bass_tuba: bass tuba
133
- bass_tuba_in_e_flat: bass tuba in E♭
134
- bass_tuba_in_f: bass tuba in F
135
140
  bass_voice: bass
136
141
  basset_horn: basset horn
142
+ basset_recorder: basset recorder
137
143
  bassoon: bassoon
144
+ bells: bells
138
145
  bugle: bugle
139
- bugle_in_b_flat: bugle in B♭
140
146
  castanets: castanets
141
147
  celesta: celesta
142
148
  cello: cello
143
149
  chimes: chimes
144
150
  cimbalom: cimbalom
145
151
  clarinet: clarinet
146
- clarinet_in_a: clarinet in A
147
- clarinet_in_c: clarinet in C
148
- clarinet_in_d: clarinet in D
149
- clarinet_in_e_flat: clarinet in E♭
152
+ clarion: clarion
150
153
  clash_cymbals: clash cymbals
151
154
  clavichord: clavichord
155
+ concert_bells: concert bells
156
+ concert_cymbals: concert cymbals
157
+ contra_great_bass_recorder: contra-great bass recorder
158
+ contrabass: contrabass
152
159
  contrabass_clarinet: contrabass clarinet
160
+ contrabass_recorder: contrabass recorder
161
+ contrabass_saxophone: contrabass saxophone
162
+ contrabass_tuba: contrabass tuba
153
163
  contrabassoon: contrabassoon
164
+ contralto: contralto
165
+ contralto_voice: contralto
154
166
  cor_anglais: cor anglais
155
167
  cornet: cornet
156
- cowbell: cowbell
157
168
  countertenor_voice: countertenor
169
+ cowbell: cowbell
170
+ crash_cymbal: crash cymbal
171
+ crash_cymbals: crash cymbals
158
172
  crotales: crotales
159
173
  cymbal: cymbal
174
+ descant: descant
160
175
  double_bass: double bass
176
+ double_contrabass_recorder: double-contrabass recorder
161
177
  english_horn: English horn
162
178
  euphonium: euphonium
179
+ fiddle: fiddle
180
+ field_drum: field drum
163
181
  flugelhorn: flugelhorn
164
182
  flute: flute
183
+ fortepiano: fortepiano
165
184
  french_horn: French horn
185
+ garklein_recorder: garklein recorder
166
186
  glockenspiel: glockenspiel
187
+ gong: gong
188
+ great_bass_recorder: great bass recorder
167
189
  great_highland_bagpipe: great highland bagpipe
168
190
  guitar: guitar
169
191
  hammered_dulcimer: hammered dulcimer
170
192
  harp: harp
171
193
  harpsichord: harpsichord
194
+ hautbois_d_amour: hautbois d'amour
195
+ hi-hat: hi-hat
172
196
  horn: horn
197
+ kettledrum: kettledrum
198
+ kick_drum: kick drum
173
199
  lute: lute
174
200
  mandolin: mandolin
175
201
  maracas: maracas
176
202
  marimba: marimba
177
203
  metal_block: metal block
204
+ mezzo: mezzo
205
+ mezzo_soprano: mezzo-soprano
206
+ mezzo_soprano_voice: mezzo-soprano
207
+ military_drum: military drum
178
208
  natural_horn: natural horn
179
209
  oboe: oboe
180
210
  oboe_d_amore: oboe d'amore
211
+ octocontrabass_recorder: octocontrabass recorder
212
+ orchestral_chimes: orchestral chimes
213
+ orchestral_cymbals: orchestral cymbals
181
214
  organ: organ
182
215
  piano: piano
216
+ pianoforte: pianoforte
183
217
  piccolo: piccolo
184
218
  piccolo_clarinet: piccolo clarinet
185
219
  piccolo_flute: piccolo flute
220
+ piccolo_recorder: piccolo recorder
221
+ piccolo_saxophone: piccolo saxophone
186
222
  piccolo_trumpet: piccolo trumpet
223
+ pipe_organ: pipe organ
224
+ quart_bass_recorder: quart bass recorder
187
225
  recorder: recorder
226
+ ride_cymbal: ride cymbal
188
227
  saxophone: saxophone
189
228
  side_drum: side drum
190
229
  snare_drum: snare drum
230
+ sopranino_clarinet: sopranino clarinet
231
+ sopranino_recorder: sopranino recorder
232
+ sopranino_saxophone: sopranino saxophone
233
+ sopranissimo_recorder: sopranissimo recorder
234
+ sopranissimo_saxophone: sopranissimo saxophone
235
+ soprano: soprano
236
+ soprano_clarinet: soprano clarinet
237
+ soprano_recorder: soprano recorder
238
+ soprano_saxophone: soprano saxophone
191
239
  soprano_voice: soprano
240
+ soprillo: soprillo
192
241
  sousaphone: sousaphone
242
+ string_bass: string bass
243
+ sub_bass_recorder: sub-bass recorder
244
+ sub_contrabass_recorder: sub-contrabass recorder
245
+ sub_great_bass_recorder: sub-great bass recorder
246
+ subcontrabass_saxophone: subcontrabass saxophone
193
247
  suspended_cymbal: suspended cymbal
194
248
  synthesizer: synthesizer
249
+ tabor: tabor
195
250
  tam_tam: tam-tam
196
251
  tambourine: tambourine
197
252
  temple_blocks: temple blocks
253
+ tenor: tenor
198
254
  tenor_drum: tenor drum
255
+ tenor_recorder: tenor recorder
256
+ tenor_saxophone: tenor saxophone
199
257
  tenor_trombone: tenor trombone
258
+ tenor_tuba: tenor tuba
200
259
  tenor_voice: tenor
201
260
  timpani: timpani
261
+ timpanum: timpanum
262
+ tom_drum: tom drum
263
+ tom_tom: tom-tom
264
+ treble_recorder: treble recorder
202
265
  triangle: triangle
203
266
  trombone: trombone
204
267
  trumpet: trumpet
205
- trumpet_in_c: trumpet in C
206
- trumpet_in_d: trumpet in D
207
- trumpet_in_e_flat: trumpet in E♭
208
268
  tuba: tuba
209
- tuba_in_c: tuba in C
210
269
  tubular_bells: tubular bells
270
+ vibes: vibes
211
271
  vibraphone: vibraphone
212
272
  viola: viola
213
273
  viola_d_amore: viola d'amore
@@ -57,7 +57,6 @@ fr:
57
57
  alto: alto
58
58
  baritone: baryton
59
59
  bass: basse
60
- contralto: contralto
61
60
  countertenor: contre-ténor
62
61
  mezzo_soprano: mezzo-soprano
63
62
  soprano: soprano
@@ -103,8 +103,4 @@ module HeadMusic::Named
103
103
  def localized_name_in_default_locale
104
104
  localized_names.detect { |name| name.locale_code == Locale::DEFAULT_CODE }
105
105
  end
106
-
107
- def hash_key
108
- HeadMusic::Utilities::HashKey.for(name)
109
- end
110
106
  end
@@ -1,4 +1,4 @@
1
- # A scale degree is a number indicating the ordinality of the spelling in the key signature.
1
+ # A scale degree is a number indicating the ordinality of the spelling in the key.
2
2
  # TODO: Rewrite to accept a tonal_center and a scale type.
3
3
  class HeadMusic::ScaleDegree
4
4
  include Comparable
@@ -20,20 +20,25 @@ class HeadMusic::ScaleDegree
20
20
  end
21
21
 
22
22
  def alteration
23
- alteration_semitones = spelling.alteration&.semitones || 0
23
+ spelling_alteration_semitones = spelling.alteration&.semitones || 0
24
24
  usual_sign_semitones = scale_degree_usual_spelling.alteration&.semitones || 0
25
- delta = alteration_semitones - usual_sign_semitones
25
+ delta = spelling_alteration_semitones - usual_sign_semitones
26
26
  HeadMusic::Alteration.by(:semitones, delta) if delta != 0
27
27
  end
28
28
 
29
+ def alteration_semitones
30
+ alteration&.semitones || 0
31
+ end
32
+
29
33
  def to_s
30
34
  "#{alteration}#{degree}"
31
35
  end
32
36
 
33
37
  def <=>(other)
34
38
  if other.is_a?(HeadMusic::ScaleDegree)
35
- [degree, alteration.semitones] <=> [other.degree, other.alteration.semitones]
39
+ [degree, alteration_semitones] <=> [other.degree, other.alteration_semitones]
36
40
  else
41
+ # TODO: Improve this
37
42
  to_s <=> other.to_s
38
43
  end
39
44
  end
@@ -37,10 +37,6 @@ class HeadMusic::Style::Guidelines::NotesSameLength < HeadMusic::Style::Annotati
37
37
  notes[0..-2]
38
38
  end
39
39
 
40
- def distinct_values
41
- all_but_last_note.map(&:rhythmic_value).uniq.length
42
- end
43
-
44
40
  def first_most_common_rhythmic_value
45
41
  @first_most_common_rhythmic_value ||= begin
46
42
  candidates = most_common_rhythmic_values
@@ -33,8 +33,5 @@ class HeadMusic::Style::Mark
33
33
  def code
34
34
  [start_position, end_position].join(" to ")
35
35
  end
36
-
37
- def to_s
38
- code
39
- end
36
+ alias_method :to_s, :code
40
37
  end
@@ -1,3 +1,3 @@
1
1
  module HeadMusic
2
- VERSION = "6.0.1"
2
+ VERSION = "7.0.1"
3
3
  end
data/lib/head_music.rb CHANGED
@@ -38,12 +38,17 @@ require "head_music/circle"
38
38
  require "head_music/clef"
39
39
  require "head_music/consonance"
40
40
  require "head_music/diatonic_interval"
41
+ require "head_music/diatonic_interval/category"
42
+ require "head_music/diatonic_interval/naming"
43
+ require "head_music/diatonic_interval/parser"
44
+ require "head_music/diatonic_interval/semitones"
45
+ require "head_music/diatonic_interval/size"
41
46
  require "head_music/harmonic_interval"
42
47
  require "head_music/instrument_family"
43
48
  require "head_music/instrument"
44
- require "head_music/instrument/pitch_variant"
45
49
  require "head_music/instrument/staff_scheme"
46
50
  require "head_music/instrument/staff"
51
+ require "head_music/instrument/variant"
47
52
  require "head_music/interval_cycle"
48
53
  require "head_music/key_signature"
49
54
  require "head_music/key_signature/enharmonic_equivalence"
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: 6.0.1
4
+ version: 7.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-12-30 00:00:00.000000000 Z
11
+ date: 2024-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -136,11 +136,16 @@ files:
136
136
  - lib/head_music/data/instrument_families.yml
137
137
  - lib/head_music/data/instruments.yml
138
138
  - lib/head_music/diatonic_interval.rb
139
+ - lib/head_music/diatonic_interval/category.rb
140
+ - lib/head_music/diatonic_interval/naming.rb
141
+ - lib/head_music/diatonic_interval/parser.rb
142
+ - lib/head_music/diatonic_interval/semitones.rb
143
+ - lib/head_music/diatonic_interval/size.rb
139
144
  - lib/head_music/harmonic_interval.rb
140
145
  - lib/head_music/instrument.rb
141
- - lib/head_music/instrument/pitch_variant.rb
142
146
  - lib/head_music/instrument/staff.rb
143
147
  - lib/head_music/instrument/staff_scheme.rb
148
+ - lib/head_music/instrument/variant.rb
144
149
  - lib/head_music/instrument_family.rb
145
150
  - lib/head_music/interval_cycle.rb
146
151
  - lib/head_music/key_signature.rb