Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

cp-midi-player

Latest version: v0.1.0

Overview

Last scanned
1 Dec 2026
Published
1 Dec 2026
npm package Publisher: tanchihpin0517
0 Stars
0 Forks
2 Versions
TypeScript Repo language

Scan summary

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.

  • Releases: 2 versions, all published on 1 Dec 2026.
  • Findings: No rules fired in version 0.1.0.

Versions

2 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.1.0 LATEST 1 Dec 2026 No rules fired
0.0.0-stage 1 Dec 2026 Not shown

No rules fired in 0.1.0

Findings

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.

README

The publisher’s own README, as collected from the registry.

cp-midi-player

npm License: MIT

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.

Features

  • Track and piano-roll views.
  • Mute, solo, volume and instrument controls for each MIDI track.
  • Audio recordings and stems that stay in sync with MIDI.
  • WAV export of the current mix.
  • Light and dark themes.

Usage

From a CDN
<script type="module" src="https://cdn.jsdelivr.net/npm/cp-midi-player@latest"></script>
From npm
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.

Audio tracks
<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.

Attributes

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.

JavaScript

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.

SoundFonts and assets

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.

Self-hosting

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/");

Browser support

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.

Development

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.

Publishing

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).

License

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.

Credits

cp-midi-player originated from midi-realplayer 0.1.4 by Song-Ze (Jimmy) Yu, released under the MIT License.

OX Radar and Response Center

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.

Where it’s listed

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).

  • npm cp-midi-player

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

Frame 2085668439 (1)
Group 1261154229