Socket
Socket
Sign inDemoInstall

@soundworks/core

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@soundworks/core - npm Package Compare versions

Comparing version 3.0.0-alpha.7 to 3.0.0-alpha.8

__backup/client/index.js

12

client/Client.js

@@ -100,12 +100,10 @@ "use strict";

this.type = config.clientType; // @todo - review that to adapt to ws options
this.type = config.clientType;
this.config = config; // @todo - review that to adapt to ws options
const websockets = Object.assign({
url: '',
this.config.env.websockets = Object.assign({
// url: '',
path: 'socket' // pingInterval: 5 * 1000,
}, config.websockets);
this.config = Object.assign({}, config, {
websockets
}); // init communications
}, config.env.websockets); // init communications

@@ -112,0 +110,0 @@ await this.socket.init(this.type, this.config);

@@ -8,5 +8,5 @@ "use strict";

var _Experience = _interopRequireDefault(require("./Experience"));
var _Experience2 = _interopRequireDefault(require("./Experience"));
var _Client = _interopRequireDefault(require("./Client"));
var _Client2 = _interopRequireDefault(require("./Client"));

@@ -45,8 +45,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

//
const Experience = _Experience.default; // export const Service = TmpService;
const Experience = _Experience2.default; // export const Service = TmpService;
exports.Experience = Experience;
const Client = _Client.default;
const Client = _Client2.default;
exports.Client = Client;
var _default = undefined;
exports.default = _default;

@@ -75,3 +75,3 @@ "use strict";

path
} = config.websockets;
} = config.env.websockets;
let url;

@@ -78,0 +78,0 @@

