@greenblacksky/honmoon 0.0.0-stage → 0.4.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 (82) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +85 -2
  3. package/package.json +58 -4
  4. package/src/lib/audio/context.ts +29 -0
  5. package/src/lib/audio/metronome.svelte.ts +146 -0
  6. package/src/lib/audio/mic.ts +254 -0
  7. package/src/lib/audio/pitch.ts +133 -0
  8. package/src/lib/audio/rhythmplay.ts +152 -0
  9. package/src/lib/audio/synth.ts +409 -0
  10. package/src/lib/audio/voiceplay.ts +60 -0
  11. package/src/lib/drills/defs.ts +459 -0
  12. package/src/lib/drills/questions.ts +920 -0
  13. package/src/lib/drills/registry.svelte.ts +167 -0
  14. package/src/lib/drills/runtime.svelte.ts +629 -0
  15. package/src/lib/drills/verdict.ts +241 -0
  16. package/src/lib/index.ts +117 -0
  17. package/src/lib/learn/describe.ts +72 -0
  18. package/src/lib/learn/pools.ts +44 -0
  19. package/src/lib/learn/progress.ts +100 -0
  20. package/src/lib/learn/session.ts +304 -0
  21. package/src/lib/music/bass.ts +139 -0
  22. package/src/lib/music/clefs.ts +218 -0
  23. package/src/lib/music/intervals.ts +94 -0
  24. package/src/lib/music/notes.ts +133 -0
  25. package/src/lib/music/rhythm.ts +624 -0
  26. package/src/lib/music/scales.ts +560 -0
  27. package/src/lib/music/voice.ts +227 -0
  28. package/src/lib/music/warmups.ts +318 -0
  29. package/src/lib/nav.svelte.ts +53 -0
  30. package/src/lib/notation/fretboard.ts +187 -0
  31. package/src/lib/notation/glyphdata.ts +101 -0
  32. package/src/lib/notation/glyphs.ts +71 -0
  33. package/src/lib/notation/icons.ts +12 -0
  34. package/src/lib/notation/keyboard.ts +166 -0
  35. package/src/lib/notation/rhythmsvg.ts +341 -0
  36. package/src/lib/notation/staff.ts +288 -0
  37. package/src/lib/notation/svg.ts +37 -0
  38. package/src/lib/notation/tab.ts +80 -0
  39. package/src/lib/store/honmoon.svelte.ts +329 -0
  40. package/src/lib/store/normalize.ts +23 -0
  41. package/src/lib/store/sync.ts +43 -0
  42. package/src/lib/store/types.ts +101 -0
  43. package/src/lib/styles/honmoon.css +2064 -0
  44. package/src/lib/ui/AccRow.svelte +23 -0
  45. package/src/lib/ui/BackBar.svelte +23 -0
  46. package/src/lib/ui/BassRow.svelte +30 -0
  47. package/src/lib/ui/Chips.svelte +23 -0
  48. package/src/lib/ui/DataCard.svelte +66 -0
  49. package/src/lib/ui/Fretboard.svelte +71 -0
  50. package/src/lib/ui/Keyboard.svelte +54 -0
  51. package/src/lib/ui/MetronomePanel.svelte +101 -0
  52. package/src/lib/ui/RefBar.svelte +28 -0
  53. package/src/lib/ui/RhythmBar.svelte +9 -0
  54. package/src/lib/ui/Shell.svelte +96 -0
  55. package/src/lib/ui/StaffRun.svelte +46 -0
  56. package/src/lib/ui/Stat.svelte +13 -0
  57. package/src/lib/ui/actions.ts +36 -0
  58. package/src/lib/ui/keyfollow.svelte.ts +48 -0
  59. package/src/lib/ui/overlay.ts +15 -0
  60. package/src/lib/ui/refdata.ts +355 -0
  61. package/src/lib/ui/scaleboard.ts +420 -0
  62. package/src/lib/ui/screens/DegreesRef.svelte +405 -0
  63. package/src/lib/ui/screens/DrillScreen.svelte +1155 -0
  64. package/src/lib/ui/screens/Explorer.svelte +245 -0
  65. package/src/lib/ui/screens/FamilyScreen.svelte +280 -0
  66. package/src/lib/ui/screens/Glossary.svelte +65 -0
  67. package/src/lib/ui/screens/IntervalRef.svelte +37 -0
  68. package/src/lib/ui/screens/LearnIndex.svelte +44 -0
  69. package/src/lib/ui/screens/MetronomeScreen.svelte +17 -0
  70. package/src/lib/ui/screens/PracticeHome.svelte +159 -0
  71. package/src/lib/ui/screens/RhythmRef.svelte +239 -0
  72. package/src/lib/ui/screens/ScalesScreen.svelte +210 -0
  73. package/src/lib/ui/screens/SessionDone.svelte +119 -0
  74. package/src/lib/ui/screens/SetupScreen.svelte +548 -0
  75. package/src/lib/ui/screens/StaffMap.svelte +230 -0
  76. package/src/lib/ui/screens/StatsScreen.svelte +478 -0
  77. package/src/lib/ui/screens/TapCalibration.svelte +186 -0
  78. package/src/lib/ui/tapfix.ts +93 -0
  79. package/src/lib/ui/types.ts +40 -0
  80. package/src/lib/util/list.ts +4 -0
  81. package/src/lib/util/random.ts +23 -0
  82. package/src/lib/util/text.ts +50 -0
