Skip to content

Commit

Permalink
Update dependencies and catch errors on WAV parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewCallis committed Jan 1, 2021
1 parent fcb16ff commit c76ede5
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 41 deletions.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,26 @@

Super Pads helps manage samples on a SP-404SX. To use:

## Latest Version: v1.1 (2021-01-01)

- Fix issue with some errant WAV files preventing SD cards from being read.

- [Download for macOS](https://github.com/MatthewCallis/super-pads/releases/download/v1.1.0/Super.Pads.dmg)
- [Download for Windows (x64)](https://github.com/MatthewCallis/super-pads/releases/download/v1.1.0/Super.Pads.exe)

Check the [releases page](https://github.com/MatthewCallis/super-pads/releases) for the latest version. Personally I leave the apps in the root of my SD card to make adjustments on any Windows or macOS machine. Linux support should _just work_ but I haven't tested it personally. SD Card files are changed and not backed up, use at your own risk.

## How to Use

1. Open the app
1. Select your SD Card root directory by clicking `Pick Folder`
1. Select the bank with the drop down and click on the pad you want to edit
1. Adjust parameters for existing pads, remove pads, or add pads with pick files / drag & drop files to be converted to Wave with [FFmpeg](https://ffmpeg.org/) behind the scenes.
1. Click `Write SD Card` to save your changed and convert files.
1. If any error comes up you will see it above the pad matrix, click it to dismiss.
1. If you think something should be working but it not, please [file an issue](https://github.com/MatthewCallis/super-pads/issues) or [tweet at me](https://twitter.com/superfamicom/status/1343989480160522240).

- [Download for macOS](https://github.com/MatthewCallis/super-pads/releases/download/v1.0.0/Super.Pads.dmg)
- [Download for Windows (x64)](https://github.com/MatthewCallis/super-pads/releases/download/v1.0.0/Super.Pads.exe)

Check the [releases page](https://github.com/MatthewCallis/super-pads/releases) for the latest versions. Personally I leave the apps in the root of my SD card to make adjustments on any Windows or macOS machine. Linux support should _just work_ but I haven't tested it personally. SD Card files are changed and not backed up, use at your own risk.
## Notes

Super Pads makes use of two libraries I wrote to play with my own SP-404SX, [uttori-audio-padinfo](https://github.com/uttori/uttori-audio-padinfo) for parsing and writing the `PAD_INFO.BIN` file and [uttori-audio-wave](https://github.com/uttori/uttori-audio-wave) for adding the `RLND` header to the Wave files out of FFmpeg, and an Electron wrapper to make it easier to use.

Expand Down
47 changes: 24 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-optimize-regex": "^1.2.0",
"eslint-plugin-ramda": "^2.5.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-security": "^1.4.0",
"eslint-plugin-unicorn": "^25.0.0",
"eslint-plugin-unicorn": "^25.0.1",
"eslint-plugin-xss": "^0.1.10",
"node-sass": "^5.0.0"
},
"dependencies": {
"@uttori/audio-padinfo": "^1.2.0",
"@uttori/audio-wave": "^1.2.0",
"@uttori/audio-padinfo": "^1.2.1",
"@uttori/audio-wave": "^1.6.0",
"ffmpeg-static-electron": "^2.0.1",
"fluent-ffmpeg": "^2.1.2"
},
Expand Down
25 changes: 15 additions & 10 deletions src/workers/parsePads.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,21 @@ onmessage = (event) => {
const files = fs.readdirSync(`${root}/ROLAND/SP-404SX/SMPL/`);
files.forEach((file) => {
if (file[0] !== '.' && path.extname(file) === '.WAV') {
const label = getLabel(file);
const pad = pads.find((p) => p.label === label);
if (pad) {
const { size } = fs.statSync(`${root}/ROLAND/SP-404SX/SMPL/${file}`);
const data = fs.readFileSync(`${root}/ROLAND/SP-404SX/SMPL/${file}`);
const { chunks } = AudioWAV.fromFile(data);
const { duration } = chunks.find((c) => c.type === 'data').value;

pad.duration = duration;
pad.size = size;
// This is only bonus data, don't rely on it
try {
const label = getLabel(file);
const pad = pads.find((p) => p.label === label);
if (pad) {
const { size } = fs.statSync(`${root}/ROLAND/SP-404SX/SMPL/${file}`);
const data = fs.readFileSync(`${root}/ROLAND/SP-404SX/SMPL/${file}`);
const { chunks } = AudioWAV.fromFile(data);
const { duration } = chunks.find((c) => c.type === 'data').value;

pad.duration = duration;
pad.size = size;
}
} catch (error) {
console.error(error);
}
} else {
// console.log('Extra File:', file);
Expand Down

0 comments on commit c76ede5

Please sign in to comment.