cp-midi-player 0.1.0 → 0.2.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 +8 -3
- package/dist/cp-midi-player.iife.js +931 -870
- package/dist/cp-midi-player.iife.js.map +4 -4
- package/dist/cp-midi-player.js +931 -870
- package/dist/cp-midi-player.js.map +4 -4
- package/dist/types/asset-base.d.ts +1 -1
- package/dist/types/cp-midi-player.d.ts +16 -3
- package/dist/types/instrument-icons.d.ts +2 -0
- package/dist/types/player.d.ts +15 -0
- package/dist/types/viewer-state.d.ts +1 -0
- package/package.json +1 -1
- package/dist/gm-instrument-families.png +0 -0
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Play MIDI and audio in your browser, just like in your DAW.
|
|
|
9
9
|
|
|
10
10
|
<p align="center">
|
|
11
11
|
<a href="https://tanchihpin0517.github.io/cp-midi-player/">
|
|
12
|
-
<img src="docs/player-modern-five-tracks.png" alt="Five-track MIDI player with
|
|
12
|
+
<img src="docs/player-modern-five-tracks.png" alt="Five-track MIDI player with instrument icons, notes, and mute, solo and volume controls">
|
|
13
13
|
</a><br>
|
|
14
14
|
<sub>(Click the image to try the live demo.)</sub>
|
|
15
15
|
</p>
|
|
@@ -52,7 +52,7 @@ import "cp-midi-player"; // registers <cp-midi-player>
|
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
The package has no runtime dependencies. With a bundler (Vite, webpack,
|
|
55
|
-
esbuild), the player loads its worklet, SoundFont
|
|
55
|
+
esbuild), the player loads its worklet, SoundFont and font from the
|
|
56
56
|
same version on jsDelivr. To serve them yourself, see
|
|
57
57
|
[Self-hosting](#self-hosting).
|
|
58
58
|
|
|
@@ -76,10 +76,13 @@ track. Without it, recordings appear above all MIDI tracks.
|
|
|
76
76
|
|---|---|
|
|
77
77
|
| `src` | MIDI file URL (required) |
|
|
78
78
|
| `view-mode` | `arrangement` (Tracks, default) or `piano-roll` |
|
|
79
|
+
| `track-rail` | `open` (default); `collapsed` to its instrument icons, which visitors can still open; or `hidden`, which leaves out the track list and the Tracks/Roll switch |
|
|
80
|
+
| `piano-keys` | draw a piano keyboard beside the pitch rows in the Roll view; off by default |
|
|
81
|
+
| `track-height` | starting height of each track in px (52–180); without it tracks fit the player's height. Visitors can still change it |
|
|
79
82
|
| `theme` | `light` or `dark`; follows the system setting when omitted |
|
|
80
83
|
| `soundfont` | SF2, SF3 or DLS URL; defaults to GeneralUser GS |
|
|
81
84
|
| `file-name` | name shown in messages and used for the exported WAV |
|
|
82
|
-
| `persist-key` | remember mute, solo, volume and
|
|
85
|
+
| `persist-key` | remember mute, solo, volume, view and the collapsed track list per visitor in `localStorage` |
|
|
83
86
|
| `no-preload` | defer SoundFont loading until first play; otherwise it preloads by default |
|
|
84
87
|
| `preload` | retained for compatibility; preloading is now the default |
|
|
85
88
|
| `asset-base` | folder holding the player's assets; see [Self-hosting](#self-hosting) |
|
|
@@ -89,6 +92,8 @@ track. Without it, recordings appear above all MIDI tracks.
|
|
|
89
92
|
| `no-exclusive` | keep playing when another player on the page starts |
|
|
90
93
|
|
|
91
94
|
Set the player height with CSS: `cp-midi-player { height: 24rem; }`.
|
|
95
|
+
Without a CSS height the player fits its tracks, up to 44 rem (64 rem when the
|
|
96
|
+
page or the visitor has set a track height).
|
|
92
97
|
|
|
93
98
|
Players preload their SoundFont when mounted and share the download on the same
|
|
94
99
|
page. Playback still requires a user action. Pass `preloadSoundFont: false` to
|