@@ -0,0 +1,15 @@
1
+ /** Invisible tap targets sit on top of a drawn SVG, positioned in percent of
2
+ the drawing so they stay aligned at any zoom. */
3
+
4
+ /** A CSS position for a box given in the drawing's viewBox units. */
5
+ export function percentBox(
6
+ box: { x: number; y: number; w: number; h: number },
7
+ width: number,
8
+ height: number,
9
+ ): string {
10
+ const pct = (part: number, whole: number) => ((100 * part) / whole).toFixed(3) + '%';
11
+ return (
12
+ `left:${pct(box.x, width)};top:${pct(box.y, height)};` +
13
+ `width:${pct(box.w, width)};height:${pct(box.h, height)}`
14
+ );
15
+ }
@@ -0,0 +1,355 @@
1
+ /* Generated from the original app: the vocabulary, the Learn index and the
2
+ degree questions, word for word. */
3
+
4
+ export interface GlossSection {
5
+ g: string;
6
+ items: [string, string][];
7
+ }
8
+ /** Every term the drills use, one line each. Definitions may carry <b>/<i>. */
9
+ export const GLOSS: GlossSection[] = [
10
+ {
11
+ g: 'Notes and names',
12
+ items: [
13
+ [
14
+ 'Pitch',
15
+ 'How high or low a sound is. Two notes can be the same pitch and be played in completely different places on the neck.',
16
+ ],
17
+ [
18
+ 'Note',
19
+ 'A pitch with a name, and on paper a length as well. <b>A</b> is a note; so is the dot on the page that says to play it for one beat.',
20
+ ],
21
+ [
22
+ 'Natural',
23
+ 'One of the seven notes with a plain letter name: A B C D E F G. The white keys on a piano.',
24
+ ],
25
+ [
26
+ 'Sharp ♯',
27
+ 'A note one fret higher than the natural of the same letter. F♯ is one fret above F.',
28
+ ],
29
+ ['Flat ♭', 'A note one fret lower. G♭ is one fret below G.'],
30
+ [
31
+ 'Accidental',
32
+ 'A sharp, a flat or a natural sign — anything that shifts a note off its plain letter. Switch <i>Sharps and flats</i> on in Setup and these join the drills.',
33
+ ],
34
+ [
35
+ 'Enharmonic',
36
+ 'Two names for the same pitch. F♯ and G♭ are the same fret; which name is right depends on the key you are in.',
37
+ ],
38
+ [
39
+ 'Octave',
40
+ 'The distance from a note to the next note of the same name, up or down. Twelve frets. They sound so alike that most people hear them as the same note.',
41
+ ],
42
+ [
43
+ 'Pitch class',
44
+ 'A note name with the octave thrown away. Every E on the bass is the same pitch class. Several drills ask for a pitch class, which is why any E counts.',
45
+ ],
46
+ [
47
+ 'Solfège',
48
+ 'Singing names for notes — Do Re Mi Fa Sol La Si. This app uses them as a second name for the letters unless you switch movable do on.',
49
+ ],
50
+ [
51
+ 'Fixed do',
52
+ 'Do is always C, in every key. A second label for a letter, and the app’s default.',
53
+ ],
54
+ [
55
+ 'Movable do',
56
+ 'Do is whichever note the key is built on, so the syllables describe the <i>role</i> a note plays rather than its pitch. Off by default; turn it on in Setup.',
57
+ ],
58
+ ],
59
+ },
60
+ {
61
+ g: 'Distance',
62
+ items: [
63
+ [
64
+ 'Semitone / half step',
65
+ 'The smallest step in this system: one fret. B to C is a half step, and so is F to F♯.',
66
+ ],
67
+ ['Whole step', 'Two frets. Two half steps.'],
68
+ [
69
+ 'Interval',
70
+ 'The distance between two notes, counted in semitones. A perfect fifth is seven. The distance is the same wherever you play it, which is why one shape works in every key.',
71
+ ],
72
+ [
73
+ 'Harmonic / melodic',
74
+ 'Two notes together is harmonic; one after the other is melodic. The ear drills use both.',
75
+ ],
76
+ [
77
+ 'Consonant / dissonant',
78
+ 'Roughly, whether two notes sound settled together or restless. The tritone — six semitones — is the classic restless one.',
79
+ ],
80
+ ],
81
+ },
82
+ {
83
+ g: 'Scales and keys',
84
+ items: [
85
+ [
86
+ 'Scale',
87
+ 'A chosen set of notes, in order, starting from a root. The set is what gives music built on it its flavour.',
88
+ ],
89
+ [
90
+ 'Root',
91
+ 'The note a scale or chord is built from and named after. The root of A minor pentatonic is A.',
92
+ ],
93
+ [
94
+ 'Tonic',
95
+ 'The note a piece of music treats as home. In a key, the root and the tonic are the same note.',
96
+ ],
97
+ [
98
+ 'Key',
99
+ 'The scale a piece of music is living in, named after its tonic: <i>the key of G major</i>.',
100
+ ],
101
+ [
102
+ 'Step (of a scale)',
103
+ 'The gap between one note of a scale and the next, in frets. Major goes whole whole half whole whole whole half. The steps of any scale add up to twelve.',
104
+ ],
105
+ [
106
+ 'Degree',
107
+ 'Which note of the scale you are on, counting the root as 1. A ♭ in front means a semitone below where the major scale would put it, so ♭3 is the note that makes a chord minor.',
108
+ ],
109
+ [
110
+ 'Major / minor',
111
+ 'The two families most Western music lives in, and the difference is mostly the third degree: a bright major third, or a darker minor third one fret lower.',
112
+ ],
113
+ [
114
+ 'Mode',
115
+ 'A scale built from the same notes as another but treating a different note as home. Dorian is the major scale starting from its second degree, and sounds nothing like it.',
116
+ ],
117
+ [
118
+ 'Pentatonic',
119
+ 'A five-note scale. Leaving two notes out leaves bigger gaps and no half steps, which is why it is so hard to play a wrong note with one.',
120
+ ],
121
+ ['Chord', 'Three or more notes sounding together.'],
122
+ ['Triad', 'A three-note chord: root, third, fifth. Major or minor depending on that third.'],
123
+ [
124
+ 'Arpeggio',
125
+ 'A chord played one note at a time instead of all at once. What a bass line usually is.',
126
+ ],
127
+ ],
128
+ },
129
+ {
130
+ g: 'On the page',
131
+ items: [
132
+ [
133
+ 'Staff',
134
+ 'The five lines notes are written on. Higher on the staff means higher in pitch — that is all the vertical direction means.',
135
+ ],
136
+ [
137
+ 'Clef',
138
+ 'The sign at the start of the staff that says which pitches the lines stand for. Bass clef is the one you need; the others are here for when you meet them.',
139
+ ],
140
+ [
141
+ 'Ledger line',
142
+ 'A short extra line above or below the staff, for notes that run off the end of it.',
143
+ ],
144
+ [
145
+ 'Notehead, stem',
146
+ 'The oval that says which pitch, and the line off it that helps say how long. A filled head with a stem is a quarter note; a hollow one is a half.',
147
+ ],
148
+ [
149
+ 'Written pitch',
150
+ 'Bass is written an octave above where it sounds, so the page stays readable without a forest of ledger lines. Your frets and your ears agree; only the paper is transposed.',
151
+ ],
152
+ [
153
+ 'Landmark',
154
+ 'A note whose position on the staff you know instantly, used to find its neighbours by counting from it rather than from the bottom line every time.',
155
+ ],
156
+ ],
157
+ },
158
+ {
159
+ g: 'Time',
160
+ items: [
161
+ ['Beat', 'The pulse you tap your foot to.'],
162
+ [
163
+ 'Tempo',
164
+ 'How fast the beats go, in <b>bpm</b> — beats per minute. 60 bpm is one beat a second.',
165
+ ],
166
+ [
167
+ 'Bar (measure)',
168
+ 'A group of beats, marked off by vertical lines. A bar holds exactly what its time signature promises, no more.',
169
+ ],
170
+ [
171
+ 'Time signature',
172
+ 'The two stacked numbers at the start. The top is how many beats are in a bar; the bottom says which note value gets one beat. 4 on the bottom means a quarter note.',
173
+ ],
174
+ [
175
+ 'Note value',
176
+ 'How long a note lasts, in beats: whole, half, quarter, eighth, sixteenth, each half the one before.',
177
+ ],
178
+ [
179
+ 'Rest',
180
+ 'A silence of a written length. Music, not a gap — reading them accurately is what keeps a line from turning to mush.',
181
+ ],
182
+ [
183
+ 'Dot',
184
+ 'A dot after a note adds half of it again. A dotted quarter is a beat and a half, and is where most syncopation starts.',
185
+ ],
186
+ [
187
+ 'Tie',
188
+ 'A curve joining two noteheads: play the first, hold through the second. One sound, both lengths.',
189
+ ],
190
+ [
191
+ 'Beam',
192
+ 'The thick line joining short notes into groups of one beat. Not decoration — it draws the beat for you.',
193
+ ],
194
+ [
195
+ 'Subdivision',
196
+ 'The smaller units inside a beat. Counted out loud, four sixteenths are <i>1 e &amp; a</i> and two eighths are <i>1 &amp;</i>.',
197
+ ],
198
+ [
199
+ 'Syncopation',
200
+ 'Notes landing off the beat rather than on it. What makes a line push or groove instead of march.',
201
+ ],
202
+ ['Count-in', 'The clicks before a bar starts, so you know where beat one is.'],
203
+ ],
204
+ },
205
+ {
206
+ g: 'On the bass',
207
+ items: [
208
+ ['Open string', 'A string played without pressing a fret. Yours are E A D G, low to high.'],
209
+ [
210
+ 'Fret',
211
+ 'One of the metal bars, and by extension the space behind it. One fret is one semitone.',
212
+ ],
213
+ [
214
+ 'Position',
215
+ 'Where your hand sits on the neck — which fret your first finger is covering. Most of a line is played without moving it.',
216
+ ],
217
+ [
218
+ 'Shape',
219
+ 'A pattern of fingers that keeps its meaning wherever you slide it, because every fret is the same distance. The one real advantage a fretted instrument has over a piano.',
220
+ ],
221
+ [
222
+ 'Fundamental',
223
+ 'The lowest and loudest frequency in a played note, and the one that gives it its pitch. The listening drills are hunting for this, which is why rolling the tone knob back helps.',
224
+ ],
225
+ ],
226
+ },
227
+ {
228
+ g: 'Voice',
229
+ items: [
230
+ [
231
+ 'Range',
232
+ 'The span from the lowest note you can sing to the highest. Everything this app asks you to sing is moved to sit inside yours.',
233
+ ],
234
+ [
235
+ 'Register',
236
+ 'A part of your range that feels like one mechanism — chest low down, head high up. The joins between them are what warm-ups smooth out.',
237
+ ],
238
+ ['Onset', 'How a note starts. A clean onset begins without a push of air or a click.'],
239
+ [
240
+ 'Semi-occluded',
241
+ 'Singing through a partly closed mouth — a lip trill, a hum, a straw. It balances the pressure across the vocal folds, and is the safest thing to do to a cold voice.',
242
+ ],
243
+ [
244
+ 'Vocal fry',
245
+ 'The low, creaky rattle at the very bottom of your voice. Used gently, it wakes the folds up without effort.',
246
+ ],
247
+ [
248
+ 'Siren',
249
+ 'A slow slide from low to high and back, on one sound. Finds the joins between registers and smooths them.',
250
+ ],
251
+ ],
252
+ },
253
+ {
254
+ g: 'Words this app uses',
255
+ items: [
256
+ [
257
+ 'Card',
258
+ 'One thing you can be asked about — a fret, a note on the staff, an interval, a scale in a key. Your progress is kept per card.',
259
+ ],
260
+ [
261
+ 'Solid',
262
+ 'A card you have answered correctly enough times in a row that it has dropped out of rotation for now. Five in a row, and a wrong answer knocks it back two.',
263
+ ],
264
+ [
265
+ 'Spaced repetition',
266
+ 'Asking you about the things you are worst at, more often, and leaving alone the things you know. It is why ten minutes most days beats an hour on Sunday.',
267
+ ],
268
+ [
269
+ 'Session',
270
+ 'A run of cards drawn from every family you have left switched on. Miss one and it comes back later in the same session.',
271
+ ],
272
+ [
273
+ 'Family',
274
+ 'One of the six groups of drills on the Practice screen — the neck, reading, names, ear, voice, scales.',
275
+ ],
276
+ [
277
+ 'Range (setting)',
278
+ 'How far up the neck the drills go. Separate from <i>Sharps and flats</i>, which decides whether the black notes are in at all.',
279
+ ],
280
+ ],
281
+ },
282
+ ];
283
+
284
+ /** The references, in the order the Learn tab lists them. */
285
+ export const LEARN: { go: string; n: string; sb: string }[] = [
286
+ {
287
+ go: 'ref',
288
+ n: 'The staff, note by note',
289
+ sb: 'Every note in order, what it is called, and where it sits on the neck. Lines, spaces, landmarks, and any clef you have switched on.',
290
+ },
291
+ {
292
+ go: 'rref',
293
+ n: 'How rhythm is written',
294
+ sb: 'Note values, dots, ties and rests; bars and time signatures; and how to count a bar out loud so your hands can follow.',
295
+ },
296
+ {
297
+ go: 'ivref',
298
+ n: 'What an interval is',
299
+ sb: 'All twelve gaps, what each one sounds like, and why one shape works in every key.',
300
+ },
301
+ {
302
+ go: 'sx',
303
+ n: 'Scale explorer',
304
+ sb: 'Any scale in any key: the notes, the degrees and the shape on the neck, with nothing being asked of you.',
305
+ },
306
+ {
307
+ go: 'degref',
308
+ n: 'Reading scale degrees',
309
+ sb: 'What 1, ♭3 and ♯4 mean, how to read a scale’s formula, and where each degree sits under your hand. Five short pages, with pictures.',
310
+ },
311
+ {
312
+ go: 'gloss',
313
+ n: 'Vocabulary',
314
+ sb: 'Every term the drills use at you — tonic, degree, subdivision, semi-occluded — defined in one line each, searchable.',
315
+ },
316
+ ];
317
+
318
+ /** Try-it questions on the last degrees page: question (may carry <b>), answer, why. */
319
+ export const DEGQ: [string, string, string][] = [
320
+ [
321
+ 'In G major, what is the <b>5</b>?',
322
+ 'D',
323
+ 'Count G A B C D — the fifth letter. Or seven frets up from G.',
324
+ ],
325
+ ['In D major, what is the <b>3</b>?', 'F♯', 'D E F♯. Four frets up from D.'],
326
+ ['In A minor, what is the <b>♭3</b>?', 'C', 'A major’s 3 is C♯; a fret lower is C.'],
327
+ [
328
+ 'In E minor, what is the <b>♭6</b>?',
329
+ 'C',
330
+ 'E major has C♯ there; minor lowers it. A flat degree, a natural note.',
331
+ ],
332
+ [
333
+ 'In F major, what is the <b>4</b>?',
334
+ 'B♭',
335
+ 'A flat note, but a plain degree — it is where major puts the 4 in F.',
336
+ ],
337
+ ['In C, which degree is <b>F</b>?', '4', 'C D E F — fourth letter, five frets up.'],
338
+ [
339
+ 'In A, which degree is <b>G</b>?',
340
+ '♭7',
341
+ 'A major’s 7 is G♯. G is a fret lower, so ♭7. The note that gives A7 its bite.',
342
+ ],
343
+ [
344
+ 'On the neck: root on the E string, fret 5. Where is the <b>5</b>?',
345
+ 'A string, fret 7',
346
+ 'Same shape from any root: one string up, two frets along.',
347
+ ],
348
+ [
349
+ 'Minor pentatonic is 1 ♭3 4 5 ♭7. In E, what are its notes?',
350
+ 'E G A B D',
351
+ 'E major would be E G♯ A B D♯; lower the 3 and 7.',
352
+ ],
353
+ ];
354
+
355
+ export const DEGTABS = ['The idea', 'Flats and sharps', 'Scale formulas', 'On the neck', 'Try it'];