@stnew/ableton-parser
v0.4.1
Published
Return MIDI or Locator data from Ablton .als files
Downloads
2
Keywords
Readme
@stnew/ableton-parser
Install
npm i @stnew/ableton-parser
Node.js
To use with Node.js, pass a file path or URL to the .als
file in the Ableton
constructor:
import Ableton from '@stnew/ableton-parser'
const parser = new Ableton('/path/to/file.als')
Methods
getMidiTrack
- Returns a promise containing MIDI note timecodesgetLocatorData
- Returns a promise containing Locator timecodes, names, and annotationsgetDuration
- Returns a promise containing track duration
Example
const handler = async (req, res) => {
const parser = new Ableton(req.url);
const midi = await parser.getMidiTrack();
const duration = await parser.getDuration();
const data = {
midi,
duration,
};
res.setHeader('Content-Type', 'application/json');
res.statusCode = 200;
res.end(JSON.stringify(data));
};
CLI
Install globally to process files via command-line:
npm i -g @stnew/ableton-parser
Options
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
-m, --midi Extract MIDI note timecodes [boolean]
-l, --locators Extract Locator timecodes, names, and annotations [boolean]
-d, --duration Extract track duration [boolean]
Examples
You must specify a flag and a file path or url to the .als
file
ableton --midi path/to/file.als
ableton -mld https://example.com/path/to/file.als