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 🙏

© 2024 – Pkg Stats / Ryan Hefner

pioneer-ddj

v0.0.1

Published

A library to help interface with the Pioneer DDJ 400

Downloads

5

Readme

Pioneer DDJ 400

This library provides a light wrapper around the midi interface for the Pioneer DDJ 400. The goal is to provide a tool that can help create digital experiences using the DDJ 400 hardware. I've been using it with Electron but it could also work on a Raspberry Pi. There's still more work to be done for this to work in the browser.

Installation

npm i pioneer-ddj

Usage

const pioneerddj = require('pioneer-ddj');

const ddj = new pioneerddj.DDJ('DDJ-400', {});

// Callback every time
ddj.on('play', ({ side, state }) => {
    console.log(`Play buton ${state ? 'pressed' : 'released'} on ${side} side!`);
});

// Switch pads to beat loop mode on left side;
ddj.setPadModeLeft('BEAT_LOOP');

// Turn on pad (lights up) in first row, first column in the beatloop section
ddj.setPadLeft(1, 1, true);

Event API

Example from examples/all.js.

const pioneerddj = require('pioneer-ddj');

const ddj = new pioneerddj.DDJ('DDJ-400');

// Buttons
ddj.on('play', console.log);
ddj.on('cue', console.log);
ddj.on('shift', console.log);
ddj.on('platter', console.log);
ddj.on('beatsync', console.log);
ddj.on('beatsync_long', console.log);
ddj.on('loop_in', console.log);
ddj.on('loop_in_long', console.log);
ddj.on('loop_out', console.log);
ddj.on('reloop', console.log);
ddj.on('call_back', console.log);
ddj.on('call_forward', console.log);
ddj.on('phones_cue', console.log);
ddj.on('hot_cue', console.log);
ddj.on('beat_loop', console.log);
ddj.on('beat_jump', console.log);
ddj.on('sampler', console.log);
ddj.on('load', console.log);

// Global Buttons
ddj.on('load_select', console.log);
ddj.on('master_cue', console.log);
ddj.on('beatfx_back', console.log);
ddj.on('beatfx_forward', console.log);
ddj.on('beatfx_select', console.log);
ddj.on('beatfx_channel_1', console.log);
ddj.on('beatfx_channel_2', console.log);
ddj.on('beatfx_channel_master', console.log);
ddj.on('beatfx_toggle', console.log);

// Pads
ddj.on('pad', console.log);

// Sliders
ddj.on('tempo', console.log);
ddj.on('level', console.log);
ddj.on('crossfader', console.log);

// Knobs
ddj.on('trim', console.log);
ddj.on('eq_high', console.log);
ddj.on('eq_mid', console.log);
ddj.on('eq_low', console.log);
ddj.on('filter', console.log);

// Global Knobs
ddj.on('master_level', console.log);
ddj.on('phones_mixing', console.log);
ddj.on('phones_level', console.log);
ddj.on('beatfx_level', console.log);
ddj.on('load_selector', console.log);

// Jogdials
ddj.on('jogdial', console.log);

Setting API

Although a few methods are available the full API to set values on the controller itself such as the state of the pads, channel levels, loopin/outs etc are still pending.

Values

Although midi usually works with values between 0 and 127 I've interpolated the values returned by this library are interpolated between 0 and 1. This also abstracts away the fact that Pioneer are sending two values on each CC update in order to achieve a higher precision value.

Open TODOs

  • [ ] better documentation
  • [ ] Fix the way the package is exported in index.js
  • [ ] Setting of values (get buttom colours)
  • [ ] Support Web midi for browser support
  • [ ] Make sure all functions are available on the left and the right side
  • [ ] Store board state in class to get the current value
  • [ ] Query functions for current board values
  • [ ] Clean typescript definition
  • [ ] support shift flag

Shout outs

S/O to dinchak and his package node-easymidi which helped make the creation of this package super easy and inspired the EventEmitter style api design.

Disclaimer

This project is not affiated with or endorsed by Pioneer DJ, Pioneer Corporation or AlphaTheta Corporation in any way.