{
"name": "@soundworks/core",
"version": "3.0.0-alpha.7",
"version": "3.0.0-alpha.8",
"description": "full-stack javascript framework for distributed audio visual experiences on the web",

@@ -23,12 +23,14 @@ "authors": [

"deploy": "np --yolo",
"doc": "jsdoc -c jsdoc.json",
"version": "npm run clean && npm run transpile && npm run doc && git add docs",
"transpile:client": "babel src/client --out-dir client",
"transpile:server": "babel src/server --out-dir server",
"transpile:common": "babel src/common --out-dir common",
"transpile": "npm run clean && npm run transpile:server && npm run transpile:client && npm run transpile:common",
"watch:client": "chokidar src/client/ -c \"npm run transpile:client\"",
"watch:server": "chokidar src/server/ -c \"npm run transpile:server\"",
"watch:common": "chokidar src/common/ -c \"npm run transpile:common\"",
"watch": "npm run transpile && concurrently \"npm run watch:client\" \"npm run watch:server\" \"npm run watch:common\""
"docs:build": "vuepress build docs",
"docs": "jsdoc -c jsdoc.json",
"prepublishOnly": "npm run build",
"version": "npm run clean && npm run build && npm run doc && git add docs",
"build:client": "babel src/client --out-dir client",
"build:server": "babel src/server --out-dir server",
"build:common": "babel src/common --out-dir common",
"build": "npm run clean && npm run build:server && npm run build:client && npm run build:common",
"dev:client": "chokidar src/client/ -c \"npm run build:client\"",
"dev:server": "chokidar src/server/ -c \"npm run build:server\"",
"dev:common": "chokidar src/common/ -c \"npm run build:common\"",
"dev": "npm run build && concurrently \"npm run dev:client\" \"npm run dev:server\" \"npm run dev:common\""
},

@@ -56,4 +58,4 @@ "dependencies": {

"@babel/core": "^7.4.5",
"@babel/plugin-proposal-export-default-from": "^7.5.2",
"@babel/preset-env": "^7.4.5",
"@babel/plugin-proposal-export-default-from": "^7.5.2",
"@ircam/jsdoc-template": "^1.0.2",

@@ -64,4 +66,5 @@ "chokidar": "^3.0.1",

"jsdoc": "^3.6.2",
"np": "^5.0.3"
"np": "^5.0.3",
"vuepress": "^1.4.0"
}
}
# `soundworks`
> @warning: this README relates to v2 and is outdated
![soundworks-logo](./assets/logo-200x200.png)
<!-- should 200x200 -->
> Full-stack JavaScript framework for distributed WebAudio and multimedia applications.
![logo](https://cdn.rawgit.com/collective-soundworks/soundworks/master/docs-resources/soundworks-logo.jpg)
***soundworks*** is a framework to create collaborative/collective audiovisual experiences where users interact through their mobile devices.
The framework is entirely based on web APIs with a *Node.js* server and provides a set of services to easily setup the infrastructure and the most basic functionalities of an application.
The fundamental motivation behind all design choices of the framework is to allow developers to focus on the implementation of audiovisual rendering and interaction design based on web standards.
A *soundworks* application is typically organized in a client part (i.e. running in the web browser of the client devices) and an optional server part (i.e. running in Node.js).
The server part of an application allows the connected clients to exchange data and to influence each other's audiovisual rendering.
*Client-only* applications created with the frameworks can be deployed through a simple HTTP server instead of Node.js.
## Documentation

@@ -22,99 +11,55 @@

## Getting Started
## Overview
### Requirements
`soundworks` follows a client / server architecture where the server is written using [Node.js](https://nodejs.org/) and clients can be either regular browser clients or Node.js clients running for example on a Raspberry Pi.
Developing *soundworks* applications requires [*Node.js*](https://nodejs.org/) (>= 0.12).
![high-level-architecture](./assets/high-level-architecture.png)
The framework heavily relies on the [*Web Audio API*](https://www.w3.org/TR/webaudio/) as well as on other upcoming standards, which may limit the compatible platforms (i.e. browsers) on the client side of the applications.
The core of the framework is very minimal and dedicated at handling:
- Http(s) server and basic routing
- WebSockets initialization
- Processes initialization
- Distributed state management
`soundworks` can be extended with services to reuse common logic such as audio file loading, clock synchronisation, etc. Each service leaves in a separate repo for better modularity and to simplify version management.
### Template
## Installation
The recommended way of developing a *soundworks* application is to start from the ***template*** at [https://github.com/collective-soundworks/soundworks-template/](https://github.com/collective-soundworks/soundworks-template/).
```
npm install @soundworks/core
```
The template includes comprehensive comments in the code.
Please refer to the repository's README file for further instructions and documentation.
## Getting Started
## Basic Concepts
[@link to tutorial]()
The framework is implemented in ES2015 using the *Babel* JavaScript compiler.
It provides scripts to support the development of applications based on ES2015 functions and abstraction such as `class`, `import` and `export`.
## Application Template
### Different Client Types
The simplest way to start a new `soundworks` application is using the application template:
[https://github.com/collective-soundworks/soundworks-template](https://github.com/collective-soundworks/soundworks-template).
A *soundworks* application can implement one or multiple *types* of clients. Generally, different ***client types*** correspond to different roles participants or connected objects (e.g. audiovisual rendering devices) take in an application scenario.
Technically, a *client type* corresponds to an URL that allows to connect to the application server - and, ultimately, a *Socket.IO namespace*.
## List of Available Services
By default, the `player` *client type* is associated to the base URL of the application (e.g. http://my.soudworks-app.mobi/).
An additional client type `referee` of the same application would, for example, use the same URL extended by "referee/" (i.e. http://my.soudworks-app.mobi/referee/).
@todo
Apart from `player`, different client types occurring in applications that we have developed with *soundworks* include, for example:
* `soloist` - a participant with a soloist role in a musical application
* `controller`- a web client for controlling the global parameters of an application
* `shared-env` - a graphical representation or audio rendering projected into the environment of the application (i.e. by a video projector and/or public sound system)
## Academic Papers
Generally, each client type is mapped to an *experience* implemented on both sides of the application, the client and, optionally, the server.
- Benjamin Matuszewski. Soundworks - A Framework for Networked Music Systems on the Web - State of Affairs and New Developments. Proceedings of the Web Audio Conference (WAC) 2019, Dec 2019, Trondheim, Norway. <[hal-02387783](https://hal.archives-ouvertes.fr/hal-02387783)>
- Benjamin Matuszewski, Norbert Schnell, Frédéric Bevilacqua. Interaction Topologies in Mobile-Based Situated Networked Music Systems. Wireless Communications and Mobile Computing, Hindawi Publishing Corporation, 2019, 2019, pp.9142490. ⟨10.1155/2019/9142490⟩. <[hal-02086673](https://hal.archives-ouvertes.fr/hal-02086673)>
- Norbert Schnell, Sébastien Robaszkiewicz. Soundworks – A playground for artists and developers to create collaborative mobile web performances. `Proceedings of the Web Audio Conference (WAC'15), 2015, Paris, France. <[hal-01580797](https://hal.archives-ouvertes.fr/hal-01580797)>
### The Experience
## Credits
The actual scenario of a *soundworks* application, the ***experience***, is implemented as extensions of the `ClientExperience` and `ServerExperience` classes.
`soundworks` has been initiated by [NorbertSchnell](https://github.com/NorbertSchnell), [i-Robi](https://github.com/i-Robi), and [b-ma](https://github.com/b-ma) at the [ISMM](http://ismm.ircam.fr/) team at [Ircam - Centre Pompidou](http://www.ircam.fr/) in the framework of the [*CoSiMa*](http://cosima.ircam.fr/) research project supported by the [French National Research Agency (ANR)](http://www.agence-nationale-recherche.fr/en/).
The implementation of the client side of an application essentially consists of a `ClientExperience` that generally defines the interactions and the audiovisual rendering on the users' mobile devices.
The corresponding `ServerExperience` determines the interactions between the connected clients by implementing how the server reacts on the connection of web clients of given types and on messages received from these clients.
Futher developments has been supported in the framework of:
- The [RAPID-MIX project](http://rapidmix.goldsmithsdigital.com/), funded by the European Union’s Horizon 2020 research and innovation programme.
- The Ircam project _BeCoMe_
- The _Constella(c)tions_ residency of the STARTS program of the European Commission.
The experiences can require and configure a set of services provided by the *soundworks* framework (see below).
Development is pursued in the [Interaction Music Mouvement Team](https://www.stms-lab.fr/team/interaction-son-musique-mouvement/) from the Ircam's STMS-LAB.
On the client side, the `ClientExperience` of a given client type is started when the required services are ready.
On the server side, the methods `enter` and `exit` of `ServerExperience` are called when a client of the corresponding client type connects to or disconnects from the applications - after having announced the connection or disconnection to concerned services.
## License
### A set of Services
[BSD-3-Clause](https://github.com/collective-soundworks/soundworks/blob/master/LICENSE)
Apart from the abstractions mentioned above, the most important aspect of the framework is to provide a set of ***services*** to an application.
The services currently provided include, for example:
* `platform` - checks for the compatibility of the application with the user's device, OS, and browser and shows a welcome screen when needed.
* `checkin` - automatically assigns a ticket or predefined position (i.e. number or label with optional coordinates) to the user
* `placer` - lets the user chose an available ticket or predefined position
* `locator` - lets the user indicate an approximate position on a map
* `file-system` - allow to retrieve a file list from a given directory
* `audio-buffer-manager` - preloads audio buffers and related JSON files descriptors
* `auth` - add a simple login page to specific client
* `sync` - provides a synchronized clock to all clients
* `scheduler` - differs function calls and schedules recurrent events in reference to the synchronized clock or a local audio clock
* `motion-input` - provides unified access to the mobile device's motion sensors (based on the `DeviceMotion` and `DeviceOrientation` APIs)
* `shared-params` - global variables and commands shared by the clients of defined types
* `shared-config` - retrieves configuration constants from the server
The framework provides an API for extending the set of available services.
### Views and View Templates
The graphical rendering and interaction on a client screen is managed through ***views*** with ***view templates*** (strongly inspired by the *backbone* view API).
The framework provides the possibility to define the HTML content of a view through view templates based on the *lowdash*/*underscore* syntax.
In addition, the views and view templates allow for defining callbacks for user input events (e.g. *touch* and *click* events) and for reacting on device orientation changes.
The views of an experience as well as of the provided services can be customized through CSS/SASS styles and by changing the content fitting the associated view templates.
Different configurations of an application may include customized view content to generate different variants and localizations of the same screens.
The content fitting a view template can be changed dynamically (e.g. depending on a user interaction) whereby the view can be updated partially (i.e. only a specific HTML tag).
Default CSS/SASS styles for the provided templates (used by the services and experiences) are part of the *soundworks* application template.
An advanced way of creating customized views consists in choosing alternative view templates and/or views among a set of provided templates and view classes.
The `CanvasView` class, for example, implements a formalism that facilitates the implementation of canvas-based rendering through a `Renderer` abstraction.
Ultimately, developers can create customized views extending the `View` base class or one of the provided view classes.
## Further Examples
Apart from the template, the [*collective-soundworks*](https://github.com/collective-soundworks) GitHub project includes the following example applications with comprehensively commented code:
* Soundfield - [https://github.com/collective-soundworks/soundworks-soundfield/](https://github.com/collective-soundworks/soundworks-soundfield/)
* Drops - [https://github.com/collective-soundworks/soundworks-drops/](https://github.com/collective-soundworks/soundworks-drops/)
Please refer to the repositories' README file for further instructions and documentation.
## License and Credits
The *soundworks* framework is released under the [BSD 3-Clause](https://opensource.org/licenses/BSD-3-Clause) license.
*soundworks* has been initiated by [Norbert Schnell](mailto:Nobert.Schnell@ircam.fr), [Sebastien Robaszkiewicz](mailto:hi@robi.me), and [Benjamin Matuszewski](mailto:Benjamin.Matuszewski@ircam.fr) at the [ISMM](http://ismm.ircam.fr/) team at [Ircam - Centre Pompidou](http://www.ircam.fr/) in the framework of the [*CoSiMa*](http://cosima.ircam.fr/) research project supported by the [French National Research Agency (ANR)](http://www.agence-nationale-recherche.fr/en/). Futher developments has been supported in the framework of the [RAPID-MIX project](http://rapidmix.goldsmithsdigital.com/), funded by the European Union’s Horizon 2020 research and innovation programme.
The framework integrates parts of the [WaveJS library](https://github.com/wavesjs).

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc