Socket
Socket
Sign inDemoInstall

focusrite

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    focusrite

Focusrite Control API


Version published
Weekly downloads
5
Maintainers
1
Install size
7.99 kB
Created
Weekly downloads
 

Readme

Source

Focusrite Control API

Focusrite Control API

No dependencies 💪


Installation

npm install focusrite

Examples (test.js)

Start by importing the library

const focusrite = require('focusrite');

Create a fake ControlServer

focusrite.createFakeServer([
    `<client-details id="XXXXXXXXX"/>`,
    `<device-arrival> ... </device-arrival>`,
    ...
], (data) => {
    console.log(data);
});

Find the running ControlServer port

focusrite.findServerPort((port) => {
    console.log(`ControlServer port is : ${port}`);
});

Connect to the ControlServer as a fake client

focusrite.createFakeClient(port, 'xxxxxxxx-0000-xxxx-xxxx-xxxxxxxxxxxx', (onData, clientWrite) => {
    onData((data) => {
        console.log(data);

        // These commands are compatible with the Scarlett SOLO (3rd gen) :

        // To write a response
        clientWrite(`<set devid="1"> ... </set>`);

        // To change gain halos colors
        clientWrite(focusrite.requests.MODE_COLOR); // First set in "color" mode
        clientWrite(focusrite.colors.RED); // Availables colors : RED, AMBER, GREEN, LIGHT_BLUE, BLUE, LIGHT_PINK, PINK

        // To enable/disable AIR Mode
        clientWrite(focusrite.requests.A1_PREAMP_TRUE); // Enable
        clientWrite(focusrite.requests.A1_PREAMP_FALSE); // Disable

        // To enable/disable INST Mode
        clientWrite(focusrite.requests.A2_INST_TRUE); // Enable
        clientWrite(focusrite.requests.A2_INST_FALSE); // Disable
        
        // To send a custom command
        clientWrite(`<set devid="..."> ... </set>`);

        // Model of a command :
        /*
        <set devid="{ Device ID (ex: "1") }">
            <item
                id="{ Parameter ID (ex: "44" to change the color) }"
                value="{ Parameter value (ex: "red" to change the color) }"
            />
        </set>
        */
    });
});

Problems

If you have errors in console or unwanted behavior, just reload the page. If the problem persists, please create an issue here.

Keywords

FAQs

Last updated on 11 Jul 2020

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc