Socket
Book a DemoInstallSign in
Socket

@stnew/ableton-parser

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stnew/ableton-parser

Return MIDI or Locator data from Ablton .als files

latest
Source
npmnpm
Version
0.4.1
Version published
Weekly downloads
6
200%
Maintainers
4
Weekly downloads
 
Created
Source

@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 timecodes
  • getLocatorData - Returns a promise containing Locator timecodes, names, and annotations
  • getDuration - 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

FAQs

Package last updated on 22 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts