summaryrefslogtreecommitdiff
path: root/client/lib/output.js
blob: cc8d8410f7526cd3e1a4a32edd9218b05af611b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
 * Common output stage
 * @module lib/output.js;
 */

import Tone from "tone";

let output = null;

export function getOutput() {
  if (!output) output = makeOutput();
  return output;
}

function makeOutput() {
  const compressor = new Tone.Compressor(-30, 3);
  const gain = new Tone.Gain(0.3);
  compressor.connect(gain);
  gain.toMaster();

  return compressor;
}