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

json2ableton-live-skin

v0.1.0

Published

Tools for editing/creating Ableton Live 8/9 skin files using .json files.

Downloads

3

Readme

json2ableton-live-skin

Tools for editing/creating Ableton Live 8/9 skin files using .json files.

API

Read a skin

const { parseSkinFile } = require('json2ableton-live-skin');
const skinFileBuffer = fs.readFileSync(__dirname + '/skinFile.ask');
const skin = parseSkinFile(skinFileBuffer);
console.log(skin);
// => {"format":"live9","ControlForeground":[0,0,0,255],"TextDisabled":[90,90,9..."ViewCheckControlDisabledOff":[66,66,66,255]}

See examples/getCSSColors.js for an example using the 'cssColors: true' option.

Notes

If you choose 'hex', 'rgb', or 'hsl' for the cssColorType option for parseSkinFile, the outputted colors will have no alpha. ('rgba' and 'hsla' are available for rgb with alpha and hsl with alpha, respectively)

Create a skin

const { createSkinFile } = require('json2ableton-live-skin');
const skinMap = require('./skinMap.json'); // see examples/myskin9.json or examples/myskin8.json
const skinFileBuffer = createSkinFile(skinMap);
console.log(skinFileBuffer);
// => <Buffer ab 1e 56 78 04 cf 00 00 00 00 0b 53 6b 69 6e 4d 61 6e 61 67 65 72 03 00 00 00 00 0b 53 6b 69 6e 4d 61 6e 61 67 65 72 74 00 00 00 11 00 00 00 43 00 6f ... >

Edit a skin

See examples/editSkin.js for an example which uses parseSkinFile to read a .ask file, edits it, then uses createSkinFile to write the modified skin.

See examples/editSkinCustomTemplate.js for an example which uses createSkinFile's skinFileTemplate option.

Migrate a skin

See examples/upgradeSkinFile.js for an example which upgrades a Live 8 skin file to the Live 9 format.

See examples/upgradeSkinMap.js for an example which upgrades a Live 8 skin map to the Live 9 skin map format.

CLI

ask2json

Create a skin map (.json) from a skin file (.ask).

Usage
  $ ask2json <source-file> [json-destination]

If you don't provide a json-destination, the .json skin map contents will be written to stdout.

Options
  --css-colors, -C      Convert the colors in the source file to CSS colors (use --css-color-type to choose format)
  --css-color-type, -T  If using --css-colors, determines the color format.
                          One of: ['rgb', 'rgba', 'hsl', 'hsla', 'hex'] (default is 'rgba')
                          Note: 'rgb', 'hsl', and 'hex' color formats do not include the alpha channel.
  --bare                Do not write the skin format in the skin map (e.g. "format": "live8") 

Examples
  $ ask2json ./Material.ask ./material-skin.json
  $ ask2json ./BlueSkin.ask ./blue-skinmap.json --css-colors --css-color-type hex
  $ ask2json ./Browns.ask # pipes .json file to stdout

json2ask

Create a skin file (.ask) from a skin map (.json).

Usage
  $ json2ask <source-file> [skin-destination]

If you don't provide a skin-destination, the .ask skin file contents will be written to stdout.

Options
  --template <template-file>  A template .ask file to be edited to create the final .ask
  --live8                     Use this flag if you wish to create a Live 8-format skin (see skinMap-8.json)
                              You can also specify that a skin map is Live 8-format by including:
                                "format": "live8"

                              Note: You cannot yet create a Live 9-format skin using a Live 8-format template.

Examples
  $ json2ask ./lightSkin.json ./output/Light.ask
  $ json2ask ./material.json ./Material.ask --template ./template.ask
  $ json2ask ./my8patch.json ./Default8.ask --live8 --template ./MyDefault8.ask
  $ json2ask ./bright-skin.json # pipes .ask file to stdout

migrate-ask-json

Migrate a skin file (.ask) or a skin map (.json) from/to Live 8 format to/from Live 9 format.

Usage
  $ migrate-ask-json <source-file (.ask or .json)> <skin/json-destination>

Options
  --mode <upgrade|downgrade>  Specify whether upgrade the source file from Live 8-format to Live 9-format, or downgrade.
                              If unspecified, \`migrate-ask-json\` will try to determine the mode based on the source file.
                              Default is 'upgrade' 

Examples
  $ migrate-ask-json ./live8-skin.json ./live9-skin.json
  $ migrate-ask-json ./Live9Skin.ask ./Live8Skin.ask

Meta

Contributing

Please see contributing.md and code-of-conduct.md.

License

Please see license.md.

TODO

  • Tests
  • Docs
  • Binary that identifies the format of a skin map (.json) or a skin file (.ask)