open-index/open-npm huggingface dataset:
npm package: @ircam/blocked
Description: test for blockage in event loop
Author: jipodine
Latest version: 1.1.2

# Blocked

Periodic test for event loop, in the browser or in node. Callback to report each time it was blocked.

## Install

```sh
npm install [--save] @ircam/blocked
```

## Example


It is the same usage within node or a web browser.

```js
import Blocked from '@ircam/blocked';

const threshold = 100; // report blockage of more than 100 ms

const blocked = new Blocked( (duration) => {
    console.log(`Blocked for ${duration} ms`);
    }, threshold);

// that's it is runs in the background
```

```js
// in case you want to stop it:
blocked.stop();
```
npm package: @ircam/como
Description: [![npm version](https://badge.fury.io/js/@ircam%2Fcomo.svg)](https://badge.fury.io/js/@ircam%2Fcomo)
Author: Benjamin Matuszewski
Latest version: 2.0.0-beta.11

# @ircam/como

[![npm version](https://badge.fury.io/js/@ircam%2Fcomo.svg)](https://badge.fury.io/js/@ircam%2Fcomo)

![como logo](./docs/public/logo-200x200.png)

Como (for <i>Collective Movement</i>) is a fullstack javascript framework for movement / sound interaction applications

## Documentation

<https://ircam-ismm.github.io/como/>

## Credits

Como is built on top of <https://soundworks.dev>

<https://soundworks.dev/credits.html>

## License

[BSD-3-Clause](./LICENSE)
npm package: @ircam/comote-helpers
Description: Server component & utilities for the CoMote application
Latest version: 1.6.2

# CoMote helpers

Javascript and Max helpers for usage with the the CoMote app.

Also compatible with R-IoT device.

See common format in [sc-motion repository](https://github.com/ircam-ismm/sc-motion/blob/main/FORMAT.md)

Get network information, and generate QR code for CoMote configuration.

Receive and parse sensor stream.
npm package: @ircam/create
Description: Interactive command line tools for scaffolding simple Web Audio test apps and demos.
Latest version: 1.1.3

# Ircam | create

[![npm version](https://badge.fury.io/js/@ircam%2Fcreate.svg)](https://badge.fury.io/js/@ircam%2Fcreate)

Interactive command line tools for scaffolding simple test apps and demos.

## Usage

```sh
npx @ircam/create@latest [dirname]
```

```
Usage: create [options] [dirname]

Arguments:
  dirname                  Directory in which we should create the project

Options:
  -t, --template <string>  Template to use
  -h, --help               display help for command
```

## Development notes

To develop the generator locally:

```sh
// link globally
// in `ircam-create` directory:
sudo npm link
// to create an app
npx @ircam/create
// unlink globally
sudo npm unlink --global @item/create
npm ls --global
```

## Credits

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

## License

[BSD-3-Clause](./LICENSE)
npm package: @ircam/devicemotion
Description: Low level library dedicated at normalizing devicemotion across browsers
Author: Benjamin Matuszewski
Latest version: 1.3.1

# `@ircam/devicemotion`

> Minimal wrapper around the `devicemotion` API (cf. [https://www.w3.org/TR/orientation-event/#devicemotion](https://www.w3.org/TR/orientation-event/#devicemotion) to normalize API, axis and units accross browsers.

**Warning**: Be aware that most, if not all, recent browsers will require your application to run through a `https` connection to grant access to motion sensors.

## Install

```
npm install @ircam/devicemotion --save
```

## Example

```js
import devicemotion from '@ircam/devicemotion';

const permission = await devicemotion.requestPermission();

if (permission === 'granted') {
  devicemotion.addEventListener(e => console.log(e));
}
```

## API

#### `async devicemotion.requestPermission() -> Promise('granted' | 'refused')`

Request permission to access motion sensors, this method should be called on the startup of your application, most browsers will prompt your users so that they authorize the sensors to be accessed by the application

#### `devicemotion.addEventListener(callback: Function) -> void`

The callback will be called with the data formatted as specificied in [https://www.w3.org/TR/orientation-event/#devicemotion](https://www.w3.org/TR/orientation-event/#devicemotion)

```js
devicemotion.addEventListener(e => {
  console.log(e);

  /*
  e = { 
    interval // ms
    accelerationIncludingGravity = { x, y, z } // m/s2
    rotationRate = { alpha, beta, gamma } // deg/s
  }
  */
});
```

**Note:** The event object is internally reused by the library, therefore it's the responsibility of the application to copy the data if needed.

#### `devicemotion.removeEventListener(callback: Function) -> void`

## License

BSD-3-Clause
npm package: @ircam/eslint-config
Description: eslint config for the Ircam ISMM team javascript projects
Author: Benjamin Matuszewski
Latest version: 2.0.1

# `@ircam/eslint-config`

Shareable eslint config for the Ircam ISMM team JavaScript projects, see [https://eslint.org/docs/latest/developer-guide/shareable-configs](https://eslint.org/docs/latest/developer-guide/shareable-configs)

## Usage


1. Install the package

```sh
npm install --save-dev eslint @ircam/eslint-config
```

2. Create a `eslint.config.js` file in your project containing

```js
export { default } from '@ircam/eslint-config';
```

3. In the `package.json`, add the following command to your npm scripts

```json
"scripts": {
  "lint": "npx eslint src"
}
```

## Notes

From `v2.0.0` this package targets `eslint` >= 9

For previous version of `eslint` use the `v1.x.x` of this package


## License

BSD-3-Clause
npm package: @ircam/funny-fullscreen
Description: Enter / Exit fullscreen by pressing top / right and bottom / left corners at the same time during 2 seconds. After the delay, the next `touchend` event will toggle the fullscreen
Author: Benjamin Matuszewski
Latest version: 1.0.1

# FunnyFullScreen

Enter / Exit fullscreen by pressing top / right and bottom / left corners at the
same time during 2 seconds. After the delay, the next `touchend` event will toggle
the fullscreen

## Install

```sh
npm install @ircam/funny-full-screen
```

## Usage

```js
import funnyFullscreen from '@ircam/funny-full-screen';

funnyFullscreen.enable();
funnyFullscreen.disable();
```


## LICENSE

BSD-3-Clause
npm package: @ircam/motion-input
Description: Module that provides unified motion data across platforms (iOS and Android) and browsers
Latest version: 1.0.7

# motion-input

> Module that provides unified motion data across platforms (iOS and Android) and browsers.

## Installation

```sh
npm install [--save] collective-soundworks/motion-input
```

## Example

[motion-input](https://cdn.rawgit.com/collective-soundworks/motion-input/c43ae4ae/examples/motion-input/index.html)

## Usage

```js
const motionInput = require('motion-input');
 
motionInput
  .init(['accelerationIncludingGravity'])
  .then(([accelerationIncludingGravity]) => {

    if (accelerationIncludingGravity.isValid) {
      accelerationIncludingGravity.addListener(val => {
        console.log(val) 
      });
    }
    // ...
  })
  .catch(err => console.error(err.stack));
```

## Warning

Due to some weird (buggy ?) behavior in Chrome and and Firefox, if you need to use both `'acceleration'` and `'orientation'` modules, `'acceleration'` should always be initialized and listened **before** `'orientation'`.
npm package: @ircam/node-discovery
Description: Simple utility to discover devices on a network
Author: Benjamin Matuszewski
Latest version: 2.2.0

# `@ircam/node-discovery`

Simple Node.js utility to discover devices on a network

## Install

```sh
npm install --save @ircam/node-discovery
```

## Example Use

### Server-side

```js

```


```js

```


## License

[BSD-3-Clause](./LICENSE)
npm package: @ircam/resume-audio-context
Description: simple one-liner utility to resume audio context
Latest version: 1.0.2

# `@ircam/resume-audio-context`

> simple one-liner utility to resume audio context. The utility creates a full-screen button that waits for a user interaction (e.g. a 'click' event) to resume the audioContext and resolve the promise.

## Install

```sh
npm install --save @ircam/resume-audio-context
```

## Usage

```js
import { resumeAudioContext } from '@ircam/resume-audio-context';

const audioContext = new AudioContext();

(async function() {
  await resumeAudioContext(audioContext);
  console.log('audioContext resumed');
}());
```

## License

BSD-3-Clause
npm package: @ircam/sc-audio
Description: Web Audio synthesizers, effects and utilities
Latest version: 0.5.1

# sc-audio

_sc-audio_ is a [Web Audio](https://webaudio.github.io/web-audio-api/) library for prototyping and creating interactive audio applications both in the browser and Node.js (see [isomorphic-web-audio-api](https://github.com/ircam-ismm/isomorphic-web-audio-api)).

The main philosophy behind _sc-audio_ is to provide audio nodes that behave, as much as, possible, similarly to native audio nodes, so that they can be inserted seamlessly into regular Web Audio graphs.

<!-- While we don't refuse per se to use AudioWorklet, we try to rely other native nodes wherever possible so that applications running on non-secure `http` protocol can still use most parts of the library. -->

> _Work in progress_

## Documentation

[http://ircam-ismm.github.io/sc-audio](http://ircam-ismm.github.io/sc-audio)

You can also run the examples in `docs/examples` using Node.js, by simply cloning the repository and run:

```sh
npm install
node docs/examples/BypassNode.js
```

## Install

```sh
npm install --save @ircam/sc-audio
```

## Example Use

```js
import {
  AudioContext,
  AudioBufferSourceNode,
  ConvolverNode,
} from 'isomorphic-web-audio-api';
import {
  AudioBufferLoader,
  DistributorNode,
} from '@ircam/sc-audio';

// in browsers, you will need to resume on a user gesture
const audioContext = new AudioContext();
// load an audio buffer
const loader = new AudioBufferLoader(audioContext);
const ir = await loader.load('../assets/room-large.wav');
const buffer = await loader.load('../assets/drum-loop.wav');

// create the graph
const convolver = new ConvolverNode(audioContext, { buffer: ir });
convolver.connect(audioContext.destination);

const dryWet = new DistributorNode(audioContext);
// connect dry output (0) to destination
dryWet.connect(audioContext.destination, 0);
// connect wet output (1) to convolver
dryWet.connect(convolver, 1);

// pipe a source in the graph
const src = new AudioBufferSourceNode(audioContext, { buffer, loop: true });
src.connect(dryWet);
src.start();

// ramp from dry to wet in 4 seconds, then back to dry
dryWet.ratio.setValueAtTime(0, audioContext.currentTime);
dryWet.ratio.linearRampToValueAtTime(1, audioContext.currentTime + buffer.duration);
dryWet.ratio.exponentialRampToValueAtTime(0.001, audioContext.currentTime + buffer.duration * 2);
```

## License

[BSD-3-Clause](./LICENSE)
npm package: @ircam/sc-gettime
Description: Unified clock in seconds between node and browser
Author: Benjamin Matuszewski
Latest version: 1.1.0

# `@ircam/sc-gettime`

Provide a unified clock in seconds accross platforms, with an origin defined by
the start of the process.

## Install

```
npm install --save @ircam/sc-gettime
```

## Usage

The interface is the same wether you are on a node process

```js
import { getTime } from '@ircam/sc-gettime';

setInterval(() => {
  console.log(getTime());
}, 1000);
```

## Notes

- In Node.js, use `process.hrtime.bigint()` 
see: https://nodejs.org/api/process.html#processhrtimebigint 

- In browsers, use `performance.now()` if available, and falls back on `Date.now()` 
see: https://developer.mozilla.org/en-US/docs/Web/API/Performance/now 
see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now 

## License

BSD-3-Clause
npm package: @ircam/soap-score
Description: SO(a)P score is a mini-language to describe structure of a score along with a JavaScript interpreter and audio engine to create application such as sequencers, metronomes, etc.
Latest version: 1.1.6

# SO(a)P Score

SO(a)P score is a mini-language to describe structure of a score along with a JavaScript interpreter and audio engine to create application such as sequencers, metronomes, etc.

## Example application

[https://ircam-ismm.github.io/soap-score/](https://ircam-ismm.github.io/soap-score/)

## Score syntax

```
BAR 1 [3+2+2/8] TEMPO [3/8]=60
BAR 2 [3+2+2/8] TEMPO [3/8]=60 curve 2
BAR 4 [2+3+2/8] TEMPO [3/8]=120
```

[Syntax documentation](./docs/SYNTAX.md)

## Credits

The project has received support from:
- the SO(a)P UPI project funded by Ircam 
- the DOTS project (ANR-22-CE33-0013-01) funded by the French National Research Agency (ANR).

## License

[BSD-3-Clause](./LICENSE)
npm package: @ircam/ticker
Description: Execute a given callback at periodic interval, trying to minimize drift and jitter
Author: Benjamin Matuszewski
Latest version: 1.0.7

# @ircam/ticker


> Execute a given callback at periodic interval, trying to minimize drift and jitter.

## Install

```
npm install [--save] @ircam/ticker
```

## Usage

```js
import Ticker from '@ircam/ticker'

const period = 50; // in milliseconds
const ticker = new Ticker(period, (logicalTime, currentTime, error) => {
  console.log(logicalTime, currentTime, error);
});

ticker.start();
```

# API

<a name="Ticker"></a>

## Ticker
Precise periodic timer (based on `setTimeout`) that monitor and adapt itself
to stay close to the given therical period. In particular, try to minimize
the drift caused by the use of a raw `setTimeout`.
Observed average jitter is around +/- 2ms.

**Kind**: global class  

* [Ticker](#Ticker)
    * [new Ticker(period, callback, options)](#new_Ticker_new)
    * [.period](#Ticker+period) : <code>Number</code>
    * [.start()](#Ticker+start)
    * [.stop()](#Ticker+stop)

<a name="new_Ticker_new"></a>

### new Ticker(period, callback, options)

| Param | Type | Description |
| --- | --- | --- |
| period | <code>Number</code> | period of the timer interval in milliseconds  (floored if float is given) |
| callback | [<code>TickerCallback</code>](#TickerCallback) | callback to execute on each tick |
| options | <code>Object</code> | additionnal options |
| [options.errorThreshold] | <code>Number</code> | Threshold error where the timer  considers itself as out of bounds. Increasing this value tends to increase  the overall jitter. |

<a name="Ticker+period"></a>

### ticker.period : <code>Number</code>
Period of the timer. Must be an integer, the given value is floored.
When updated the new value is applied at the next tick.

**Kind**: instance property of [<code>Ticker</code>](#Ticker)  
<a name="Ticker+start"></a>

### ticker.start()
Start the ticker instance.

**Kind**: instance method of [<code>Ticker</code>](#Ticker)  
<a name="Ticker+stop"></a>

### ticker.stop()
Stop the ticker instance.

**Kind**: instance method of [<code>Ticker</code>](#Ticker)  
<a name="TickerCallback"></a>

## TickerCallback : <code>function</code>
**Kind**: global typedef  

| Param | Type | Description |
| --- | --- | --- |
| logicalTime | <code>Number</code> | logical time since `start` in ms |
| currentTime | <code>Number</code> | current time as returned by `performance.now` |
| error | <code>Number</code> | current error |



## License

BSD-3-Clause