Scan your whole stack
From OX Research Newsroom
Are you using cp-midi-player?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.1.0
cp-midi-player was last scanned on 1 Dec 2026 at version 0.1.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.1.0 LATEST | 1 Dec 2026 | No rules fired |
| 0.0.0-stage | 1 Dec 2026 | Not shown |
Findings for v0.1.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.1.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Designed for music researchers building demo pages and listening tests. Play MIDI and audio in your browser, just like in your DAW.
Add these two lines to your page:
<script type="module" src="https://cdn.jsdelivr.net/npm/cp-midi-player@latest"></script>
<cp-midi-player src="song.mid"></cp-midi-player>
No build step is needed. The player includes a default set of instrument sounds, so you do not need to supply a SoundFont to get started.
<script type="module" src="https://cdn.jsdelivr.net/npm/cp-midi-player@latest"></script>
npm install cp-midi-player
import "cp-midi-player"; // registers <cp-midi-player>
The package has no runtime dependencies. With a bundler (Vite, webpack, esbuild), the player loads its worklet, SoundFont, artwork and font from the same version on jsDelivr. To serve them yourself, see Self-hosting.
<cp-midi-player src="song.mid">
<cp-midi-player-audio src="mix.mp3" label="Mixture"></cp-midi-player-audio>
<cp-midi-player-audio src="vocals.mp3" label="Vocals stem"></cp-midi-player-audio>
<cp-midi-player-audio src="bass.mp3" label="Bass stem" offset="0.25"></cp-midi-player-audio>
</cp-midi-player>
offset="0.25" delays a recording by 0.25 seconds; a negative value skips its
beginning. Add before-midi-track="1" to place a recording above the first MIDI
track. Without it, recordings appear above all MIDI tracks.
| attribute | effect |
|---|---|
src |
MIDI file URL (required) |
view-mode |
arrangement (Tracks, default) or piano-roll |
theme |
light or dark; follows the system setting when omitted |
soundfont |
SF2, SF3 or DLS URL; defaults to GeneralUser GS |
file-name |
name shown in messages and used for the exported WAV |
persist-key |
remember mute, solo, volume and view per visitor in localStorage |
no-preload |
defer SoundFont loading until first play; otherwise it preloads by default |
preload |
retained for compatibility; preloading is now the default |
asset-base |
folder holding the player's assets; see Self-hosting |
audio, audio-label, audio-offset |
one recording without a child element |
no-export |
hide the Export WAV button |
soundfont-menu |
show a SoundFont menu so visitors can load their own bank |
no-exclusive |
keep playing when another player on the page starts |
Set the player height with CSS: cp-midi-player { height: 24rem; }.
Players preload their SoundFont when mounted and share the download on the same
page. Playback still requires a user action. Pass preloadSoundFont: false to
mount(), or add no-preload to the element, to load only on first play.
const player = document.querySelector("cp-midi-player");
player.addEventListener("play", () => console.log("playing"));
player.addEventListener("pause", () => console.log("paused at", player.currentTime));
await player.play();
player.seek(12.5); // seconds
player.pause();
player.stop();
player.duration; // seconds
To render into an element you already have, or to pass bytes instead of URLs,
use mount():
import { mount } from "cp-midi-player";
const player = mount(document.querySelector("#slot"), {
src: midiArrayBuffer, // URL or ArrayBuffer
soundFont: sf2ArrayBuffer, // URL or ArrayBuffer, optional
fileName: "take-3.mid",
audioTracks: [{ url: "vocals.mp3", label: "Vocals" }],
viewMode: "piano-roll"
});
player.destroy();
TypeScript types are included, and document.querySelector("cp-midi-player")
is typed as the player element.
The included GeneralUser GS
SoundFont downloads on first play (8.4 MB). Use soundfont to choose another bank.
Players share the download; starting one pauses the others by default.
For large collections, mount players as needed and remove them when finished.
Audio recordings are decoded into memory, so short excerpts work best.
To serve everything from your own site (for offline use or a strict content
security policy), copy node_modules/cp-midi-player/dist/ to your server
and load the script from there:
<script type="module" src="/static/cp-midi-player/cp-midi-player.js"></script>
A script loaded from its own dist/ folder finds the assets next to itself.
When the script is bundled into your app instead, point the player at the
copied folder with the asset-base attribute, or once for the whole page:
import { setDefaultAssetBase } from "cp-midi-player";
setDefaultAssetBase("/static/cp-midi-player/");
Current Chrome, Edge, Firefox and Safari. Playback uses the Web Audio AudioWorklet. Browsers start audio only after a click or key press, so playback starts from the player's controls or from your own button.
npm install
npm test # unit tests
npm run typecheck
npm run build # writes dist/
npx http-server . # then open /demo/
The demo pages load the player from ../dist/, so run npm run build after
each change and reload.
GitHub releases tagged v<version> publish to npm and redeploy the demo site
from the same tag; pushes to main leave both alone. Update the package
version, lockfile and changelog first. The npm Trusted Publisher must point to
tanchihpin0517/cp-midi-player, workflow publish.yml, with no environment name.
The github-pages environment must allow deployments from v* tags
(Settings → Environments → github-pages → Deployment branches and tags).
MIT. SpessaSynth is Apache-2.0. GeneralUser GS and JetBrains Mono (OFL)
ship with their license files in dist/. The demo's music excerpt is
CC BY-NC-SA 2.5; see the demo page for credits.
cp-midi-player originated from midi-realplayer 0.1.4 by Song-Ze (Jimmy) Yu, released under the MIT License.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.