@sudobility/music_drawing 0.0.30 → 0.0.32
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.
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/keyboard-geometry.d.ts +46 -10
- package/dist/keyboard-geometry.d.ts.map +1 -1
- package/dist/keyboard-geometry.js +21 -11
- package/dist/keyboard-geometry.js.map +1 -1
- package/dist/keyboard-labels.d.ts +61 -0
- package/dist/keyboard-labels.d.ts.map +1 -0
- package/dist/keyboard-labels.js +75 -0
- package/dist/keyboard-labels.js.map +1 -0
- package/dist/note-color.d.ts.map +1 -1
- package/dist/note-color.js +8 -0
- package/dist/note-color.js.map +1 -1
- package/dist/note-colors.d.ts +12 -2
- package/dist/note-colors.d.ts.map +1 -1
- package/dist/note-colors.js +5 -2
- package/dist/note-colors.js.map +1 -1
- package/dist/out-of-range.d.ts +67 -0
- package/dist/out-of-range.d.ts.map +1 -0
- package/dist/out-of-range.js +101 -0
- package/dist/out-of-range.js.map +1 -0
- package/dist/render-theme.d.ts.map +1 -1
- package/dist/render-theme.js +2 -0
- package/dist/render-theme.js.map +1 -1
- package/dist/test/fixtures.d.ts.map +1 -1
- package/dist/test/fixtures.js +1 -0
- package/dist/test/fixtures.js.map +1 -1
- package/dist/types.d.ts +13 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * from './layout.js';
|
|
|
22
22
|
export * from './pagination.js';
|
|
23
23
|
export * from './print-layout.js';
|
|
24
24
|
export * from './note-colors.js';
|
|
25
|
+
export * from './out-of-range.js';
|
|
25
26
|
export * from './hit-test.js';
|
|
26
27
|
export * from './track-gutter.js';
|
|
27
28
|
export * from './note-drag.js';
|
|
@@ -40,4 +41,10 @@ export * from './icon-canvas.js';
|
|
|
40
41
|
* between them. Shared by the web and native apps, which both draw one.
|
|
41
42
|
*/
|
|
42
43
|
export * from './keyboard-geometry.js';
|
|
44
|
+
/**
|
|
45
|
+
* And what those keys are called, which is the staff's convention rather than
|
|
46
|
+
* the geometry's: a transposing part read in written pitch letters its keys
|
|
47
|
+
* where its player reads them.
|
|
48
|
+
*/
|
|
49
|
+
export * from './keyboard-labels.js';
|
|
43
50
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AAEjC;;;GAGG;AACH,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AAEjC;;;GAGG;AACH,cAAc,wBAAwB,CAAC;AAEvC;;;;GAIG;AACH,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -22,6 +22,7 @@ export * from './layout.js';
|
|
|
22
22
|
export * from './pagination.js';
|
|
23
23
|
export * from './print-layout.js';
|
|
24
24
|
export * from './note-colors.js';
|
|
25
|
+
export * from './out-of-range.js';
|
|
25
26
|
export * from './hit-test.js';
|
|
26
27
|
export * from './track-gutter.js';
|
|
27
28
|
export * from './note-drag.js';
|
|
@@ -40,4 +41,10 @@ export * from './icon-canvas.js';
|
|
|
40
41
|
* between them. Shared by the web and native apps, which both draw one.
|
|
41
42
|
*/
|
|
42
43
|
export * from './keyboard-geometry.js';
|
|
44
|
+
/**
|
|
45
|
+
* And what those keys are called, which is the staff's convention rather than
|
|
46
|
+
* the geometry's: a transposing part read in written pitch letters its keys
|
|
47
|
+
* where its player reads them.
|
|
48
|
+
*/
|
|
49
|
+
export * from './keyboard-labels.js';
|
|
43
50
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,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/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Physical piano-keyboard layout. Pure arithmetic — no React, no store — so
|
|
3
|
+
* the key positions are unit-testable on their own.
|
|
4
|
+
*
|
|
5
|
+
* Here rather than in an app because two of them now draw a keyboard, and a
|
|
6
|
+
* second copy of this would drift from the first the moment either was tuned.
|
|
7
|
+
* It sits in music_drawing beside the score layout for the same reason that
|
|
8
|
+
* does: it answers where something is drawn, and it needs only music_types.
|
|
9
|
+
*
|
|
10
|
+
* The piano roll modelled pitch as one uniform row per semitone. A real
|
|
11
|
+
* keyboard cannot: white keys tile edge to edge and each black key straddles
|
|
12
|
+
* the boundary *between* two whites, overlapping both.
|
|
13
|
+
*
|
|
14
|
+
* ┌─┬─┬─┬─┬─┬─┬─┐
|
|
15
|
+
* │ │█│ │█│ │ │█│ white: x = whiteIndex * w
|
|
16
|
+
* │ └┬┘ └┬┘ │ └┬┘ black: x = (whiteIndex + 1) * w - blackWidth / 2
|
|
17
|
+
* │C │D │E │F │G │
|
|
18
|
+
* └──┴──┴──┴──┴──┘
|
|
19
|
+
*/
|
|
20
|
+
import { type MidiRange } from '@sudobility/music_types';
|
|
7
21
|
/**
|
|
8
22
|
* The keyboard is drawn over a caller-chosen range, not always all 88 keys:
|
|
9
23
|
* the active track's instrument decides it, so a piccolo part does not present
|
|
10
24
|
* three octaves of keys that will never sound.
|
|
25
|
+
*
|
|
26
|
+
* An **alias** of music_types' `MidiRange`, not a structural twin of it. What
|
|
27
|
+
* a caller passes is almost always `trackKeyboardRange(track)`, so the two were
|
|
28
|
+
* already the same shape by coincidence; saying so outright means a change to
|
|
29
|
+
* `MidiRange` reaches the keyboard rather than being silently accepted by a
|
|
30
|
+
* local copy that happens still to match.
|
|
31
|
+
*/
|
|
32
|
+
export type KeyboardRange = MidiRange;
|
|
33
|
+
/**
|
|
34
|
+
* The 88-key piano — `FULL_KEYBOARD` **by identity**, not a second pair of
|
|
35
|
+
* numbers that agrees with it today.
|
|
36
|
+
*
|
|
37
|
+
* Kept under this name because both apps' keyboards import `FULL_RANGE`, and
|
|
38
|
+
* because it reads as this module's default range (`computeKeys(w, h)`) where
|
|
39
|
+
* `FULL_KEYBOARD` reads as a fact about instruments.
|
|
11
40
|
*/
|
|
12
|
-
export type KeyboardRange = {
|
|
13
|
-
min: number;
|
|
14
|
-
max: number;
|
|
15
|
-
};
|
|
16
41
|
export declare const FULL_RANGE: KeyboardRange;
|
|
42
|
+
/** A0 — the lowest key on a standard 88-key piano. */
|
|
43
|
+
export declare const KEYBOARD_MIN_MIDI: number;
|
|
44
|
+
/** C8 — the highest. */
|
|
45
|
+
export declare const KEYBOARD_MAX_MIDI: number;
|
|
46
|
+
/** The 88 keys span 52 whites; the blacks overlay them and add no width. */
|
|
47
|
+
export declare const WHITE_KEY_COUNT = 52;
|
|
17
48
|
/**
|
|
18
49
|
* Widens `range` so it begins and ends on a white key, and clamps it to the
|
|
19
50
|
* 88-key piano.
|
|
@@ -21,6 +52,11 @@ export declare const FULL_RANGE: KeyboardRange;
|
|
|
21
52
|
* A keyboard whose first or last key is black looks broken — a black key has no
|
|
22
53
|
* white neighbour to hang off on that side, so it would float. Widening is
|
|
23
54
|
* always safe: it only ever adds a key the instrument nearly reaches.
|
|
55
|
+
*
|
|
56
|
+
* Clamped against `FULL_KEYBOARD` rather than against literals of its own: the
|
|
57
|
+
* ranges arriving here come from the same catalogue that bounds itself by that
|
|
58
|
+
* constant, so a local pair of numbers would be a second opinion on where the
|
|
59
|
+
* piano ends.
|
|
24
60
|
*/
|
|
25
61
|
export declare function snapToWhiteKeys(range: KeyboardRange): KeyboardRange;
|
|
26
62
|
/** How many white keys a range spans, which is what sets the keyboard's width. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard-geometry.d.ts","sourceRoot":"","sources":["../src/keyboard-geometry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"keybo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AAE/C,8EAA8E;AAC9E,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGhD;AAED,kIAAkI;AAClI,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED,8DAA8D;AAC9D,wBAAgB,aAAa,CAC3B,aAAa,EAAE,MAAM,EACrB,KAAK,GAAE,aAA0B,GAChC,MAAM,CAER;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,KAAK,GAAE,aAA0B,EACjC,MAAM,GAAE,SAAmB,GAC1B,QAAQ,EAAE,CAwDZ"}
|
|
@@ -17,17 +17,22 @@
|
|
|
17
17
|
* │C │D │E │F │G │
|
|
18
18
|
* └──┴──┴──┴──┴──┘
|
|
19
19
|
*/
|
|
20
|
-
import { gmPercussion, gmPercussionName, midiToPitch, pitchToString, } from '@sudobility/music_types';
|
|
20
|
+
import { FULL_KEYBOARD, gmPercussion, gmPercussionName, midiToPitch, pitchToString, } from '@sudobility/music_types';
|
|
21
|
+
/**
|
|
22
|
+
* The 88-key piano — `FULL_KEYBOARD` **by identity**, not a second pair of
|
|
23
|
+
* numbers that agrees with it today.
|
|
24
|
+
*
|
|
25
|
+
* Kept under this name because both apps' keyboards import `FULL_RANGE`, and
|
|
26
|
+
* because it reads as this module's default range (`computeKeys(w, h)`) where
|
|
27
|
+
* `FULL_KEYBOARD` reads as a fact about instruments.
|
|
28
|
+
*/
|
|
29
|
+
export const FULL_RANGE = FULL_KEYBOARD;
|
|
21
30
|
/** A0 — the lowest key on a standard 88-key piano. */
|
|
22
|
-
export const KEYBOARD_MIN_MIDI =
|
|
31
|
+
export const KEYBOARD_MIN_MIDI = FULL_KEYBOARD.min;
|
|
23
32
|
/** C8 — the highest. */
|
|
24
|
-
export const KEYBOARD_MAX_MIDI =
|
|
33
|
+
export const KEYBOARD_MAX_MIDI = FULL_KEYBOARD.max;
|
|
25
34
|
/** The 88 keys span 52 whites; the blacks overlay them and add no width. */
|
|
26
35
|
export const WHITE_KEY_COUNT = 52;
|
|
27
|
-
export const FULL_RANGE = {
|
|
28
|
-
min: KEYBOARD_MIN_MIDI,
|
|
29
|
-
max: KEYBOARD_MAX_MIDI,
|
|
30
|
-
};
|
|
31
36
|
/**
|
|
32
37
|
* Widens `range` so it begins and ends on a white key, and clamps it to the
|
|
33
38
|
* 88-key piano.
|
|
@@ -35,13 +40,18 @@ export const FULL_RANGE = {
|
|
|
35
40
|
* A keyboard whose first or last key is black looks broken — a black key has no
|
|
36
41
|
* white neighbour to hang off on that side, so it would float. Widening is
|
|
37
42
|
* always safe: it only ever adds a key the instrument nearly reaches.
|
|
43
|
+
*
|
|
44
|
+
* Clamped against `FULL_KEYBOARD` rather than against literals of its own: the
|
|
45
|
+
* ranges arriving here come from the same catalogue that bounds itself by that
|
|
46
|
+
* constant, so a local pair of numbers would be a second opinion on where the
|
|
47
|
+
* piano ends.
|
|
38
48
|
*/
|
|
39
49
|
export function snapToWhiteKeys(range) {
|
|
40
|
-
let min = Math.max(
|
|
41
|
-
let max = Math.min(
|
|
42
|
-
while (min >
|
|
50
|
+
let min = Math.max(FULL_KEYBOARD.min, Math.min(range.min, range.max));
|
|
51
|
+
let max = Math.min(FULL_KEYBOARD.max, Math.max(range.min, range.max));
|
|
52
|
+
while (min > FULL_KEYBOARD.min && isBlackKey(min))
|
|
43
53
|
min -= 1;
|
|
44
|
-
while (max <
|
|
54
|
+
while (max < FULL_KEYBOARD.max && isBlackKey(max))
|
|
45
55
|
max += 1;
|
|
46
56
|
// If clamping left an edge black (the very ends of the piano), step inward.
|
|
47
57
|
while (isBlackKey(min) && min < max)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard-geometry.js","sourceRoot":"","sources":["../src/keyboard-geometry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EACL,YAAY,EACZ,gBAAgB,E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EAAE,UAAU,GAAG,aAAa,GAAG,UAAU,GAAG,CAAC;gBAC9C,KAAK,EAAE,UAAU;gBACjB,MAAM,EAAE,WAAW;gBACnB,sEAAsE;gBACtE,uEAAuE;gBACvE,8CAA8C;gBAC9C,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;gBAC3B,IAAI;gBACJ,2DAA2D;gBAC3D,QAAQ,EAAE,cAAc,GAAG,CAAC,GAAG,gBAAgB;aAChD,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI;gBACJ,OAAO,EAAE,KAAK;gBACd,CAAC,EAAE,UAAU,GAAG,aAAa;gBAC7B,KAAK,EAAE,aAAa;gBACpB,MAAM,EAAE,cAAc;gBACtB,KAAK;gBACL,IAAI;gBACJ,QAAQ,EAAE,cAAc,GAAG,CAAC;aAC7B,CAAC,CAAC;YACH,UAAU,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the keys are *called*, as against where they are.
|
|
3
|
+
*
|
|
4
|
+
* `keyboard-geometry.ts` answers where each key sits and names it from its own
|
|
5
|
+
* midi number — which is **sounding** pitch, because that is the one convention
|
|
6
|
+
* the model stores and the compass (`trackKeyboardRange`) is quoted in. That is
|
|
7
|
+
* right for everything except the one thing a reader compares a key against:
|
|
8
|
+
* the staff beside it, which in written-pitch mode is drawn through
|
|
9
|
+
* `writtenScore` and so disagrees with the keyboard by the instrument's
|
|
10
|
+
* interval.
|
|
11
|
+
*
|
|
12
|
+
* On a B-flat trumpet that disagreement is a whole tone, and it is silent: the
|
|
13
|
+
* key said `C4`, pressing it stored a sounding C4 — correctly, since the store
|
|
14
|
+
* holds sounding pitch — and the staff then drew the D4 the player reads. The
|
|
15
|
+
* note was right and the label was wrong, which is the worse of the two to
|
|
16
|
+
* debug because nothing about the score is broken.
|
|
17
|
+
*
|
|
18
|
+
* So the keys keep their sounding midi numbers — the audition, the lit keys
|
|
19
|
+
* during playback and the selected-chord marks are all keyed by it, and note
|
|
20
|
+
* entry stores it unconverted — and only the *labels* move. Press the key that
|
|
21
|
+
* reads `C4` and a C4 appears on the staff, because that key is the sounding
|
|
22
|
+
* B-flat 3 the trumpet writes as C.
|
|
23
|
+
*
|
|
24
|
+
* This is the same "one convention internally, converted at the edges" rule the
|
|
25
|
+
* inspector follows through `displayedPitchForNote`. The keyboard's edge is its
|
|
26
|
+
* lettering, so that is the only place the conversion belongs.
|
|
27
|
+
*
|
|
28
|
+
* A separate module from the geometry on purpose: nothing here is about
|
|
29
|
+
* position, and the geometry has no business knowing what a transposing
|
|
30
|
+
* instrument is.
|
|
31
|
+
*/
|
|
32
|
+
import { type PitchDisplay, type Track } from '@sudobility/music_types';
|
|
33
|
+
import type { PianoKey } from './keyboard-geometry.js';
|
|
34
|
+
/**
|
|
35
|
+
* How far a keyboard's labels move for `track`, given what the staff is showing.
|
|
36
|
+
*
|
|
37
|
+
* Zero in concert-pitch mode, zero with no track, and zero on a percussion
|
|
38
|
+
* track — `trackWrittenTransposition` already answers the last of those, since
|
|
39
|
+
* a drum staff's positions name drums rather than places in a compass. That
|
|
40
|
+
* zero is what keeps a kit's key labels ("Cl HH", "Bass Drum") out of
|
|
41
|
+
* `relabelKeys`' hands.
|
|
42
|
+
*/
|
|
43
|
+
export declare function keyboardLabelSemitones(track: Pick<Track, 'clef' | 'midiProgram'> | null | undefined, pitchDisplay: PitchDisplay): number;
|
|
44
|
+
/**
|
|
45
|
+
* `keys` lettered `semitones` away from what they sound.
|
|
46
|
+
*
|
|
47
|
+
* Returns the **identical array** at zero, which is every concert-pitch
|
|
48
|
+
* keyboard and every non-transposing instrument — the geometry is memoized on
|
|
49
|
+
* its inputs in both apps, and a fresh array per render would re-reconcile 88
|
|
50
|
+
* keys for nothing.
|
|
51
|
+
*
|
|
52
|
+
* Two things are deliberately left alone. Which keys carry a printed `label` is
|
|
53
|
+
* unchanged: those are the C and F landmarks of the black-key groups, and they
|
|
54
|
+
* are landmarks because of where they *are* — relabelling by written name would
|
|
55
|
+
* put the printed reference on a black key with no room for it. And the
|
|
56
|
+
* spelling stays sharp, like `noteLabel`'s, because a keyboard has no key
|
|
57
|
+
* signature to spell against; this moves a name by an interval, it does not
|
|
58
|
+
* respell a score.
|
|
59
|
+
*/
|
|
60
|
+
export declare function relabelKeys(keys: PianoKey[], semitones: number): PianoKey[];
|
|
61
|
+
//# sourceMappingURL=keyboard-labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard-labels.d.ts","sourceRoot":"","sources":["../src/keyboard-labels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,KAAK,EACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG,IAAI,GAAG,SAAS,EAC7D,YAAY,EAAE,YAAY,GACzB,MAAM,CAGR;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ,EAAE,CAU3E"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the keys are *called*, as against where they are.
|
|
3
|
+
*
|
|
4
|
+
* `keyboard-geometry.ts` answers where each key sits and names it from its own
|
|
5
|
+
* midi number — which is **sounding** pitch, because that is the one convention
|
|
6
|
+
* the model stores and the compass (`trackKeyboardRange`) is quoted in. That is
|
|
7
|
+
* right for everything except the one thing a reader compares a key against:
|
|
8
|
+
* the staff beside it, which in written-pitch mode is drawn through
|
|
9
|
+
* `writtenScore` and so disagrees with the keyboard by the instrument's
|
|
10
|
+
* interval.
|
|
11
|
+
*
|
|
12
|
+
* On a B-flat trumpet that disagreement is a whole tone, and it is silent: the
|
|
13
|
+
* key said `C4`, pressing it stored a sounding C4 — correctly, since the store
|
|
14
|
+
* holds sounding pitch — and the staff then drew the D4 the player reads. The
|
|
15
|
+
* note was right and the label was wrong, which is the worse of the two to
|
|
16
|
+
* debug because nothing about the score is broken.
|
|
17
|
+
*
|
|
18
|
+
* So the keys keep their sounding midi numbers — the audition, the lit keys
|
|
19
|
+
* during playback and the selected-chord marks are all keyed by it, and note
|
|
20
|
+
* entry stores it unconverted — and only the *labels* move. Press the key that
|
|
21
|
+
* reads `C4` and a C4 appears on the staff, because that key is the sounding
|
|
22
|
+
* B-flat 3 the trumpet writes as C.
|
|
23
|
+
*
|
|
24
|
+
* This is the same "one convention internally, converted at the edges" rule the
|
|
25
|
+
* inspector follows through `displayedPitchForNote`. The keyboard's edge is its
|
|
26
|
+
* lettering, so that is the only place the conversion belongs.
|
|
27
|
+
*
|
|
28
|
+
* A separate module from the geometry on purpose: nothing here is about
|
|
29
|
+
* position, and the geometry has no business knowing what a transposing
|
|
30
|
+
* instrument is.
|
|
31
|
+
*/
|
|
32
|
+
import { midiToPitch, pitchToString, trackWrittenTransposition, } from '@sudobility/music_types';
|
|
33
|
+
/**
|
|
34
|
+
* How far a keyboard's labels move for `track`, given what the staff is showing.
|
|
35
|
+
*
|
|
36
|
+
* Zero in concert-pitch mode, zero with no track, and zero on a percussion
|
|
37
|
+
* track — `trackWrittenTransposition` already answers the last of those, since
|
|
38
|
+
* a drum staff's positions name drums rather than places in a compass. That
|
|
39
|
+
* zero is what keeps a kit's key labels ("Cl HH", "Bass Drum") out of
|
|
40
|
+
* `relabelKeys`' hands.
|
|
41
|
+
*/
|
|
42
|
+
export function keyboardLabelSemitones(track, pitchDisplay) {
|
|
43
|
+
if (!track || pitchDisplay !== 'written')
|
|
44
|
+
return 0;
|
|
45
|
+
return trackWrittenTransposition(track);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* `keys` lettered `semitones` away from what they sound.
|
|
49
|
+
*
|
|
50
|
+
* Returns the **identical array** at zero, which is every concert-pitch
|
|
51
|
+
* keyboard and every non-transposing instrument — the geometry is memoized on
|
|
52
|
+
* its inputs in both apps, and a fresh array per render would re-reconcile 88
|
|
53
|
+
* keys for nothing.
|
|
54
|
+
*
|
|
55
|
+
* Two things are deliberately left alone. Which keys carry a printed `label` is
|
|
56
|
+
* unchanged: those are the C and F landmarks of the black-key groups, and they
|
|
57
|
+
* are landmarks because of where they *are* — relabelling by written name would
|
|
58
|
+
* put the printed reference on a black key with no room for it. And the
|
|
59
|
+
* spelling stays sharp, like `noteLabel`'s, because a keyboard has no key
|
|
60
|
+
* signature to spell against; this moves a name by an interval, it does not
|
|
61
|
+
* respell a score.
|
|
62
|
+
*/
|
|
63
|
+
export function relabelKeys(keys, semitones) {
|
|
64
|
+
if (semitones === 0)
|
|
65
|
+
return keys;
|
|
66
|
+
return keys.map(key => {
|
|
67
|
+
const written = pitchToString(midiToPitch(key.midi + semitones));
|
|
68
|
+
return {
|
|
69
|
+
...key,
|
|
70
|
+
label: key.label === null ? null : written,
|
|
71
|
+
name: written,
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=keyboard-labels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard-labels.js","sourceRoot":"","sources":["../src/keyboard-labels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EACL,WAAW,EACX,aAAa,EACb,yBAAyB,GAG1B,MAAM,yBAAyB,CAAC;AAGjC;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CACpC,KAA6D,EAC7D,YAA0B;IAE1B,IAAI,CAAC,KAAK,IAAI,YAAY,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC;IACnD,OAAO,yBAAyB,CAAC,KAAK,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,WAAW,CAAC,IAAgB,EAAE,SAAiB;IAC7D,IAAI,SAAS,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACjC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACpB,MAAM,OAAO,GAAG,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC;QACjE,OAAO;YACL,GAAG,GAAG;YACN,KAAK,EAAE,GAAG,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO;YAC1C,IAAI,EAAE,OAAO;SACd,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/note-color.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"note-color.d.ts","sourceRoot":"","sources":["../src/note-color.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"note-color.d.ts","sourceRoot":"","sources":["../src/note-color.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAwB7D;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,SAAS,GACzD,aAAa,CAUf;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAE1E;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,aAAa,EACnB,KAAK,EAAE,WAAW,EAClB,aAAa,UAAO,GACnB,MAAM,CAaR"}
|
package/dist/note-color.js
CHANGED
|
@@ -6,11 +6,17 @@
|
|
|
6
6
|
* Pressing play clears the selection, so `playing` and `selected` do not
|
|
7
7
|
* normally coexist — this ordering only resolves the case where the user
|
|
8
8
|
* selects notes while playback is already running.
|
|
9
|
+
*
|
|
10
|
+
* `outOfRange` sits below all three and above `normal`: it is a property of
|
|
11
|
+
* the music rather than something the reader just did, so selecting a note the
|
|
12
|
+
* instrument cannot play still reads as selected — but an unselected one has
|
|
13
|
+
* to be visible, or the mark is worth nothing.
|
|
9
14
|
*/
|
|
10
15
|
const PRECEDENCE = [
|
|
11
16
|
'playing',
|
|
12
17
|
'regenerated',
|
|
13
18
|
'selected',
|
|
19
|
+
'outOfRange',
|
|
14
20
|
'normal',
|
|
15
21
|
];
|
|
16
22
|
/**
|
|
@@ -74,6 +80,8 @@ export function noteColorFor(role, theme, onActiveTrack = true) {
|
|
|
74
80
|
return theme.noteRegenerated;
|
|
75
81
|
case 'selected':
|
|
76
82
|
return theme.noteSelected;
|
|
83
|
+
case 'outOfRange':
|
|
84
|
+
return theme.noteOutOfRange;
|
|
77
85
|
case 'normal':
|
|
78
86
|
return onActiveTrack ? theme.noteNormal : theme.noteInactive;
|
|
79
87
|
}
|
package/dist/note-color.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"note-color.js","sourceRoot":"","sources":["../src/note-color.ts"],"names":[],"mappings":"AAOA
|
|
1
|
+
{"version":3,"file":"note-color.js","sourceRoot":"","sources":["../src/note-color.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,GAA6B;IAC3C,SAAS;IACT,aAAa;IACb,UAAU;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UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;IACjE,CAAC;AACH,CAAC"}
|
package/dist/note-colors.d.ts
CHANGED
|
@@ -21,12 +21,22 @@ import type { NoteColorRole } from './types.js';
|
|
|
21
21
|
export type BuildNoteColorsParams = {
|
|
22
22
|
selectedIds: readonly string[];
|
|
23
23
|
playingIds: readonly string[];
|
|
24
|
+
/**
|
|
25
|
+
* Notes the instrument cannot play, outside its measured compass.
|
|
26
|
+
*
|
|
27
|
+
* Written FIRST, so anything the reader did — selecting, regenerating,
|
|
28
|
+
* playing — paints over it. A note being unplayable is a property of the
|
|
29
|
+
* music and keeps; a selection is what they are doing right now.
|
|
30
|
+
*/
|
|
31
|
+
outOfRangeIds?: readonly string[];
|
|
24
32
|
/** When true, selected notes colour as `regenerated` rather than `selected`. */
|
|
25
33
|
regenerated: boolean;
|
|
26
34
|
};
|
|
27
|
-
export declare function buildNoteColors({ selectedIds, playingIds, regenerated, }: BuildNoteColorsParams): Map<string, NoteColorRole>;
|
|
35
|
+
export declare function buildNoteColors({ selectedIds, playingIds, outOfRangeIds, regenerated, }: BuildNoteColorsParams): Map<string, NoteColorRole>;
|
|
28
36
|
export type NoteColorsForParams = {
|
|
29
37
|
selectedIds: readonly string[];
|
|
38
|
+
/** Notes outside their instrument's measured compass. */
|
|
39
|
+
outOfRangeIds?: readonly string[];
|
|
30
40
|
/** What the engine reports as sounding right now, across every track. */
|
|
31
41
|
sounding: readonly SoundingNote[];
|
|
32
42
|
/**
|
|
@@ -51,5 +61,5 @@ export type NoteColorsForParams = {
|
|
|
51
61
|
* being read goes dark whenever it rests. The piano keyboard already showed
|
|
52
62
|
* the active track alone, and this is what makes the notation agree with it.
|
|
53
63
|
*/
|
|
54
|
-
export declare function noteColorsFor({ selectedIds, sounding, activeTrackId, regenerated, }: NoteColorsForParams): Map<string, NoteColorRole>;
|
|
64
|
+
export declare function noteColorsFor({ selectedIds, outOfRangeIds, sounding, activeTrackId, regenerated, }: NoteColorsForParams): Map<string, NoteColorRole>;
|
|
55
65
|
//# sourceMappingURL=note-colors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"note-colors.d.ts","sourceRoot":"","sources":["../src/note-colors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,gFAAgF;IAChF,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,UAAU,EACV,WAAW,GACZ,EAAE,qBAAqB,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"note-colors.d.ts","sourceRoot":"","sources":["../src/note-colors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,gFAAgF;IAChF,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,UAAU,EACV,aAAa,EACb,WAAW,GACZ,EAAE,qBAAqB,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAOpD;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,yDAAyD;IACzD,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,yEAAyE;IACzE,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IAClC;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,EAC5B,WAAW,EACX,aAAa,EACb,QAAQ,EACR,aAAa,EACb,WAAW,GACZ,EAAE,mBAAmB,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CASlD"}
|
package/dist/note-colors.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export function buildNoteColors({ selectedIds, playingIds, regenerated, }) {
|
|
1
|
+
export function buildNoteColors({ selectedIds, playingIds, outOfRangeIds, regenerated, }) {
|
|
2
2
|
const colors = new Map();
|
|
3
3
|
const selectedRole = regenerated ? 'regenerated' : 'selected';
|
|
4
|
+
for (const id of outOfRangeIds ?? [])
|
|
5
|
+
colors.set(id, 'outOfRange');
|
|
4
6
|
for (const id of selectedIds)
|
|
5
7
|
colors.set(id, selectedRole);
|
|
6
8
|
for (const id of playingIds)
|
|
@@ -19,9 +21,10 @@ export function buildNoteColors({ selectedIds, playingIds, regenerated, }) {
|
|
|
19
21
|
* being read goes dark whenever it rests. The piano keyboard already showed
|
|
20
22
|
* the active track alone, and this is what makes the notation agree with it.
|
|
21
23
|
*/
|
|
22
|
-
export function noteColorsFor({ selectedIds, sounding, activeTrackId, regenerated, }) {
|
|
24
|
+
export function noteColorsFor({ selectedIds, outOfRangeIds, sounding, activeTrackId, regenerated, }) {
|
|
23
25
|
return buildNoteColors({
|
|
24
26
|
selectedIds,
|
|
27
|
+
...(outOfRangeIds ? { outOfRangeIds } : {}),
|
|
25
28
|
playingIds: sounding
|
|
26
29
|
.filter(note => note.trackId === activeTrackId)
|
|
27
30
|
.map(note => note.noteId),
|
package/dist/note-colors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"note-colors.js","sourceRoot":"","sources":["../src/note-colors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"note-colors.js","sourceRoot":"","sources":["../src/note-colors.ts"],"names":[],"mappings":"AAoCA,MAAM,UAAU,eAAe,CAAC,EAC9B,WAAW,EACX,UAAU,EACV,aAAa,EACb,WAAW,GACW;IACtB,MAAM,MAAM,GAAG,IAAI,GAAG,EAAyB,CAAC;IAChD,MAAM,YAAY,GAAkB,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC;IAC7E,KAAK,MAAM,EAAE,IAAI,aAAa,IAAI,EAAE;QAAE,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;IACnE,KAAK,MAAM,EAAE,IAAI,WAAW;QAAE,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;IAC3D,KAAK,MAAM,EAAE,IAAI,UAAU;QAAE,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IACvD,OAAO,MAAM,CAAC;AAChB,CAAC;AAmBD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,WAAW,EACX,aAAa,EACb,QAAQ,EACR,aAAa,EACb,WAAW,GACS;IACpB,OAAO,eAAe,CAAC;QACrB,WAAW;QACX,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3C,UAAU,EAAE,QAAQ;aACjB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,aAAa,CAAC;aAC9C,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC;QAC3B,WAAW;KACZ,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notes an instrument cannot play, found in a score that already holds them.
|
|
3
|
+
*
|
|
4
|
+
* Here rather than in an app for the reason `note-colors.ts` beside it gives:
|
|
5
|
+
* two apps draw this score, and "which notes are lit, and why" having two
|
|
6
|
+
* answers is how the native app came to light nothing at all during playback.
|
|
7
|
+
*
|
|
8
|
+
* The compass lives in one place — `gm-catalogue.ts`, reached through
|
|
9
|
+
* `trackKeyboardRange` — and three of the four surfaces that care already read
|
|
10
|
+
* it: the keyboard shows exactly that span, generation now states it in the
|
|
11
|
+
* prompt, and `inspect.ts` judges a generated part against it. The notation is
|
|
12
|
+
* the exception, by design: it draws what the score holds, because a score is
|
|
13
|
+
* not only ever a generated one.
|
|
14
|
+
*
|
|
15
|
+
* That is the disagreement a reader actually meets. A timpani part written a
|
|
16
|
+
* fifth below its lowest drum draws perfectly well on the stave and cannot
|
|
17
|
+
* light a single key on the keyboard — measured on one project, 482 of 1,067
|
|
18
|
+
* notes. Nothing here rewrites those notes: they are marked, and moving them
|
|
19
|
+
* by an octave is a musical decision that belongs to the person reading, not
|
|
20
|
+
* to a scan.
|
|
21
|
+
*
|
|
22
|
+
* Gated on `trackRangeIsBinding`, the same condition the server applies, so the
|
|
23
|
+
* page and the server cannot disagree about what counts as out of range. A
|
|
24
|
+
* compass nobody verified marks nothing.
|
|
25
|
+
*
|
|
26
|
+
* ## Sounding pitch, and so the STORED score
|
|
27
|
+
*
|
|
28
|
+
* Every number in `gm-catalogue.ts` is sounding pitch, and `midiIsInRange` is
|
|
29
|
+
* documented as taking one. The score this package *draws* is not: the app
|
|
30
|
+
* hands `render` a `displayScore(score, pitchDisplay)`, which in written mode
|
|
31
|
+
* has moved a B-flat clarinet up a tone and, in every mode, has moved an
|
|
32
|
+
* `8va`'s noteheads down an octave. Scanning that would place a clarinet's
|
|
33
|
+
* whole part a tone above where it sounds and mark the top of it wrongly.
|
|
34
|
+
*
|
|
35
|
+
* So this takes the **stored** score — the one the app holds, before the
|
|
36
|
+
* lenses — and the result stays correct in either display mode because it is
|
|
37
|
+
* expressed as event **ids**, which both lenses preserve: `transposeEvents`
|
|
38
|
+
* and `ottavaScore` spread `...event` and replace only `pitch`. The renderer
|
|
39
|
+
* colours by id, so "which notes" survives a transposition that changes what
|
|
40
|
+
* those notes look like. `out-of-range.test.ts` pins that with a clarinet.
|
|
41
|
+
*/
|
|
42
|
+
import { type MidiRange, type Score } from '@sudobility/music_types';
|
|
43
|
+
export type OutOfRangeTrack = {
|
|
44
|
+
trackId: string;
|
|
45
|
+
name: string;
|
|
46
|
+
/** What the instrument can play. */
|
|
47
|
+
compass: MidiRange;
|
|
48
|
+
/** How many notes fall outside it. */
|
|
49
|
+
count: number;
|
|
50
|
+
/** The distinct pitches that do, lowest first. */
|
|
51
|
+
midis: number[];
|
|
52
|
+
};
|
|
53
|
+
export type OutOfRangeScan = {
|
|
54
|
+
/** Every offending note id, for the notation's colours. */
|
|
55
|
+
ids: string[];
|
|
56
|
+
/** One entry per track that has any, for the inspector's sentence. */
|
|
57
|
+
byTrack: OutOfRangeTrack[];
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Every note `score` holds that its own instrument cannot play.
|
|
61
|
+
*
|
|
62
|
+
* `score` is the **stored** score — sounding pitch, before `displayScore`. Do
|
|
63
|
+
* not pass the score handed to `render`; see this module's doc for why, and
|
|
64
|
+
* why the ids come back usable in either display mode anyway.
|
|
65
|
+
*/
|
|
66
|
+
export declare function outOfRangeNoteIds(score: Score | null): OutOfRangeScan;
|
|
67
|
+
//# sourceMappingURL=out-of-range.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"out-of-range.d.ts","sourceRoot":"","sources":["../src/out-of-range.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,KAAK,EACX,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,OAAO,EAAE,SAAS,CAAC;IACnB,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,2DAA2D;IAC3D,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,sEAAsE;IACtE,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B,CAAC;AAIF;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,GAAG,cAAc,CAiDrE"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notes an instrument cannot play, found in a score that already holds them.
|
|
3
|
+
*
|
|
4
|
+
* Here rather than in an app for the reason `note-colors.ts` beside it gives:
|
|
5
|
+
* two apps draw this score, and "which notes are lit, and why" having two
|
|
6
|
+
* answers is how the native app came to light nothing at all during playback.
|
|
7
|
+
*
|
|
8
|
+
* The compass lives in one place — `gm-catalogue.ts`, reached through
|
|
9
|
+
* `trackKeyboardRange` — and three of the four surfaces that care already read
|
|
10
|
+
* it: the keyboard shows exactly that span, generation now states it in the
|
|
11
|
+
* prompt, and `inspect.ts` judges a generated part against it. The notation is
|
|
12
|
+
* the exception, by design: it draws what the score holds, because a score is
|
|
13
|
+
* not only ever a generated one.
|
|
14
|
+
*
|
|
15
|
+
* That is the disagreement a reader actually meets. A timpani part written a
|
|
16
|
+
* fifth below its lowest drum draws perfectly well on the stave and cannot
|
|
17
|
+
* light a single key on the keyboard — measured on one project, 482 of 1,067
|
|
18
|
+
* notes. Nothing here rewrites those notes: they are marked, and moving them
|
|
19
|
+
* by an octave is a musical decision that belongs to the person reading, not
|
|
20
|
+
* to a scan.
|
|
21
|
+
*
|
|
22
|
+
* Gated on `trackRangeIsBinding`, the same condition the server applies, so the
|
|
23
|
+
* page and the server cannot disagree about what counts as out of range. A
|
|
24
|
+
* compass nobody verified marks nothing.
|
|
25
|
+
*
|
|
26
|
+
* ## Sounding pitch, and so the STORED score
|
|
27
|
+
*
|
|
28
|
+
* Every number in `gm-catalogue.ts` is sounding pitch, and `midiIsInRange` is
|
|
29
|
+
* documented as taking one. The score this package *draws* is not: the app
|
|
30
|
+
* hands `render` a `displayScore(score, pitchDisplay)`, which in written mode
|
|
31
|
+
* has moved a B-flat clarinet up a tone and, in every mode, has moved an
|
|
32
|
+
* `8va`'s noteheads down an octave. Scanning that would place a clarinet's
|
|
33
|
+
* whole part a tone above where it sounds and mark the top of it wrongly.
|
|
34
|
+
*
|
|
35
|
+
* So this takes the **stored** score — the one the app holds, before the
|
|
36
|
+
* lenses — and the result stays correct in either display mode because it is
|
|
37
|
+
* expressed as event **ids**, which both lenses preserve: `transposeEvents`
|
|
38
|
+
* and `ottavaScore` spread `...event` and replace only `pitch`. The renderer
|
|
39
|
+
* colours by id, so "which notes" survives a transposition that changes what
|
|
40
|
+
* those notes look like. `out-of-range.test.ts` pins that with a clarinet.
|
|
41
|
+
*/
|
|
42
|
+
import { isNoteEvent, isPercussionTrack, midiIsInRange, pitchToMidi, trackKeyboardRange, trackRangeIsBinding, } from '@sudobility/music_types';
|
|
43
|
+
const EMPTY = { ids: [], byTrack: [] };
|
|
44
|
+
/**
|
|
45
|
+
* Every note `score` holds that its own instrument cannot play.
|
|
46
|
+
*
|
|
47
|
+
* `score` is the **stored** score — sounding pitch, before `displayScore`. Do
|
|
48
|
+
* not pass the score handed to `render`; see this module's doc for why, and
|
|
49
|
+
* why the ids come back usable in either display mode anyway.
|
|
50
|
+
*/
|
|
51
|
+
export function outOfRangeNoteIds(score) {
|
|
52
|
+
if (!score)
|
|
53
|
+
return EMPTY;
|
|
54
|
+
const ids = [];
|
|
55
|
+
const byTrack = [];
|
|
56
|
+
for (const track of score.tracks) {
|
|
57
|
+
/*
|
|
58
|
+
* A drum pitch names a drum rather than a place in a compass, so this test
|
|
59
|
+
* comes FIRST and is not folded into the gate below it.
|
|
60
|
+
*
|
|
61
|
+
* `trackRangeIsBinding` answers **true** for percussion on purpose — a kit
|
|
62
|
+
* has the pieces it has, which is the right answer for note entry and for
|
|
63
|
+
* generation, where refusing an address no drum sits at is a service. It is
|
|
64
|
+
* the wrong answer here: `percussion.ts` already handles a drum outside
|
|
65
|
+
* `GM_PERCUSSION_RANGE` by parking it on the middle line as `UNMAPPED`, and
|
|
66
|
+
* colouring it as well would be two marks for one fact.
|
|
67
|
+
*/
|
|
68
|
+
if (isPercussionTrack(track))
|
|
69
|
+
continue;
|
|
70
|
+
if (!trackRangeIsBinding(track))
|
|
71
|
+
continue;
|
|
72
|
+
const compass = trackKeyboardRange(track);
|
|
73
|
+
const midis = new Set();
|
|
74
|
+
let count = 0;
|
|
75
|
+
for (const measure of track.measures) {
|
|
76
|
+
for (const voice of measure.voices) {
|
|
77
|
+
for (const event of voice.events) {
|
|
78
|
+
if (!isNoteEvent(event))
|
|
79
|
+
continue;
|
|
80
|
+
const midi = pitchToMidi(event.pitch);
|
|
81
|
+
if (midiIsInRange(midi, compass))
|
|
82
|
+
continue;
|
|
83
|
+
ids.push(event.id);
|
|
84
|
+
midis.add(midi);
|
|
85
|
+
count += 1;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (count > 0) {
|
|
90
|
+
byTrack.push({
|
|
91
|
+
trackId: track.id,
|
|
92
|
+
name: track.name,
|
|
93
|
+
compass,
|
|
94
|
+
count,
|
|
95
|
+
midis: [...midis].sort((a, b) => a - b),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return ids.length > 0 ? { ids, byTrack } : EMPTY;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=out-of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O,CAAC;wBAAE,SAAS;oBAC3C,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;oBACnB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;oBAChB,KAAK,IAAI,CAAC,CAAC;gBACb,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YACd,OAAO,CAAC,IAAI,CAAC;gBACX,OAAO,EAAE,KAAK,CAAC,EAAE;gBACjB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,OAAO;gBACP,KAAK;gBACL,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;aACxC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AACnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-theme.d.ts","sourceRoot":"","sources":["../src/render-theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"render-theme.d.ts","sourceRoot":"","sources":["../src/render-theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,kBAAkB,EAAE,WAWhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,WAW/B,CAAC"}
|
package/dist/render-theme.js
CHANGED
|
@@ -5,6 +5,7 @@ export const LIGHT_RENDER_THEME = {
|
|
|
5
5
|
noteSelected: '#6d28d9',
|
|
6
6
|
noteRegenerated: '#8b5a2b',
|
|
7
7
|
notePlaying: '#1565c0',
|
|
8
|
+
noteOutOfRange: '#c2185b',
|
|
8
9
|
staveActive: '#000000',
|
|
9
10
|
staveInactive: '#71717a',
|
|
10
11
|
caret: '#d32f2f',
|
|
@@ -16,6 +17,7 @@ export const DARK_RENDER_THEME = {
|
|
|
16
17
|
noteSelected: '#a78bfa',
|
|
17
18
|
noteRegenerated: '#d9a066',
|
|
18
19
|
notePlaying: '#64b5f6',
|
|
20
|
+
noteOutOfRange: '#f06292',
|
|
19
21
|
staveActive: '#ffffff',
|
|
20
22
|
staveInactive: '#8a8a93',
|
|
21
23
|
caret: '#ef5350',
|
package/dist/render-theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-theme.js","sourceRoot":"","sources":["../src/render-theme.ts"],"names":[],"mappings":"AA4BA,MAAM,CAAC,MAAM,kBAAkB,GAAgB;IAC7C,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;IACrB,YAAY,EAAE,SAAS;IACvB,YAAY,EAAE,SAAS;IACvB,eAAe,EAAE,SAAS;IAC1B,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,SAAS;IACtB,aAAa,EAAE,SAAS;IACxB,KAAK,EAAE,SAAS;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAgB;IAC5C,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;IACrB,YAAY,EAAE,SAAS;IACvB,YAAY,EAAE,SAAS;IACvB,eAAe,EAAE,SAAS;IAC1B,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,SAAS;IACtB,aAAa,EAAE,SAAS;IACxB,KAAK,EAAE,SAAS;CACjB,CAAC"}
|
|
1
|
+
{"version":3,"file":"render-theme.js","sourceRoot":"","sources":["../src/render-theme.ts"],"names":[],"mappings":"AA4BA,MAAM,CAAC,MAAM,kBAAkB,GAAgB;IAC7C,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;IACrB,YAAY,EAAE,SAAS;IACvB,YAAY,EAAE,SAAS;IACvB,eAAe,EAAE,SAAS;IAC1B,WAAW,EAAE,SAAS;IACtB,cAAc,EAAE,SAAS;IACzB,WAAW,EAAE,SAAS;IACtB,aAAa,EAAE,SAAS;IACxB,KAAK,EAAE,SAAS;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAgB;IAC5C,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;IACrB,YAAY,EAAE,SAAS;IACvB,YAAY,EAAE,SAAS;IACvB,eAAe,EAAE,SAAS;IAC1B,WAAW,EAAE,SAAS;IACtB,cAAc,EAAE,SAAS;IACzB,WAAW,EAAE,SAAS;IACtB,aAAa,EAAE,SAAS;IACxB,KAAK,EAAE,SAAS;CACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/test/fixtures.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAc,8BAA8B,CAAC;AAc7C,OAAO,KAAK,EAAsB,KAAK,EAAS,MAAM,yBAAyB,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;GAMG;AACH,wBAAgB,eAAe,IAAI,WAAW,
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/test/fixtures.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAc,8BAA8B,CAAC;AAc7C,OAAO,KAAK,EAAsB,KAAK,EAAS,MAAM,yBAAyB,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;GAMG;AACH,wBAAgB,eAAe,IAAI,WAAW,CAa7C;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,YAAY,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c,EAAE,OAAO;YACvB,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,CAAC;YACd,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,QAAkB,CAAC,CAAC,CAAE,MAAgB;YACvD,MAAM,EAAE,CAAC;YACT,GAAG,EAAE,CAAC;YACN,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,KAAK;YACX,QAAQ;SACT,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;QACrB,OAAO,EAAE,CAAC;QACV,GAAG;QACH,QAAQ,EAAE;YACR,KAAK,EAAE,OAAO;YACd,SAAS,EAAE,eAAe;YAC1B,SAAS,EAAE,eAAe;SAC3B;QACD,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;QACxD,MAAM;KACP,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* them rather than by editing their fields.
|
|
7
7
|
*/
|
|
8
8
|
/** How a note is colored, by state. See `note-color.ts`'s `resolveNoteColorRole` for precedence. */
|
|
9
|
-
export type NoteColorRole = 'normal' | 'selected' | 'regenerated' | 'playing';
|
|
9
|
+
export type NoteColorRole = 'normal' | 'selected' | 'regenerated' | 'playing' | 'outOfRange';
|
|
10
10
|
export type RenderMode = 'screen' | 'print';
|
|
11
11
|
type RenderDisplayOptions = {
|
|
12
12
|
renderMode?: RenderMode;
|
|
@@ -48,6 +48,18 @@ export type RenderTheme = {
|
|
|
48
48
|
noteSelected: string;
|
|
49
49
|
noteRegenerated: string;
|
|
50
50
|
notePlaying: string;
|
|
51
|
+
/**
|
|
52
|
+
* A note the instrument cannot play — outside its compass in
|
|
53
|
+
* `gm-catalogue.ts`, on a program whose compass was actually measured.
|
|
54
|
+
*
|
|
55
|
+
* The notation is the one surface that will draw anything it is given: the
|
|
56
|
+
* keyboard knows the compass and simply cannot light such a note, which is
|
|
57
|
+
* what made a timpani part written a fifth too low invisible until somebody
|
|
58
|
+
* compared the two. Colour rather than an overlay, because every other note
|
|
59
|
+
* state here is colour and a second mechanism would be a second thing to
|
|
60
|
+
* reason about.
|
|
61
|
+
*/
|
|
62
|
+
noteOutOfRange: string;
|
|
51
63
|
/**
|
|
52
64
|
* Large translucent fill behind a selected measure. Defaults to
|
|
53
65
|
* `noteSelected` for existing callers, but can be softer than the selected
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,oGAAoG;AACpG,MAAM,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,oGAAoG;AACpG,MAAM,MAAM,aAAa,GACvB,QAAQ,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,CAAC;AAEnE,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE5C,KAAK,oBAAoB,GAAG;IAC1B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,UAAU,CAIvE;AAED,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAE1E;AAED;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,4EAA4E;IAC5E,UAAU,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;OAUG;I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;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,WAAW,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -33,6 +33,7 @@ export const DEFAULT_SCREEN_RENDER_THEME = {
|
|
|
33
33
|
noteSelected: '#050816',
|
|
34
34
|
noteRegenerated: '#2563eb',
|
|
35
35
|
notePlaying: '#0f766e',
|
|
36
|
+
noteOutOfRange: '#b91c1c',
|
|
36
37
|
measureSelection: '#f59e0b',
|
|
37
38
|
staveActive: '#64748b',
|
|
38
39
|
staveInactive: '#c3ccd8',
|
|
@@ -47,6 +48,12 @@ export const DEFAULT_PRINT_RENDER_THEME = {
|
|
|
47
48
|
noteSelected: PRINT_INK,
|
|
48
49
|
noteRegenerated: PRINT_INK,
|
|
49
50
|
notePlaying: PRINT_INK,
|
|
51
|
+
/*
|
|
52
|
+
Ink on paper, like every other state here: a printed part has no compass
|
|
53
|
+
warning to give, and a grey note among black ones reads as a mistake in
|
|
54
|
+
the printing rather than in the music.
|
|
55
|
+
*/
|
|
56
|
+
noteOutOfRange: PRINT_INK,
|
|
50
57
|
measureSelection: PRINT_INK,
|
|
51
58
|
staveActive: PRINT_INK,
|
|
52
59
|
staveInactive: PRINT_INK,
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,OAA6B;IACzD,OAAO,CACL,O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
{
|
|
2
2
|
"name": "@sudobility/music_drawing",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
4
4
|
"description": "Canvas score rendering for Moosiac: layout, VexFlow drawing and the paint loop.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"vexflow": "^4.2.5"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@sudobility/music_types": "^0.13.
|
|
47
|
+
"@sudobility/music_types": "^0.13.23"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@eslint/js": "^9.38.0",
|
|
51
|
-
"@sudobility/music_types": "^0.13.
|
|
51
|
+
"@sudobility/music_types": "^0.13.23",
|
|
52
52
|
"@sudobility/types": "^1.9.67",
|
|
53
53
|
"@tonejs/midi": "^2.0.28",
|
|
54
54
|
"@types/jsdom": "^30.0.0",
|