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

symetrix-control

v0.1.1

Published

Implements v7.0 of the Composer Control Protocol from Symetrix

Downloads

2

Readme

symetrix-control

Implements v7.0 of the Composer Control Protocol from Symetrix

The Composer Control Protocol is a Telnet-style command/response API which is not typically well-suited to Javascript's asynchronous model. This package gets around that by keeping command requests and callbacks in a FIFO buffer and when a response is received from the endpoint, the callback is executed and the next command is sent. This package guarantees that commands are sent in the order in which they are called.

You get Promises as a consumer of this package so every command takes the form of:

symetrix.command()
        .then((data) => {
            console.log(data);
        })
        .catch((err) => console.log(err));

Additional commands can be nested inside returned Promises if desired

Install

npm install symetrix-control

Quick start

const Symetrix = require('symetrix-control');

this.sym = new Symetrix({ host: '172.16.10.200' });

this.sym.on('connected', () => {
    this.sym.on('push', (data) => {
        console.log('Push received from Symetrix', data);
    });

    this.sym
        .pushState(true)
        .then((data) => {
            console.log('push state:', data);
        })
        .catch((err) => console.log(err));

    this.sym
        .controlGet(1000)
        .then((data) => {
            console.log('get:', data);
        })
        .catch((err) => console.log(err));

    this.sym
        .pushRefresh()
        .then((data) => {
            console.log('refresh push:', data);
        })
        .catch((err) => console.log(err));

    this.sym
        .controlGetBlock(1000, 10)
        .then((data) => {
            console.log('get block:', data);
        })
        .catch((err) => console.log(err));

    this.sym
        .flashUnit()
        .then((data) => {
            console.log('flash:', data);
        })
        .catch((err) => console.log(err));
});

Symetrix

Kind: global class

symetrix.controlSet(id, value) ⇒ Promise

Use this command to move a controller position on the currently addressed unit to a new absolute value

Kind: instance method of Symetrix

| Param | Type | Description | | --- | --- | --- | | id | number | the control ID to set, between 1 and 10000 | | value | number | the value to set the control ID to, between 0 and 65535 |

symetrix.controlChange(id, value) ⇒ Promise

Use this command to move a controller to a new relative value. This command will increment or decrement a controller by a specified amount

Kind: instance method of Symetrix

| Param | Type | Description | | --- | --- | --- | | id | number | the control ID to set, between 1 and 10000 | | value | number | the value to change the control ID by, between -65535 and 65535 |

symetrix.controlGet(id) ⇒ Promise

This command will return the controller position (value) associated with a specific controller number

Kind: instance method of Symetrix

| Param | Type | Description | | --- | --- | --- | | id | number | the control ID to get, between 1 and 10000 |

symetrix.controlGetBlock(id, size) ⇒ Promise

This command will return the controller position (value) of a specific range of consecutive controller numbers.

Kind: instance method of Symetrix

| Param | Type | Description | | --- | --- | --- | | id | number | the first control ID to get, between 1 and 10000 | | size | number | the number of consecutive control IDs to get, between 1 and 256 |

symetrix.reboot() ⇒ Promise

This command will instantly reboot the unit

Kind: instance method of Symetrix

symetrix.flashUnit() ⇒ Promise

This command momentarily flashes the front panel LEDs of the unit being addressed

Kind: instance method of Symetrix

symetrix.setSystemString(resource, value) ⇒ Promise

This command sets a system string such as a speed dial name or number. Refer to the Composer Control documentation for details on valid strings and values

Kind: instance method of Symetrix

| Param | Type | Description | | --- | --- | --- | | resource | string | the string resource to set | | value | string | the value to set the string resource to |

symetrix.getSystemString(resource) ⇒ Promise

This command sets a system string such as a speed dial name or number. Refer to the Composer Control documentation for details on valid strings

Kind: instance method of Symetrix

| Param | Type | Description | | --- | --- | --- | | resource | string | the string resource to get |

symetrix.getPreset() ⇒ Promise

This command will return the last preset that was loaded

Kind: instance method of Symetrix

symetrix.loadPreset(id) ⇒ Promise

This command will load the specified preset (1-1000) on the currently addressed unit.

Kind: instance method of Symetrix

| Param | Type | Description | | --- | --- | --- | | id | number | the preset number to set, between 1 and 1000 |

symetrix.pushState(enable, [low], [high]) ⇒ Promise

This command enables or disables the push feature for an individual controller or range of controllers. To select an individual controller to enable/disable push on set high equal to low Using the default values will enable or disable pushing for all control IDs

Kind: instance method of Symetrix

| Param | Type | Description | | --- | --- | --- | | enable | boolean | if push should be enabled or disabled | | [low] | number | the lowest control ID that should be enabled/disabled, defaults to 1 | | [high] | number | the highest control ID that should be enabled/disabled, defaults to 10000 |

symetrix.getPushEnabled([low], [high]) ⇒ Promise

This command returns a list of all controllers currently enabled for push on the addressed device. To select an individual controller set high equal to low Using the default values will query all control IDs

Kind: instance method of Symetrix

| Param | Type | Description | | --- | --- | --- | | [low] | number | the lowest control ID that should be queried, defaults to 1 | | [high] | number | the highest control ID that should be queried, defaults to 10000 |

symetrix.pushRefresh([low], [high]) ⇒ Promise

This command causes data to be pushed immediately even if it hasn’t changed (assuming push is enabled). To select an individual controller to refresh set high equal to low. Using the default values will refresh all control IDs

Kind: instance method of Symetrix

| Param | Type | Description | | --- | --- | --- | | [low] | number | the lowest control ID that should be refreshed, defaults to 1 | | [high] | number | the highest control ID that should be refreshed, defaults to 10000 |

symetrix.pushClear([low], [high]) ⇒ Promise

This command causes previous changes in data to be ignored and not pushed. It may be desirable to issue this command when first enabling push to prevent being swamped by the flood incoming data. To select an individual controller to clear set high equal to low. Using the default values will clear all control IDs

Kind: instance method of Symetrix

| Param | Type | Description | | --- | --- | --- | | [low] | number | the lowest control ID that should be refreshed, defaults to 1 | | [high] | number | the highest control ID that should be refreshed, defaults to 10000 |

symetrix.pushInterval(value) ⇒ Promise

This command changes the minimum length of time between consecutive pushes of data. At power-up, this value defaults to 100 milliseconds. Interval must be between 20 (20ms) and 30000 (30s)

Kind: instance method of Symetrix

| Param | Type | Description | | --- | --- | --- | | value | number | the new push interval in milliseconds |

symetrix.pushThreshold([meter], [other]) ⇒ Promise

This command changes the push threshold value. The threshold is the amount a value must change from the previous push before it is pushed again. SymNet maintains two thresholds: one for parameter data such as faders and buttons, and another for meters (including LEDs). It may be desirable to use a large threshold for meters to avoid constant pushing of values. The power-on default for both is 1.

Kind: instance method of Symetrix

| Param | Type | Description | | --- | --- | --- | | [meter] | number | the threshold for meters, defaults to 1 | | [other] | number | the threshold for everything else, defaults to 1 |