npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xromdev/drumroll

v0.1.0

Published

Drums falling onto a kit: the NES noise channel's sixteen rates as a drum kit that moves when struck — canvas blocks, DOM pieces, no framework in the frame loop. React component included.

Readme

@xromdev/drumroll

The drums, falling onto a kit — the NES noise channel read as a drum kit, hits falling onto pieces that move when struck. Built on @xromdev/roll, the same core as @xromdev/pianoroll, so the two stack and follow one clock.

  • The NES has no drums: it has a noise channel and sixteen rates for it ($400E, 0 fastest … 15 slowest). Each rate is a lane, read as a piece: closed, pedal and open hats, clap, snares, side stick, four toms, the kick.
  • The pieces stand in a kit, in two rows, and each moves its own way when struck — the kick swells and rebounds, an open hat swings, a clap claps. Motion follows the hit's velocity, and prefers-reduced-motion stops it.
  • M and S under every piece, if you want them: mute or solo one drum at a time. A silenced piece is dimmed and its hits keep falling, faded.
  • Any drums, not only the NES: pass lanes with your own names, colours and drawings.
  • No framework in the frame loop; ~6 KB minified and gzipped on top of @xromdev/roll. React component included.

Try it: xrom.dev/utils/drumroll — every drum in a groove, any NSF's drums, and the kit to play pad by pad.

Install

npm install @xromdev/drumroll

Use

import { DrumRollView } from '@xromdev/drumroll';
import '@xromdev/drumroll/drumroll.css';

const kit = new DrumRollView(document.querySelector('#drums')!);
kit.setHits([
  { period: 15, start: 0, duration: 0.1 },                   // kick
  { period: 1, start: 0.25, duration: 0.05, velocity: 0.5 }, // hi-hat
  { period: 7, start: 0.5, duration: 0.1 },                  // snare
]);
kit.play(() => audioContext.currentTime - startedAt); // or kit.render(seconds)

The element must have a height; the view fills it.

React

import { DrumRoll } from '@xromdev/drumroll/react';
import '@xromdev/drumroll/drumroll.css';
import { EMPTY_KIT_MIX, setPieceMuted, setPieceSoloed } from '@xromdev/drumroll';

const [mix, setMix] = useState(EMPTY_KIT_MIX);

<DrumRoll
  hits={hits}
  clock={() => audio.currentTime}
  height={360}
  kitMix={mix}
  onPieceMutedChange={(period, on) => setMix((m) => setPieceMuted(m, period, on))}
  onPieceSoloedChange={(period, on) => setMix((m) => setPieceSoloed(m, period, on))}
/>

The view never changes the mix itself — you hold it, and silence the sound with isPieceAudible(period, mix).

Options

Everything @xromdev/roll takes (lookAhead, tracks, releaseMs, sparks, onSoundingChange), and:

| option | default | | |---|---|---| | lanes | the hits' rates | { period, label?, color?, icon? }[] — icon is SVG markup or null. | | padHeight | 92 | Px of kit under the falling area; under 62 the drawings are dropped. | | maxLaneWidth | 104 | Widest a lane may get. | | iconSize | 44 | Size of a piece's drawing. | | showNames | true | Name each piece. | | showIcons | true | Draw the pieces. | | animate | true | Move a piece when it is struck. | | kitMix | none | { muted, soloed } periods; silenced pieces are dimmed. | | onPieceMutedChange / onPieceSoloedChange | — | Given, they draw M and S under every piece. |

Also exported: NOISE_DRUM_NAMES, NOISE_DRUM_KINDS, drumIcon(kind, size) (the drawings as SVG strings), colorOfPeriod, familyOf, placementOf, and the motions (keyframesFor, partKeyframesFor, durationOf) to strike a piece of your own with the Web Animations API.

Development

npm install
npm test   # lanes, motions, and the view in jsdom

License

MIT © Oleksandr Maksymov