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

@oliego/wavr-drum-machine

v1.0.0

Published

A 16/32-step drum sequencer plugin for WAVR PRO. Pure JavaScript, zero dependencies. Works standalone or as a WAVR plugin.

Readme

@oliego/wavr-drum-machine

BuyMeACoffee License: AGPL 3.0 Zero Dependencies Web Audio API Works Standalone

A 16/32-step drum sequencer with 8 fully synthesized instruments. Runs standalone in any browser or as a plugin inside wavr-pro.


SPONSOR: → Oliego.Space - Create without limits!


Install

npm install @oliego/wavr-drum-machine

Zero dependencies. Web Audio API only.


Quickstart

Standalone (any framework or plain JS)

import DrumMachine from '@oliego/wavr-drum-machine';

const ctx = new AudioContext();
const dm  = new DrumMachine({ audioContext: ctx, bpm: 120 });

dm.mount(document.getElementById('my-container'));

// Called every time the user hits Bounce
dm.onRender = (audioBuffer, bpm) => {
  console.log(`Got ${audioBuffer.duration.toFixed(2)}s of audio at ${bpm} BPM`);
};

// Called on every pattern change
dm.onPatternChange = (pattern) => {
  localStorage.setItem('dm-pattern', JSON.stringify(pattern));
};

As a WAVR PRO plugin

import DrumMachine from '@oliego/wavr-drum-machine';

// Inside WavrPro — register once
pluginManager.register(DrumMachine);

// The plugin appears in the topbar automatically.
// Bounce sends audio directly to a new DAW track.

React

import { useEffect, useRef } from 'react';
import DrumMachine from '@oliego/wavr-drum-machine';

export default function DrumPad() {
  const containerRef = useRef(null);

  useEffect(() => {
    const ctx = new AudioContext();
    const dm  = new DrumMachine({ audioContext: ctx, bpm: 120 });
    dm.mount(containerRef.current);
    return () => dm.destroy();
  }, []);

  return <div ref={containerRef} />;
}

Instruments

| ID | Label | Synthesis | | --------- | --------- | ---------------------------------- | | kick | Kick | Pitch-swept sine + click transient | | snare | Snare | Bandpass noise + triangle body | | clap | Clap | Triple-layer bandpass noise | | hhc | HH Closed | Highpass noise, 50ms | | hho | HH Open | Highpass noise, 350ms | | tom_hi | Tom Hi | Pitch-swept sine 280→120Hz | | tom_mid | Tom Mid | Pitch-swept sine 180→75Hz | | ride | Ride | Bandpass noise, 500ms |


API

Constructor

new DrumMachine({ audioContext, bpm, steps, container })

| Option | Type | Default | Description | | -------------- | -------------- | ------------------ | ----------------------------- | | audioContext | AudioContext | new AudioContext() | Pass your existing context | | bpm | number | 120 | Initial BPM | | steps | number | 16 | 16 or 32 | | container | HTMLElement | null | Mount immediately if provided |

Methods

dm.mount(el)          // Render UI into el
dm.destroy()          // Stop, remove UI, disconnect audio nodes
dm.start()            // Begin sequencer loop
dm.stop()             // Halt sequencer
dm.toggle()           // Start or stop
dm.setBpm(120)        // Update BPM (call when host transport changes)
dm.getPattern()       // Returns serialisable state object
dm.loadPattern(state) // Restore from getPattern() snapshot
await dm.renderToBuffer() // Returns Promise<AudioBuffer> — 1 bar offline render

Callbacks

dm.onRender        = (AudioBuffer, bpm) => {}  // Fired after renderToBuffer()
dm.onPatternChange = (pattern) => {}           // Fired on every step toggle
dm.onStepTick      = (stepIndex) => {}         // Fired on every 16th note

Pattern format (getPattern / loadPattern)

{
  bpm: 120,
  steps: 16,           // 16 or 32
  swing: 0,            // 0–75
  master: 0.85,        // master volume 0–1
  pattern: {
    kick:    [{ active: true,  velocity: 0.9 }, { active: false, velocity: 0.8 }, ...],
    snare:   [...],
    // one array per instrument, length === steps
  },
  instrVols: {
    kick: 1.0, snare: 1.0, ...
  }
}

Presets

Four built-in genre presets, each sets BPM, swing, and a 32-step pattern:

| Preset | BPM | Swing | | -------- | --- | ----- | | hiphop | 90 | 30% | | house | 128 | 0% | | techno | 138 | 0% | | jungle | 170 | 15% |

Load programmatically: dm._loadPreset('house') or click the preset buttons in the UI.


UI controls

The plugin renders its own complete UI into the mounted element:

  • Play / Stop — start and stop the sequencer
  • BPM input — tempo control
  • Steps — switch between 16 and 32 steps
  • Swing — 0–75% swing on off-beats
  • Master volume
  • Step grid — click to toggle, right-click for per-step velocity
  • Per-instrument — volume slider, Mute (M), Solo (S)
  • Clear — remove all active steps
  • Randomize — generate a random pattern based on genre-appropriate densities
  • Bounce — render 1 bar to AudioBuffer and fire onRender
  • Presets — Hip Hop, House, Techno, Jungle

Licence

MIT