Fork me on GitHub

JSSP 1.0.1-beta jQuery plugin for client sound processing

Documentation for JSSP

Table of Contents

Principle

JSSP is a jQuery plugin that allows an audio stream to be processed with an effect chain. It can be summarised with this equation:

(Raw audio stream + Settings) × JSSP = Processed audio

Requirements

Settings

Declaration

The settings object describes how the effects chain is organized. In this sample code:

$('audio').jssp({settings: settings});

The settings variable can be:

You can use this wizard that will generate the settings object for you, you will be able to prelisten to it.

Effects

Gain

A simple gain amplificator.

{
  "type": "gain",
  "settings": {
    "gain": 1.5
  }
}
gain
The amplification factor. Gain value is a positive float number:
  • = 0: mutes the sound
  • > 0 and < 1: reduce the sound
  • = 1: no change
  • > 1: amplify the sound
Dynamics Compressor

A simple dynamics compressor. It aims to equalize audio levels by reducing loud sounds.

{
  "type": "compressor",
  "settings": {
    "attack": 0.010,
    "release": 0.100,
    "ratio": 8,
    "threshold": -12.0
  }
}
attack
The attack of the compressor (delay for the compressor to react) in seconds. This value has to be greater than 0.
release
The release of the compressor (delay for the compressor to return to "normal" sound) in seconds. This value has to be greater than 0.
ratio
The strength of compression. This value has to be greater or equal to 1. A ratio of 1 will produce no change.
threshold
The threshold above which the compressor will react in dB. This value has to be lesser than 0.
Biquad filter

A filter that uses biquad factors and calculations to process the signal. Enhance or reduce bands of frequencies.

{
  "type": "filter",
  "settings": {
    "type": "lowpass",
    "frequency": 130,
    "q": 1,
    "gain": 1.0
  }
}
type
Filter type. Possible values:
  • lowpass
  • highpass
  • bypass
  • lowshelf
  • highshelf
  • peaking
  • notch
  • allpass
frequency
The frequency of the filter in Hertz (positive number). This value will be interpreted differently according to the filter type.
q
The quality factor of the filter (float from 0 to 1000).
gain
The gain of the filter. See gain filter.
Automatic gain control

Similar to the dynamics compressor. This effect aims to control the gain of the signal over long periods. This effect contains a clipping protection.

{
  "type": "agc",
  "settings": {
    "type": "peak",
    "speed": 5
    "maxgain": 10
  }
}
type
AGC type. Possible values:
  • peak
  • rms
speed
The speed of the AGC reaction in dB/s.
maxgain
The maximum amplification in dB.
Parametric equalizer

A multiple parametric equalizer.

{
  "type": "parameq",
  "settings": {
    "bands": [
      {
        "type": "lowpass",
	"frequency": 130,
	"q": 0.5,
	"gain": 1.2
      }
    ]
}

For band values, see Filter effect

Mutliband compression

A multiple compressor that processes multiple frequency bands of the signal.

{
  "type": "multiband",
  "settings": {
    "bands": [
      {
        "centerFrequency": 170,
        "attack": 0.06,
        "release": 0.18,
        "ratio": 5,
        "threshold": -26.3,
        "gain": 0.67
      }, {
        "centerFrequency": 1000,
        "attack": 0.04,
        "release": 0.32,
        "ratio": 5,
        "threshold": -21.5,
        "gain": 0.73
      }, {
        // etc.
      }
    ]
  }
}

The settings contains only the bands parameter. Each band is a chain that contains a biquad filter, a compressor and a gain. The biquad filter is a band pass filter with a Q factor of 0.5.