open-index/open-npm huggingface dataset:
npm package: @soundworks/max
Description: A Max client for sharing states with soundworks@v4
Latest version: 1.1.1

# soundworks | max

Utility to monitor and control soundworks' shared states within [Max](https://cycling74.com/products/max-features).

Notes: 
- This repository has been tested on Mac only, Windows version should work but is untested.

## Table of Contents

<!-- toc -->

- [Max](#max)
  * [Install](#install)
  * [Usage](#usage)
  * [Running the example](#running-the-example)
- [Javascript](#javascript)
  * [Install](#install-1)
  * [Usage](#usage-1)
- [Caveats](#caveats)
- [Development notes](#development-notes)
  * [Link Max package into `Documents/Max 8/Packages`](#link-max-package-into-documentsmax-8packages)
  * [Running the test suite](#running-the-test-suite)
  * [How to open patcher?](#how-to-open-patcher)
- [Credits](#credits)
- [License](#license)

<!-- tocstop -->

## Max

### Install

1. Download the Max package (soundworks-max.zip) from the release :  
[https://github.com/collective-soundworks/soundworks-max/releases](https://github.com/collective-soundworks/soundworks-max/releases)
2. Unzip the package and copy the resulting directory in `~/Documents/Max 8/Packages`
3. Open the helper patch for more informations

### Usage

See the overview patch for more informations  
cf. `~/Documents/Max 8/Packages/soundworks/extras/soundworks.maxpat`

### Running the example

1. In the "overview" menu click `soundworks.shared-state`  
2. Start the soundworks server by opening the `soundworks.example.server`   
and follow the instructions.

## Javascript

### Install

```sh
npm install --save @soundworks/max
```

### Usage

In the `src/server/index.js` of your soundworks application, and configure the Max client:

```js
import { Server } from '@soundworks/core/server.js';
// 1. Import the `configureMaxClient` function from the @soundworks/max package
import { configureMaxClient } from '@soundworks/max';
import { loadConfig } from '../utils/load-config.js';

// 2. Configure max client
const config = loadConfig(process.env.ENV, import.meta.url);
configureMaxClient(config);

const server = new Server(config);
```

## Caveats

Each `soundworks.shared-state` object creates a new soundworks client, which is 
known suboptimal, but improves user friendliness.

One of our unit test use 25 instances, which work on all systems without issues.  
This test has been run with 100 objects successfully on ARM, but not on Intel.  

## Development notes

### Link Max package into `Documents/Max 8/Packages`

```sh
ln -s .path/to/soundworks-max/max/soundworks ~/Documents/Max\ 8/Packages
```

### Running the test suite

Launching all the tests

```
npm test -- tests/**/*.spec.js
```

Launching only one test file

```
npm test -- tests/the-test/index.spec.js
```

For verbose output

```
VERBOSE=1 npm test -- tests/the-test/index.spec.js
```

### How to open patcher?

`CMD + OPTION + M` then `CMD + E` then click on the button

## Credits

[https://soundworks.dev/credits.html](https://soundworks.dev/credits.html)

## License

[BSD-3-Clause](./LICENSE)
npm package: @soundworks/plugin-audio-streams
Description: soundworks plugin dedicated at managing audio streams
Latest version: 0.0.1

# `@soundworks/plugin-audio-streams` (to update)

> [`soundworks`](https://github.com/collective-soundworks/soundworks) plugin that just defer its initialization. Created for testing the plugin manager life cycle (let us know if you find any other use case from that, ...).

## Table of Contents

<!-- toc -->

- [Installation](#installation)
- [Example](#example)
- [Usage](#usage)
  * [Server installation](#server-installation)
    + [Registering the plugin](#registering-the-plugin)
    + [Requiring the plugin](#requiring-the-plugin)
  * [Client installation](#client-installation)
    + [Registering the plugin](#registering-the-plugin-1)
    + [Requiring the plugin](#requiring-the-plugin-1)
- [Credits](#credits)
- [License](#license)

<!-- tocstop -->

## Installation

```sh
npm install @soundworks/plugin-delay --save
```

## Example

A working example can be found in the [https://github.com/collective-soundworks/soundworks-examples](https://github.com/collective-soundworks/soundworks-examples) repository.

## Usage

### Server installation

#### Registering the plugin

```js
// index.js
import { Server } from '@soundworks/core/server';
import pluginPluginFactory from '@soundworks/plugin-delay/server';

const server = new Server();
server.pluginManager.register('delay', pluginPluginFactory, {
  startedDelayTime: 1,
  readyDelayTime: 1,
}, []);
```

#### Requiring the plugin

```js
// MyExperience.js
import { AbstractExperience } from '@soundworks/core/server';

class MyExperience extends AbstractExperience {
  constructor(server, clientType) {
    super(server, clientType);
    // require plugin in the experience
    this.delay = this.require('delay');
  }
}
```

### Client installation

#### Registering the plugin

```js
// index.js
import { Client } from '@soundworks/core/client';
import pluginPluginFactory from '@soundworks/plugin-delay/client';

const client = new Client();
client.pluginManager.register('delay', pluginPluginFactory, {
  startedDelayTime: 1,
  readyDelayTime: 1,
}, []);
```

#### Requiring the plugin

```js
// MyExperience.js
import { Experience } from '@soundworks/core/client';

class MyExperience extends Experience {
  constructor(client) {
    super(client);
    // require plugin in the experience
    this.delay = this.require('delay');
  }
}
```

## Credits

The code has been initiated in the framework of the WAVE and CoSiMa research projects, funded by the French National Research Agency (ANR).

## License

BSD-3-Clause
npm package: @soundworks/plugin-delay
Description: soundworks plugin that delays its initialization, created for testing purposes
Latest version: 1.0.0

# `@soundworks/plugin-delay`

> [`soundworks`](https://github.com/collective-soundworks/soundworks) plugin that just defer its initialization. Created for testing the plugin manager life cycle (let us know if you find any other use case from that, ...).

## Table of Contents

<!-- toc -->

- [Installation](#installation)
- [Example](#example)
- [Usage](#usage)
  * [Server installation](#server-installation)
    + [Registering the plugin](#registering-the-plugin)
    + [Requiring the plugin](#requiring-the-plugin)
  * [Client installation](#client-installation)
    + [Registering the plugin](#registering-the-plugin-1)
    + [Requiring the plugin](#requiring-the-plugin-1)
- [Credits](#credits)
- [License](#license)

<!-- tocstop -->

## Installation

```sh
npm install @soundworks/plugin-delay --save
```

## Example

A working example can be found in the [https://github.com/collective-soundworks/soundworks-examples](https://github.com/collective-soundworks/soundworks-examples) repository.

## Usage

### Server installation

#### Registering the plugin

```js
// index.js
import { Server } from '@soundworks/core/server';
import pluginPluginFactory from '@soundworks/plugin-delay/server';

const server = new Server();
server.pluginManager.register('delay', pluginPluginFactory, {
  startedDelayTime: 1,
  readyDelayTime: 1,
}, []);
```

#### Requiring the plugin

```js
// MyExperience.js
import { AbstractExperience } from '@soundworks/core/server';

class MyExperience extends AbstractExperience {
  constructor(server, clientType) {
    super(server, clientType);
    // require plugin in the experience
    this.delay = this.require('delay');
  }
}
```

### Client installation

#### Registering the plugin

```js
// index.js
import { Client } from '@soundworks/core/client';
import pluginPluginFactory from '@soundworks/plugin-delay/client';

const client = new Client();
client.pluginManager.register('delay', pluginPluginFactory, {
  startedDelayTime: 1,
  readyDelayTime: 1,
}, []);
```

#### Requiring the plugin

```js
// MyExperience.js
import { Experience } from '@soundworks/core/client';

class MyExperience extends Experience {
  constructor(client) {
    super(client);
    // require plugin in the experience
    this.delay = this.require('delay');
  }
}
```

## Credits

The code has been initiated in the framework of the WAVE and CoSiMa research projects, funded by the French National Research Agency (ANR).

## License

BSD-3-Clause
npm package: @soundworks/state-manager-osc
Description: Utility to monitor and control soundworks' shared state within Max through OSC
Latest version: 0.2.2

# `@soundworks/state-manager-osc`

> Utility to monitor and control soundworks' shared states within Max using OSC communications

<!--![Max screenshot](./resources/max.png)-->

_**Warning**: this component is experimental and will probably be subject to changes_

## Table of Contents

<!-- toc -->

- [Installation](#installation)
  * [NPM](#npm)
  * [Max/MSP](#maxmsp)
- [Usage](#usage)
  * [Javascript](#javascript)
  * [Max/MSP](#maxmsp-1)
- [Running the example](#running-the-example)
- [License](#license)

<!-- tocstop -->

## Installation

### NPM 

```sh
npm install --save @soundworks/state-manager-osc
```

### Max/MSP

1. Download the Max abstraction (SoundworksAPI.zip) from the releases page: [https://github.com/collective-soundworks/soundworks-state-manager-osc/releases](https://github.com/collective-soundworks/soundworks-state-manager-osc/releases)
2. Unzip the package and copy the resulting directory in `~/Documents/Max 8/Packages`
3. Open the Helper patch for more informations

## Usage

### Javascript

```js
import { Server } from '@soundworks/core/server';
import { StateManagerOsc } from '@soundworks/state-manager-osc';

// init the soundworks server as usual
const config = getConfig(ENV);
const server = new Server();
await server.init(config, /* ... */);

// register and create a global schema
const globalsSchema = {
  volume: {
    type: 'integer',
    min: -80,
    max: 6,
    default: 0,
  },
  mute: {
    type: 'boolean',
    default: false,
  },
};

server.stateManager.registerSchema('globals', globalsSchema);
const globals = await server.stateManager.create('globals');

// start the server
await server.start();

// initialize the StateManagerOsc component
const oscConfig = { // these are the defaults
  localAddress: '0.0.0.0',
  localPort: 57121,
  remoteAddress: '127.0.0.1',
  remotePort: 57122,
};

const oscStateManager = new StateManagerOsc(server.stateManager, oscConfig);
await oscStateManager.init();
// now you can control and monitor the `globals` state from your Max patch
```

### Max/MSP

See the overview Patch for more information  
cf. `~/Document/Max 8/Packages/SoundworksAPI/extras/soundworksAPI.overview.maxpat`

## Running the example

1. Download the repository
2. Go the `example` directory
3. In a terminal, launch the soundworks application

```
cd path/to/soundworks-state-manager-osc/example
npm install 
npm run dev
```

3. Launch a web client in your favorite browser ([http://127.0.0.1:8000]([http://127.0.0.1:8000]))
4. Open the max example patch `example.maxpat`


## License

BSD-3-Clause
npm package: @soundworks/template-build
Description: soundworks-template build scripts
Latest version: 3.2.1

# `@soundworks/template-build`

> `soundworks-template` build scripts for [soundworks#v3](https://github.com/collective-soundworks/soundworks)

General approach:
- `webpack` and `babel` to bundle browser clients
- `chokidar` for file watching
- from v4 - Node processes (server, node clients) should run with "type: module"

## Install

```
npm install --save soundworks-template-build
```

## Usage

```
soundworks-template-build --build [--watch]
soundworks-template-build --minify
soundworks-template-build --watch-process <processName>
```

## Notes

Should support iOS >= 9

> browserlist: 'ios >= 9, not ie 11, not op_mini all'

## Todos

- `typescript` support (see https://github.com/collective-soundworks/soundworks-template-build/pull/1)
- `vue.js` and `react` support

## License

BSD-3-Clause
npm package: @soundworks/template-helpers
Description: set of generic helpers for the soundworks-template
Latest version: 3.0.0

# `@soundworks/template-helpers`

> Set of common helpers for applications based on the [`soundworks-template`](https://github.com/collective-soundworks/soundworks-template). 
>
> _Helpers are already installed in the `soundworks-template`_

## Installation

```
npm install --save @soundworks/template-helpers
```

## `initQoS`

Initialize generic quality of service strategies.

For now, basically reload application when socket close or on visibility change.
__more refined strategies should be created over time.__

### Arguments

- `client {soundworks.Client}` - the soundworks client instance
- `options {Object}`
  + `options.socketClosed = true` - reloads the page if the socket connection is lost, 
    e.g. you generally don't want a client that cannot receive stop messages in a performance.
  + `options.visibilityChange = true` - reloads the page on visiblity change (
    e.g. when your page is no longer the focused tab all scheduling is broken

### Usage

```
import { Client } from '@soundworks/core/client';
import initQoS from '@soundworks/helpers/client/init-qos.js';

async function launch() {
  try {
    const client = new Client();
    await client.init(window.soundworksConfig);
    initQoS(client);

    // ...
  } catch(err) {
    console.error(err);
  }
}

launch();
```


## `renderInitializationScreens`

Display generic initialization screens for plugins

### Usage

```
import { Experience } from '@soundworks/core/client';
import { render, html } from 'lit-html';
import renderInitializationScreens from '@soundworks/template-helpers/client/render-initialization-screens.js';

class ControllerExperience extends Experience {
  constructor(client, config, $container) {
    super(client);

    this.config = config;
    this.$container = $container;

    renderInitializationScreens(client, config, $container);
  }

  // ...
}
```

## License

BSD-3-Clause