@dsebastien/music-notation 0.19.2 → 0.21.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.
@@ -5,7 +5,7 @@
5
5
  * main thread (web workers can't start from another origin), and gives the diagrams a soundfont
6
6
  * player of their own.
7
7
  */
8
- import { type AlphaTabModule } from './index.js';
8
+ import { alphaTabCdn, createSoundfontPlayer, renderTab, type AlphaTabModule } from './index.js';
9
9
  import { type NotePlayer } from '../playback/player.js';
10
10
  declare global {
11
11
  interface Window {
@@ -13,5 +13,15 @@ declare global {
13
13
  musicNotationTabLoaded?: boolean;
14
14
  musicNotationSoundfontPlayer?: NotePlayer;
15
15
  musicNotationOptions?: unknown;
16
+ /**
17
+ * The tab bundle's API for a page's own scripts (the guide's Sounds page): draw a tab or
18
+ * a score with assets of its choice, make a soundfont player, load alphaTab from jsDelivr.
19
+ */
20
+ MusicNotationTab?: {
21
+ renderTab: typeof renderTab;
22
+ createSoundfontPlayer: typeof createSoundfontPlayer;
23
+ loadAlphaTab: () => Promise<AlphaTabModule>;
24
+ alphaTabCdn: typeof alphaTabCdn;
25
+ };
16
26
  }
17
27
  }
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import type * as AT from '@coderline/alphatab';
9
9
  import type { NotePlayer } from '../playback/player.js';
10
+ import { type InstrumentSource } from './instruments.js';
10
11
  export type AlphaTabModule = typeof AT;
11
12
  /** The alphaTab release these blocks are made for (Publish loads it from jsDelivr). */
12
13
  export declare const ALPHATAB_VERSION = "1.9.0";
@@ -23,6 +24,13 @@ export interface TabAssets {
23
24
  font: string;
24
25
  /** The soundfont: its bytes or a URL. */
25
26
  soundFont: Uint8Array | string;
27
+ /**
28
+ * One soundfont per instrument (#108): the folder made by `scripts/sounds/split-soundfont.ts`
29
+ * (its URL, or a function that reads one of its files). A score, and the diagrams' player,
30
+ * then load only the instruments they play; `soundFont` is what plays when the folder can't
31
+ * be read or lacks one of them.
32
+ */
33
+ instruments?: InstrumentSource;
26
34
  }
27
35
  export interface TabOptions {
28
36
  alphaTab: AlphaTabModule;
@@ -51,6 +59,12 @@ export interface TabOptions {
51
59
  * #85); 0.8 by default. The bar has no volume of its own (#82).
52
60
  */
53
61
  volume?: number | (() => number);
62
+ /**
63
+ * The Full screen button at the end of the player bar (default true; #113): the block fills
64
+ * the screen, the score is drawn again at that width and scrolls in an area of its own, where
65
+ * it follows the music. `false` for an app that has its own view.
66
+ */
67
+ fullScreen?: boolean;
54
68
  }
55
69
  export type Staves = 'tab' | 'score' | 'both';
56
70
  export interface TabSource {