head_music 8.2.1 → 9.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.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +1 -1
  3. data/.github/workflows/release.yml +1 -1
  4. data/CHANGELOG.md +53 -0
  5. data/CLAUDE.md +151 -0
  6. data/Gemfile.lock +25 -25
  7. data/MUSIC_THEORY.md +120 -0
  8. data/Rakefile +2 -2
  9. data/bin/check_instrument_consistency.rb +86 -0
  10. data/check_instrument_consistency.rb +0 -0
  11. data/head_music.gemspec +1 -1
  12. data/lib/head_music/analysis/diatonic_interval/naming.rb +1 -1
  13. data/lib/head_music/analysis/diatonic_interval.rb +50 -27
  14. data/lib/head_music/analysis/interval_consonance.rb +51 -0
  15. data/lib/head_music/content/note.rb +1 -1
  16. data/lib/head_music/content/placement.rb +1 -1
  17. data/lib/head_music/content/position.rb +1 -1
  18. data/lib/head_music/content/staff.rb +1 -1
  19. data/lib/head_music/instruments/instrument.rb +103 -113
  20. data/lib/head_music/instruments/instrument_families.yml +10 -9
  21. data/lib/head_music/instruments/instrument_family.rb +13 -2
  22. data/lib/head_music/instruments/instrument_type.rb +188 -0
  23. data/lib/head_music/instruments/instruments.yml +350 -368
  24. data/lib/head_music/instruments/score_order.rb +139 -0
  25. data/lib/head_music/instruments/score_orders.yml +130 -0
  26. data/lib/head_music/instruments/variant.rb +6 -0
  27. data/lib/head_music/locales/de.yml +6 -0
  28. data/lib/head_music/locales/en.yml +98 -0
  29. data/lib/head_music/locales/es.yml +6 -0
  30. data/lib/head_music/locales/fr.yml +6 -0
  31. data/lib/head_music/locales/it.yml +6 -0
  32. data/lib/head_music/locales/ru.yml +6 -0
  33. data/lib/head_music/rudiment/alteration.rb +23 -8
  34. data/lib/head_music/rudiment/base.rb +9 -0
  35. data/lib/head_music/rudiment/chromatic_interval.rb +3 -6
  36. data/lib/head_music/rudiment/clef.rb +1 -1
  37. data/lib/head_music/rudiment/consonance.rb +37 -4
  38. data/lib/head_music/rudiment/diatonic_context.rb +25 -0
  39. data/lib/head_music/rudiment/key.rb +77 -0
  40. data/lib/head_music/rudiment/key_signature/enharmonic_equivalence.rb +1 -1
  41. data/lib/head_music/rudiment/key_signature.rb +46 -7
  42. data/lib/head_music/rudiment/letter_name.rb +3 -3
  43. data/lib/head_music/rudiment/meter.rb +19 -9
  44. data/lib/head_music/rudiment/mode.rb +92 -0
  45. data/lib/head_music/rudiment/musical_symbol.rb +1 -1
  46. data/lib/head_music/rudiment/note.rb +112 -0
  47. data/lib/head_music/rudiment/pitch/parser.rb +52 -0
  48. data/lib/head_music/rudiment/pitch.rb +5 -6
  49. data/lib/head_music/rudiment/pitch_class.rb +1 -1
  50. data/lib/head_music/rudiment/quality.rb +1 -1
  51. data/lib/head_music/rudiment/reference_pitch.rb +1 -1
  52. data/lib/head_music/rudiment/register.rb +4 -1
  53. data/lib/head_music/rudiment/rest.rb +36 -0
  54. data/lib/head_music/rudiment/rhythmic_element.rb +53 -0
  55. data/lib/head_music/rudiment/rhythmic_unit/parser.rb +86 -0
  56. data/lib/head_music/rudiment/rhythmic_unit.rb +104 -29
  57. data/lib/head_music/rudiment/rhythmic_units.yml +80 -0
  58. data/lib/head_music/rudiment/rhythmic_value/parser.rb +77 -0
  59. data/lib/head_music/{content → rudiment}/rhythmic_value.rb +23 -5
  60. data/lib/head_music/rudiment/scale.rb +4 -5
  61. data/lib/head_music/rudiment/scale_degree.rb +9 -4
  62. data/lib/head_music/rudiment/scale_type.rb +9 -3
  63. data/lib/head_music/rudiment/solmization.rb +1 -1
  64. data/lib/head_music/rudiment/spelling.rb +5 -4
  65. data/lib/head_music/rudiment/tempo.rb +85 -0
  66. data/lib/head_music/rudiment/tonal_context.rb +35 -0
  67. data/lib/head_music/rudiment/tuning/just_intonation.rb +85 -0
  68. data/lib/head_music/rudiment/tuning/meantone.rb +87 -0
  69. data/lib/head_music/rudiment/tuning/pythagorean.rb +91 -0
  70. data/lib/head_music/rudiment/tuning.rb +18 -4
  71. data/lib/head_music/rudiment/unpitched_note.rb +62 -0
  72. data/lib/head_music/style/annotation.rb +4 -4
  73. data/lib/head_music/style/guidelines/notes_same_length.rb +16 -16
  74. data/lib/head_music/style/medieval_tradition.rb +26 -0
  75. data/lib/head_music/style/modern_tradition.rb +34 -0
  76. data/lib/head_music/style/renaissance_tradition.rb +26 -0
  77. data/lib/head_music/style/tradition.rb +21 -0
  78. data/lib/head_music/utilities/hash_key.rb +34 -2
  79. data/lib/head_music/version.rb +1 -1
  80. data/lib/head_music.rb +33 -9
  81. data/user_stories/active/handle-time.md +7 -0
  82. data/user_stories/active/handle-time.rb +177 -0
  83. data/user_stories/done/epic--score-order/PLAN.md +244 -0
  84. data/user_stories/done/epic--score-order/band-score-order.md +38 -0
  85. data/user_stories/done/epic--score-order/chamber-ensemble-score-order.md +33 -0
  86. data/user_stories/done/epic--score-order/orchestral-score-order.md +43 -0
  87. data/user_stories/done/instrument-variant.md +65 -0
  88. data/user_stories/done/superclass-for-note.md +30 -0
  89. data/user_stories/todo/agentic-daw.md +3 -0
  90. data/user_stories/todo/consonance-dissonance-classification.md +57 -0
  91. data/user_stories/todo/dyad-analysis.md +57 -0
  92. data/user_stories/todo/material-and-scores.md +10 -0
  93. data/user_stories/todo/organizing-content.md +72 -0
  94. data/user_stories/todo/percussion_set.md +1 -0
  95. data/user_stories/todo/pitch-class-set-analysis.md +79 -0
  96. data/user_stories/todo/pitch-set-classification.md +72 -0
  97. data/user_stories/todo/sonority-identification.md +67 -0
  98. metadata +51 -6
  99. data/TODO.md +0 -218
data/TODO.md DELETED
@@ -1,218 +0,0 @@
1
- # TODO
2
-
3
- May 7, 2023
4
-
5
- Robert Head:
6
- Hey, Brian. You have a sec for a music question? I’m trying to come up with different terms for the way “family” is used. “Woodwind family” vs. “Oboe family”.
7
-
8
- Brian Head:
9
- Those are good, I’d say. In what context?
10
-
11
- Robert Head:
12
- In my software project, I’m trying to define those relationships. One is a section of the orchestra and the other is species of instrument. But usually people, in my experience, just say “family”.
13
- Is there some more precise terminology or adjective that can disambiguate those two terms?
14
-
15
- Brian Head:
16
- Hmmm. Already “family” is informal. Blatter distinguishes between “choir” and “family” as in the trumpet family” within the “brass choir”.
17
-
18
- Robert Head:
19
- Ah, yes! I do like that.
20
- But does it apply to percussion?
21
- “Section” is another candidate, but that gets used for string parts as well.
22
-
23
- Brian Head:
24
- Strings and percussion probably don’t think of themselves as a choir, but if you’re mainly looking for a taxonomically consistent word, that’s the feat I can think of at the moment.
25
- Section is a good word, too, which easily flows between smaller and larger meanings.
26
-
27
- Robert Head:
28
- Obviously, the four “families” is a garbage way to classify all instruments and it really is more applicable to the orchestral context, so maybe “orchestra family” or “orchestra section”.
29
-
30
- Brian Head:
31
- I’d say that “family” is best used at the instrument level, as in “saxophone family”. Choir or section are better for larger collections. Still, both of those words connote membership in an orchestra. Or large ensemble. “Woodwinds” or “percussion” describe the class of instruments themselves.
32
-
33
- Robert Head:
34
- Cool
35
-
36
- Action Item: Call them orchestra_section
37
-
38
- Add Score Order
39
-
40
- Orchestral Score Order
41
-
42
- # So, in orchestral scores, the groupings are by instrumental 'family':
43
- # woodwinds on top of the page, and below them, in descending order,
44
- # brass,
45
- # percussion,
46
- # harp and keyboards,
47
- # soloists (instrumental or vocal),
48
- # voices,
49
- # strings
50
-
51
- (Notice the different placement of percussion in orchestra and band scores)
52
-
53
- Flutes (Fl or Fls)
54
- Oboes (Ob or Obs)
55
- Clarinets (Cl or Cls)
56
- Bassoons (Bsn or Bsns)
57
- Horns (Hn or Hns)
58
- Trumpets (Tpt or Tpts)
59
- Trombones (Trb or Trbs)
60
- Tuba (Tuba)
61
- Timpani (Timp)
62
- Percussion (Perc)
63
- Other Instruments
64
- harp and keyboards
65
- soloists
66
- voices
67
- Violins I (Vlns)
68
- Violins II
69
- Viola (Vla)
70
- Violoncellos (Vcl)
71
- Double Bass (DB)
72
-
73
- Band Score Order
74
-
75
- Flutes (Fl or Fls)
76
- Oboes (Ob or Obs)
77
- Bassoons (Bsn or Bsns)
78
- Clarinets (Cl or Cls)
79
- Saxophones (AS, or TS, or BS)
80
- Cornets (Cor)
81
- Trumpets (Tpt or Tpts)
82
- Horns (Hn or Hns)
83
- Trombones (Trb or Trbs)
84
- Euphoniums (Euph)
85
- Tubas (Tubas)
86
- Timpani (Timp)
87
- Percussion (Perc)
88
-
89
- Brass Quintet
90
-
91
- Trumpet I
92
- Trumpet II
93
- Horn
94
- Trombone
95
- Tuba
96
-
97
- Woodwind Quintet
98
-
99
- Flute
100
- Oboe
101
- Clarinet
102
- Horn
103
- Bassoon
104
-
105
-
106
-
107
- Disambiguate PitchSet and Sonority
108
-
109
- Sonority should be a name for a specific set of intervals
110
- Sonority.get(identifier)
111
- Sonority.for(pitch_set)
112
- Sonority.pitch_set_for(root_pitch:, inversion:)
113
-
114
- class PitchSet
115
- def sonority
116
- @sonority ||= Sonority.for(self)
117
- end
118
- end
119
-
120
-
121
-
122
- open consonance (P5 P8)
123
- soft consonance (m3 M3 m6 M6)
124
- mild dissonance (M2 m7)
125
- sharp dissonance (m2 M7)
126
-
127
- P4 (consonant or dissonant)
128
- T (neutral or restless)
129
-
130
- Sets
131
- DurationSet?
132
-
133
-
134
- Make new analysis classes:
135
- Dyad
136
- .interval
137
- .implied_triad (if a third)
138
- - returns most likely of possible triads
139
- .possible_triads
140
- - returns major and minor if a perfect fifth
141
- - returns minor and diminished if minor third
142
- - returns major and augmented if major third
143
- - returns inverted major and root augmented if augmented fifth
144
- - returns diminished if diminished fifth
145
- - should it take into account enharmonics? I think yes.
146
- .possible_seventh_chords
147
- - as above, with either seventh added
148
- - returns 3rd inversion if second
149
- .possible_chords
150
- possible_triads + possible_seventh_chords
151
- .possible_enharmonic_triads
152
- .possible_enharmonic_seventh_chords
153
- .possible_enharmonic_chords
154
-
155
- the dyad will be super helpful in analyzing two-part counterpoint.
156
-
157
- Triad
158
- SeventhChord
159
- Don't need anything beyond seventh chords to analyze pre-Romantic music.
160
-
161
-
162
- ## User stories
163
-
164
-
165
- ### Done
166
-
167
- As a developer
168
- When instantiating a DiatonicInterval
169
- When passing an abbreviation, such as 'P5' or 'm2'
170
- I want to receive that instance.
171
-
172
- As a developer
173
- Given a pitch
174
- I want to be able to add a diatonic interval to get another pitch.
175
-
176
- DiatonicInterval
177
- - def above(pitch) -> pitch
178
- DiatonicInterval
179
- - def below(pitch) -> pitch
180
-
181
- Pitch addition and subtraction
182
- - define `Pitch#+`, `Pitch#-`
183
- - use DiatonicInterval methods
184
-
185
- PitchSet
186
-
187
- A PitchSet is unlike a PitchClassSet in that the pitches have spellings with octaves rather than Spellings only or octave-less 0-11 designations.
188
-
189
- PitchClassSet
190
- .size?
191
- .monad?
192
- .dyad?
193
- .triad? (must be stacked thirds to be a 'triad')
194
- .trichord? (all 3-pitch sets)
195
-
196
- Should every group of pitches have one or more strategies for describing it? Such as Dyad?
197
-
198
- Set (superclass?)
199
- PitchSet
200
- EmptySet
201
- Monad
202
- Dyad
203
- Trichord (or Triad)
204
- - triad?
205
- Tetrachord (or Tetrad)
206
- - seventh_chord?
207
- Pentachord (or Pentad)
208
- Hexachord (or Hexad)
209
- Heptachords (or Heptad or, sometimes, mixing Latin and Greek roots, "Septachord")
210
- Octachords (Octad)
211
- Nonachords (Nonad)
212
- Decachords (Decad)
213
- Undecachords
214
- Dodecachord
215
-
216
- PitchClassSet
217
- .normal_form? (most compact)
218
- .prime_form (most compact normal form of the original or any inversion)