@dsebastien/music-notation 0.16.0 → 0.18.0

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/README.md CHANGED
@@ -186,7 +186,7 @@ Add this to your site's `publish.js`. It loads the bundle only on pages that hav
186
186
 
187
187
  ```js
188
188
  ;(() => {
189
- const VERSION = '0.14.0'
189
+ const VERSION = '0.17.0'
190
190
  const CDN = `https://cdn.jsdelivr.net/npm/@dsebastien/music-notation@${VERSION}/dist`
191
191
  const selector = (languages) => languages.map((l) => `pre > code.language-${l}`).join(', ')
192
192
  const BLOCKS = selector([
@@ -22,6 +22,13 @@ export interface PianoFingering {
22
22
  /** Spelling per pitch class (C# or Db), as the chord spells its notes; sharps when absent. */
23
23
  names?: ReadonlyMap<number, string>;
24
24
  }
25
+ /**
26
+ * What players call each string. When every name is different, or only the two outer strings share
27
+ * one (low E and high E), by name: "the A string", "the low E string". Otherwise (drop D, DADGAD,
28
+ * open tunings) two strings could read alike, so every string is named by its number and note:
29
+ * "the 4th string (D)". Without a tuning, numbers only.
30
+ */
31
+ export declare function stringNames(tuning: readonly number[] | null, count: number, spelled?: readonly string[]): string[];
25
32
  /**
26
33
  * The fingering of a chord in plain sentences, in the order a player sets the hand: for a fretted
27
34
  * chord the capo, the strings to strum, barres and fingers (low string first), muted strings
@@ -25,6 +25,9 @@ export interface TransitionOptions {
25
25
  fromFingers?: (string | null)[];
26
26
  /** How many of the next chord's easiest voicings to consider (30 by default). */
27
27
  candidates?: number;
28
+ /** The open strings' names as the tuning is written (Eb Ab Db…, see `tuningNames`): tips
29
+ * spell them so; else from the pitches, with sharps. */
30
+ tuningNames?: readonly string[];
28
31
  }
29
32
  /**
30
33
  * The next chord's voicings, ranked by how easily the hand gets there from the one it holds:
@@ -41,6 +44,8 @@ export interface ProgressionOptions {
41
44
  tuning?: number[];
42
45
  /** How many of each chord's easiest voicings to weigh (12 by default). */
43
46
  candidates?: number;
47
+ /** The open strings' names as the tuning is written (see `TransitionOptions`). */
48
+ tuningNames?: readonly string[];
44
49
  /** The voicing database (see `/voicings`): its voicings of each chord are weighed too, and
45
50
  * preferred. Only used in standard tuning. */
46
51
  voicings?: VoicingLookup;
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export { soundingChord, soundsLike, fretsFromCapo, capoTuning, parseCapo, parseF
7
7
  export { generateVoicings, fingerVoicing, voicingShape, MAX_GENERATED_STRINGS, type GeneratedVoicing, type VoicingOptions, type VoicingShape } from './chord/generate.js';
8
8
  export { sequenceOf, scaleRun, lengthOf, lightPlayer, pluckedString, pianoTone, DEFAULT_SEQUENCE, DEFAULT_STRUM, type NoteEvent, type NotePlayer, type PluckOptions, type PlayHandle, type PlayKind, type Sound, type SequenceOptions } from './playback/player.js';
9
9
  export { attachPlayback, type PlayOptions, type TimedBar } from './playback/controls.js';
10
+ export { volumeChanged } from './playback/live-volume.js';
10
11
  export { followNotes, noteTargets, PLAYING_CLASS, START_WAIT, type Follower } from './playback/follow.js';
11
12
  export { transition, smoothProgression, type TransitionStep, type TransitionOptions, type ProgressionStep, type ProgressionOptions } from './chord/transitions.js';
12
13
  export { fingeringInWords, type GuitarFingering, type PianoFingering } from './chord/fingering-words.js';
package/dist/index.js CHANGED
@@ -422,6 +422,8 @@ var SIGN = "(##|bb|#|b|♯|♭)?";
422
422
  var syllableLetter = (syllable) => SYLLABLE_LETTER[plain2(syllable)];
423
423
  var AFTER_ROOT = /^(?:$|[0-9/(+°øΔ^-]|m|M|a(?:dd|ug|lt)|sus|dim)/;
424
424
  var QUALITY_WORD = /^(?:[0-9(+°øΔ^]|m|M|a(?:dd|ug|lt)|sus|dim)/;
425
+ var WORD_QUALITY = /^(?:major|minor)$/i;
426
+ var joinsAsQuality = (word) => QUALITY_WORD.test(word) && !WORD_QUALITY.test(word);
425
427
  var reads = (letters) => midiOf(letters) !== null || /^[A-G]/.test(letters) && parseChord(letters) !== null;
426
428
  function rootToken(token, naming, h, solfegeLine = false) {
427
429
  const b = naming === "german" ? /^B(?![#♯b♭x])(.*)$/.exec(token) : null;
@@ -492,7 +494,7 @@ function read(text, naming, options, changes) {
492
494
  let out = text.normalize("NFC").replace(new RegExp(`(^|[\\s,/|])${SYLLABLE}\\s+(dièse|diese|bémol|bemol)(?=$|[\\s,|])`, "g"), (_, before, syllable, sign) => `${before}${syllable}${/^d/.test(sign) ? "#" : "b"}`);
493
495
  if (options.chord) {
494
496
  const joined = new RegExp(`^\\s*${SYLLABLE}${SIGN}\\s+(\\S+)\\s*$`).exec(out);
495
- if (joined && QUALITY_WORD.test(joined[3])) {
497
+ if (joined && joinsAsQuality(joined[3])) {
496
498
  const word = `${joined[1]}${joined[2] ?? ""}${joined[3]}`;
497
499
  const letters = rootToken(word, naming, h) ?? letterPiece(word, naming, h);
498
500
  if (letters !== word) {
@@ -505,7 +507,7 @@ function read(text, naming, options, changes) {
505
507
  for (let i = 0;i + 2 < words.length; i += 2) {
506
508
  const head = words[i];
507
509
  const next = words[i + 2];
508
- if (!syllableOnly(head) || !QUALITY_WORD.test(next))
510
+ if (!syllableOnly(head) || !joinsAsQuality(next))
509
511
  continue;
510
512
  if (naming !== "solfege" && reads(head))
511
513
  continue;
@@ -1818,10 +1820,10 @@ var STACKED = {
1818
1820
  "3M 5P 7M": "maj7",
1819
1821
  "3M 5P 7m": "7",
1820
1822
  "3m 5P 7m": "m7",
1821
- "3m 5P 7M": "mMaj7",
1823
+ "3m 5P 7M": "m(maj7)",
1822
1824
  "3m 5d 7m": "m7b5",
1823
1825
  "3m 5d 7d": "dim7",
1824
- "3M 5A 7M": "maj7#5",
1826
+ "3M 5A 7M": "+maj7",
1825
1827
  "3M 5A 7m": "7#5",
1826
1828
  "3M 5d 7m": "7b5"
1827
1829
  };
@@ -1850,14 +1852,18 @@ function numeralQuality(suffix) {
1850
1852
  case "aug":
1851
1853
  return { lower: false, mark: "+" };
1852
1854
  case "mMaj7":
1853
- return { lower: true, mark: "maj7" };
1855
+ case "m(maj7)":
1856
+ return { lower: true, mark: "(maj7)" };
1857
+ case "maj7#5":
1858
+ case "+maj7":
1859
+ return { lower: false, mark: "+maj7" };
1854
1860
  }
1855
1861
  if (/^m(?!aj)/.test(suffix))
1856
1862
  return { lower: true, mark: suffix.slice(1) };
1857
1863
  return { lower: false, mark: suffix };
1858
1864
  }
1859
1865
  function nashvilleQuality(suffix) {
1860
- return { dim: "°", dim7: "°7", m7b5: "ø7", aug: "+" }[suffix] ?? (suffix === "mMaj7" ? "mmaj7" : suffix);
1866
+ return { dim: "°", dim7: "°7", m7b5: "ø7", aug: "+" }[suffix] ?? (suffix === "mMaj7" ? "m(maj7)" : suffix === "maj7#5" ? "+maj7" : suffix);
1861
1867
  }
1862
1868
  function degreeOf(tonic, note, minorKey = false) {
1863
1869
  if (chromaOf(note) === null || chromaOf(tonic) === null)
@@ -4217,6 +4223,11 @@ function lightPlayer(win, random = Math.random) {
4217
4223
  } catch {}
4218
4224
  }
4219
4225
  cleanup = win.setTimeout(finish, 80);
4226
+ },
4227
+ setVolume(next) {
4228
+ if (stopped || !Number.isFinite(next))
4229
+ return;
4230
+ gain.gain.setTargetAtTime(Math.min(1, Math.max(0, next)), ctx.currentTime, 0.015);
4220
4231
  }
4221
4232
  };
4222
4233
  }
@@ -4366,6 +4377,32 @@ function followNotes(win, drawing, targets, events, wait = START_WAIT) {
4366
4377
  };
4367
4378
  }
4368
4379
 
4380
+ // src/playback/live-volume.ts
4381
+ var listeners = new Set;
4382
+ var level = (value) => typeof value === "number" && Number.isFinite(value) ? Math.min(1, Math.max(0, value)) : null;
4383
+ function volumeChanged() {
4384
+ for (const listener of [...listeners]) {
4385
+ try {
4386
+ listener();
4387
+ } catch {}
4388
+ }
4389
+ }
4390
+ function followVolume(read, handles, start) {
4391
+ let last = level(start);
4392
+ const listener = () => {
4393
+ const now = level(read());
4394
+ if (now === null || now === last)
4395
+ return;
4396
+ last = now;
4397
+ for (const h of handles())
4398
+ h.setVolume?.(now);
4399
+ };
4400
+ listeners.add(listener);
4401
+ return () => {
4402
+ listeners.delete(listener);
4403
+ };
4404
+ }
4405
+
4369
4406
  // src/strum/play.ts
4370
4407
  function scoreOf(pattern, voicing) {
4371
4408
  const changes = pattern.slots.filter((s) => s.chord);
@@ -4474,14 +4511,16 @@ function runPasses(make, player, settings, timers, onEnd, follow) {
4474
4511
  let stopped = false;
4475
4512
  let timer;
4476
4513
  let pass = 0;
4514
+ const handles = [];
4515
+ const unfollow = followVolume(() => settings().volume, () => handles, settings().volume);
4477
4516
  let anchor = null;
4478
4517
  let elapsed = 0;
4479
- const handles = [];
4480
4518
  const followers = [];
4481
4519
  const finish = () => {
4482
4520
  if (stopped)
4483
4521
  return;
4484
4522
  stopped = true;
4523
+ unfollow();
4485
4524
  onEnd?.();
4486
4525
  };
4487
4526
  const schedule = (looping) => {
@@ -4550,6 +4589,7 @@ function runPasses(make, player, settings, timers, onEnd, follow) {
4550
4589
  return {
4551
4590
  stop() {
4552
4591
  stopped = true;
4592
+ unfollow();
4553
4593
  timers.clearTimeout(timer);
4554
4594
  for (const h of handles)
4555
4595
  h.stop();
@@ -5105,6 +5145,7 @@ function renderFretboard(doc, set, options = {}) {
5105
5145
  // src/playback/bar-parts.ts
5106
5146
  var ICONS = {
5107
5147
  play: "M4 2.5v11l9-5.5z",
5148
+ pause: "M4 3h3v10H4zM9 3h3v10H9z",
5108
5149
  stop: "M4 4h8v8H4z",
5109
5150
  all: "M1.5 2.5v11l6.5-5.5zM8 2.5v11l6.5-5.5z",
5110
5151
  loop: "M3 8a5 5 0 0 1 8.5-3.5L13 6V2.5M13 8a5 5 0 0 1-8.5 3.5L3 10v3.5",
@@ -6197,17 +6238,32 @@ function diagramGroup(doc, win, diagrams, options, how) {
6197
6238
  sawStart(player);
6198
6239
  follower.heard();
6199
6240
  };
6241
+ const volume = volumeOf(options.volume);
6242
+ let handle = null;
6243
+ const unfollow = followVolume(() => volumeOf(options.volume), () => handle ? [handle] : [], volume);
6200
6244
  try {
6201
- return player.play(events, {
6245
+ handle = player.play(events, {
6202
6246
  sound: soundOf(item),
6203
- volume: volumeOf(options.volume),
6204
- onEnd,
6247
+ volume,
6248
+ onEnd: () => {
6249
+ unfollow();
6250
+ onEnd();
6251
+ },
6205
6252
  onStart
6206
6253
  });
6207
6254
  } catch (error) {
6255
+ unfollow();
6208
6256
  follower.stop();
6209
6257
  throw error;
6210
6258
  }
6259
+ const played = handle;
6260
+ return {
6261
+ stop() {
6262
+ unfollow();
6263
+ played.stop();
6264
+ },
6265
+ setVolume: (next) => played.setVolume?.(next)
6266
+ };
6211
6267
  };
6212
6268
  try {
6213
6269
  return run(playerFor(here, options));
@@ -6699,6 +6755,7 @@ var DIRECTIONS = {
6699
6755
  ArrowUp: [0, -1],
6700
6756
  ArrowDown: [0, 1]
6701
6757
  };
6758
+ var TOUCH = ["touchstart", "touchend"];
6702
6759
  var RESULT_CLASS = { right: "mn-pick-right", wrong: "mn-pick-wrong" };
6703
6760
  var num = (el, name) => Number(el.getAttribute(name));
6704
6761
  var optional = (el, name) => el.hasAttribute(name) ? num(el, name) : null;
@@ -6863,6 +6920,8 @@ function attachPick(diagram, options = {}) {
6863
6920
  }
6864
6921
  for (const type of ["pointerdown", "mousedown"])
6865
6922
  diagram.addEventListener(type, onPress);
6923
+ for (const type of TOUCH)
6924
+ diagram.addEventListener(type, onPress, { passive: true });
6866
6925
  diagram.addEventListener("click", onClick);
6867
6926
  diagram.addEventListener("keydown", onKey);
6868
6927
  const groups = new Set(targets.map((t) => t.parentElement));
@@ -6976,6 +7035,8 @@ function attachPick(diagram, options = {}) {
6976
7035
  marks = null;
6977
7036
  for (const type of ["pointerdown", "mousedown"])
6978
7037
  diagram.removeEventListener(type, onPress);
7038
+ for (const type of TOUCH)
7039
+ diagram.removeEventListener(type, onPress);
6979
7040
  diagram.removeEventListener("click", onClick);
6980
7041
  diagram.removeEventListener("keydown", onKey);
6981
7042
  for (const el of targets) {
@@ -8604,21 +8665,12 @@ var FINGER_NAMES = {
8604
8665
  };
8605
8666
  var ordinal2 = (n) => `${n}${n % 100 >= 11 && n % 100 <= 13 ? "th" : ["th", "st", "nd", "rd"][n % 10] ?? "th"}`;
8606
8667
  var MAX_SLIDE = 3;
8607
- function stringName(tuning, s) {
8608
- const name = noteOf(tuning[s]).replace(/-?\d+$/, "");
8609
- const same = tuning.filter((p) => noteOf(p).replace(/-?\d+$/, "") === name).length;
8610
- if (same < 2)
8611
- return `the ${name} string`;
8612
- if (same > 2)
8613
- return `the ${ordinal2(tuning.length - s)} string (${name})`;
8614
- const lowest = tuning.findIndex((p) => noteOf(p).replace(/-?\d+$/, "") === name);
8615
- return `the ${s === lowest ? "low" : "high"} ${name} string`;
8616
- }
8668
+ var namesOf2 = (tuning, spelled) => stringNames(tuning, tuning.length, spelled?.length === tuning.length ? spelled : undefined);
8617
8669
  var lowestFret2 = (frets) => {
8618
8670
  const fretted = frets.filter((f) => f !== null && f > 0);
8619
8671
  return fretted.length ? Math.min(...fretted) : 0;
8620
8672
  };
8621
- function move(from, fromFingers, to, tuning) {
8673
+ function move(from, fromFingers, to, names) {
8622
8674
  const anchors = [];
8623
8675
  const guides = [];
8624
8676
  let movement = 0;
@@ -8651,14 +8703,14 @@ function move(from, fromFingers, to, tuning) {
8651
8703
  if (seen.has(f))
8652
8704
  continue;
8653
8705
  seen.add(f);
8654
- tips.push(`Keep your ${fingerName(f)} on ${stringName(tuning, s)}'s ${ordinal2(to.frets[s])} fret.`);
8706
+ tips.push(`Keep your ${fingerName(f)} on ${names[s]}'s ${ordinal2(to.frets[s])} fret.`);
8655
8707
  }
8656
8708
  for (const s of guides) {
8657
8709
  const f = to.fingers[s];
8658
8710
  if (seen.has(f))
8659
8711
  continue;
8660
8712
  seen.add(f);
8661
- tips.push(`Slide your ${fingerName(f)} along ${stringName(tuning, s)} from fret ${from[s]} to ${to.frets[s]}.`);
8713
+ tips.push(`Slide your ${fingerName(f)} along ${names[s]} from fret ${from[s]} to ${to.frets[s]}.`);
8662
8714
  }
8663
8715
  if (shift >= 2) {
8664
8716
  const up = lowestFret2(to.frets) > lowestFret2(from);
@@ -8675,8 +8727,9 @@ function transition(from, toChord, options = {}) {
8675
8727
  if (from.length !== tuning.length)
8676
8728
  return [];
8677
8729
  const fromFingers = options.fromFingers ?? fingerVoicing(from) ?? from.map(() => null);
8730
+ const names = namesOf2(tuning, options.tuningNames);
8678
8731
  const candidates = generateVoicings(toChord, { tuning }).slice(0, options.candidates ?? 30);
8679
- return candidates.map((voicing) => ({ voicing, ...move(from, fromFingers, voicing, tuning) })).sort((a, b) => score(a, a.voicing) - score(b, b.voicing));
8732
+ return candidates.map((voicing) => ({ voicing, ...move(from, fromFingers, voicing, names) })).sort((a, b) => score(a, a.voicing) - score(b, b.voicing));
8680
8733
  }
8681
8734
  var DATABASE_VOICINGS = 6;
8682
8735
  var HIGH_POSITION = 5;
@@ -8728,6 +8781,7 @@ function candidatesOf(symbol, tuning, count, voicings) {
8728
8781
  var sameTuning4 = (a, b) => a.length === b.length && a.every((p, i) => p === b[i]);
8729
8782
  function smoothProgression(chords, options = {}) {
8730
8783
  const tuning = options.tuning ?? STANDARD_TUNING;
8784
+ const names = namesOf2(tuning, options.tuningNames);
8731
8785
  const count = options.candidates ?? 12;
8732
8786
  const cache = new Map;
8733
8787
  const lists = chords.map((c) => {
@@ -8748,7 +8802,7 @@ function smoothProgression(chords, options = {}) {
8748
8802
  let best = Infinity;
8749
8803
  let from = 0;
8750
8804
  prev.forEach((p, j) => {
8751
- const step = move(p.voicing.frets, p.voicing.fingers, voicing, tuning);
8805
+ const step = move(p.voicing.frets, p.voicing.fingers, voicing, names);
8752
8806
  const total = costs[j] + step.movement + SHAPE_WEIGHT * cost;
8753
8807
  if (total < best) {
8754
8808
  best = total;
@@ -8771,7 +8825,7 @@ function smoothProgression(chords, options = {}) {
8771
8825
  return {
8772
8826
  chord: chords[i],
8773
8827
  voicing,
8774
- ...move(previous.frets, previous.fingers, voicing, tuning)
8828
+ ...move(previous.frets, previous.fingers, voicing, names)
8775
8829
  };
8776
8830
  });
8777
8831
  }
@@ -9005,6 +9059,8 @@ function noteOn(key, degree, accidental, diminished) {
9005
9059
  function suffixOf(mark, lower) {
9006
9060
  let s = mark.replace(/♭/g, "b").replace(/♯/g, "#");
9007
9061
  s = s.replace(/^o/, "°").replace(/^Δ7?$/, "maj7").replace(/^M7$/, "maj7");
9062
+ if (lower)
9063
+ s = s.replace(/^\((maj\d*)\)$/, "$1").replace(/^m(?=[Mm]aj)/, "").replace(/^Maj/, "maj");
9008
9064
  if (s === "°" || s === "dim")
9009
9065
  return "dim";
9010
9066
  if (s === "°7" || s === "dim7")
@@ -9026,8 +9082,10 @@ function suffixOf(mark, lower) {
9026
9082
  return `m${s}`;
9027
9083
  }
9028
9084
  var isDiminished = (suffix) => /^(dim|m7b5)/.test(suffix);
9085
+ var USUAL = { mMaj7: "m(maj7)", "maj7#5": "+maj7" };
9029
9086
  function chordFrom(root, suffix) {
9030
- const symbol = `${root}${canonicalSuffix(suffix)}`;
9087
+ const canonical = canonicalSuffix(suffix);
9088
+ const symbol = `${root}${USUAL[canonical] ?? canonical}`;
9031
9089
  return parseChord(symbol) && chordNoteSet(symbol) ? symbol : null;
9032
9090
  }
9033
9091
  function bassOf(key, text) {
@@ -9520,7 +9578,8 @@ var SHARED = [
9520
9578
  "tempo",
9521
9579
  "bpm",
9522
9580
  "strum",
9523
- "harmonize"
9581
+ "harmonize",
9582
+ "caption"
9524
9583
  ];
9525
9584
  var KIND_WORDS = {
9526
9585
  triad: "triads",
@@ -9740,7 +9799,7 @@ function guitarVoicings(symbols, tuningText, voicings) {
9740
9799
  var fretsText = (list) => list.some((f) => f !== null && f > 9) ? list.map((f) => f === null ? "x" : f).join("-") : list.map((f) => f === null ? "x" : f).join("");
9741
9800
  function diagramBlock(block, lines) {
9742
9801
  const fields = new Map(lines);
9743
- for (const key of ["orientation", "hand", "labels", "tuning"]) {
9802
+ for (const key of ["orientation", "hand", "labels", "tuning", "caption"]) {
9744
9803
  const value = field(block, key);
9745
9804
  if (value !== undefined)
9746
9805
  fields.set(key, value);
@@ -9806,6 +9865,10 @@ function renderSection(doc, section, options, renderChord) {
9806
9865
  }
9807
9866
  const piano = instrument !== "guitar";
9808
9867
  const diagrams = yes(field(block, "diagrams"), "diagrams", true);
9868
+ const caption = field(block, "caption")?.trim();
9869
+ if (caption && !["fingering", "none", "no", "off", "false"].includes(caption.toLowerCase())) {
9870
+ throw new Error(`caption: use fingering (the fingering in words) or none, got "${caption}"`);
9871
+ }
9809
9872
  const functions = yes(field(block, "functions"), "functions", false);
9810
9873
  const leading = field(block, "voice-leading");
9811
9874
  const led = yes(leading, "voice-leading", false);
@@ -10808,6 +10871,8 @@ var renderChord = (doc, block, options) => {
10808
10871
  }
10809
10872
  const sounding = symbol && capo ? soundingChord(symbol, capo) : symbol;
10810
10873
  const sounds = soundsField(field2(block, "sounds"), symbol, capo);
10874
+ if (capo && sounding && soundsInTitle(field2(block, "sounds")) && !field2(block, "title"))
10875
+ title = `${sounding} (${title ?? symbol} shape)`;
10811
10876
  const root = sounding ? chordNoteSet(sounding)?.root ?? rootOf2(sounding) : null;
10812
10877
  const strings = tuning ?? (voicing.frets.length === 6 ? STANDARD_TUNING : undefined);
10813
10878
  const labels = dotLabels(field2(block, "labels"), sounding, shape, strings && capo ? capoTuning(strings, capo) : tuning);
@@ -10857,10 +10922,17 @@ function captioned(doc, diagram, sentences) {
10857
10922
  figure.append(diagram, html(doc, "figcaption", "mn-fingering", sentences.join(" ")));
10858
10923
  return figure;
10859
10924
  }
10925
+ var soundsInTitle = (text) => /^title$/i.test(text?.trim() ?? "");
10860
10926
  function soundsField(text, shape, capo) {
10861
10927
  const value = text?.trim();
10862
10928
  if (!value || /^(no|false|off)$/i.test(value))
10863
10929
  return;
10930
+ if (soundsInTitle(value)) {
10931
+ if (capo && (!shape || !chordNoteSet(shape))) {
10932
+ throw new Error("sounds: title needs a chord the library knows: add its symbol (e.g. symbol: A)");
10933
+ }
10934
+ return;
10935
+ }
10864
10936
  const auto = /^(yes|true|on|auto)$/i.test(value);
10865
10937
  if (!capo) {
10866
10938
  if (auto)
@@ -12312,6 +12384,13 @@ var styles_default = `/* Music notation. Colors follow Obsidian's theme variable
12312
12384
  .mn-svg.mn-fretboard {
12313
12385
  zoom: 1.34;
12314
12386
  }
12387
+
12388
+ /* A keyboard with a pick layer (Music Practice drills, click input): a black key (14 units)
12389
+ becomes 24 px wide. Keyboards that only play keep their size. On a narrow screen max-width
12390
+ still fits a wide range to the page: fewer keys, larger targets. */
12391
+ .mn-svg.mn-keyboard[data-mn-pick] {
12392
+ zoom: 1.72;
12393
+ }
12315
12394
  }
12316
12395
 
12317
12396
  .mn-svg text {
@@ -12623,26 +12702,14 @@ var styles_default = `/* Music notation. Colors follow Obsidian's theme variable
12623
12702
  pointer-events: none;
12624
12703
  }
12625
12704
 
12626
- /* Tabs and scores: the player bar stays at the bottom of the screen while the score scrolls. */
12705
+ /* Tabs and scores: the player bar is a bar like the others (#82), below the score and always
12706
+ shown; it also stays at the bottom of the screen while a long score scrolls. */
12627
12707
  .mn-tab {
12628
12708
  position: relative;
12629
12709
  }
12630
12710
 
12631
- .mn-tab .mn-tab-bar {
12632
- position: sticky;
12633
- left: auto;
12634
- right: auto;
12711
+ .mn-tab .mn-play.mn-play-static.mn-tab-bar {
12635
12712
  bottom: 6px;
12636
- width: fit-content;
12637
- max-width: 100%;
12638
- margin: 4px auto 0;
12639
- }
12640
-
12641
- .mn-tab:hover .mn-tab-bar,
12642
- .mn-tab:focus-within .mn-tab-bar,
12643
- .mn-tab.mn-play-open .mn-tab-bar {
12644
- opacity: 1;
12645
- pointer-events: auto;
12646
12713
  }
12647
12714
 
12648
12715
  /* alphaTab's cursor (the bar that plays, the beat line) and the notes of the beat that sounds, in
@@ -14551,9 +14618,10 @@ export {
14551
14618
  voiceLeadVoicings,
14552
14619
  voiceMotion,
14553
14620
  voicingShape,
14621
+ volumeChanged,
14554
14622
  withNaming,
14555
14623
  withTonicizations
14556
14624
  };
14557
14625
 
14558
- //# debugId=0478ADD179176ECE64756E2164756E21
14626
+ //# debugId=618A7E58A09A035164756E2164756E21
14559
14627
  //# sourceMappingURL=index.js.map