Skip to content

Utility to manipulate the PAD_INFO.BIN file for SP-404 / SP-404SX / SP-404A series of samplers.

License

Notifications You must be signed in to change notification settings

uttori/uttori-audio-padinfo

Repository files navigation

view on npm npm module downloads Tree-Shaking Support Dependency Count Minified + GZip Minified

Uttori Pad Info & SP-404 Pattern Utility

Utilities to manipulate the PAD_INFO.BIN file for SP-404 / SP-404SX / SP-404A series of samplers, and to manipulate pattern files and convert between MIDI and pattern files.

Install

npm install --save @uttori/audio-padinfo

Example

import fs from 'fs';
import { AudioPadInfo } from '@uttori/audio-padinfo';
const data = fs.readFileSync('./PAD_INFO.bin');
const { pads } = new AudioPadInfo(data);
console.log('Pads:', pads);
 [
    {
      "avaliable": false,
      "label": "A1",
      "filename": "A0000001.WAV",
      "originalSampleStart": 512,
      "originalSampleEnd": 385388,
      "userSampleStart": 512,
      "userSampleEnd": 385388,
      "volume": 87,
      "lofi": false,
      "loop": false,
      "gate": false,
      "reverse": true,
      "format": "WAVE",
      "channels": "Stereo",
      "tempoMode": "Off",
      "originalTempo": 109.9,
      "userTempo": 109.9
    },
    ...,
    {
      "avaliable": false,
      "label": "J12",
      "filename": "J0000012.WAV",
      "originalSampleStart": 512,
      "originalSampleEnd": 53424,
      "userSampleStart": 512,
      "userSampleEnd": 53424,
      "volume": 127,
      "lofi": false,
      "loop": false,
      "gate": true,
      "reverse": false,
      "format": "WAVE",
      "channels": "Stereo",
      "tempoMode": "Off",
      "originalTempo": 100,
      "userTempo": 100
    }
  ]
import fs from 'fs';
import { AudioPattern } from '@uttori/audio-padinfo';
const bpm = 128; // Optional, does not impact MIDI structure.
const fileName = 'PTN00067.BIN';
const data = fs.readFileSync(fileName);
const audioPattern = new AudioPattern(data);
const midi = audioPattern.convertToMidi({
  bpm,
  fileName,
});
fs.writeFileSync(`${fileName}.mid`, Buffer.from(midi.saveToDataBuffer().buffer));

API Reference

Tests

To run the test suite, first install the dependencies, then run npm test:

npm install
npm test
DEBUG=Uttori* npm test

Contributors

References

Useful links for SP-404 series of samplers:

Thanks

License

About

Utility to manipulate the PAD_INFO.BIN file for SP-404 / SP-404SX / SP-404A series of samplers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published