function PolySynth(audioVoice, maxVoices) {
    polysynth_classCallCheck(this, PolySynth);
    this.audiovoices = [];

    /**
     * An object that holds information about which notes have been played and
     * which notes are currently being played. New notes are added as keys
     * on the fly. While a note has been attacked, but not released, the value of the
     * key is the audiovoice which is generating that note. When notes are released,
     * the value of the key becomes undefined.
     * @property notes
     */
    this.notes = {};

    this._newest = 0;
    this._oldest = 0;

    /**
     * A PolySynth must have at least 1 voice, defaults to 8
     * @property polyvalue
     */
    this.maxVoices = maxVoices || 8;

    /**
     * Monosynth that generates the sound for each note that is triggered. The
     * p5.PolySynth defaults to using the p5.MonoSynth as its voice.
     * @property AudioVoice
     */
    this.AudioVoice = audioVoice === undefined ? p5.MonoSynth : audioVoice;

    /**
     * This value must only change as a note is attacked or released. Due to delay
     * and sustain times, Tone.TimelineSignal is required to schedule the change in value.
     * @private
     * @property {Tone.TimelineSignal} _voicesInUse
     */
    this._voicesInUse = new TimelineSignal_default.a(0);
    this.output = main.audiocontext.createGain();
    this.connect();

    this._allocateVoices();
    main.soundArray.push(this);
  }
An AudioVoice is used as a single voice for sound synthesis.
 The PolySynth class holds an array of AudioVoice, and deals
 with voices allocations, with setting notes to be played, and
 parameters to be set.

 @class p5.PolySynth
 @constructor

 @param {Number} [synthVoice]   A monophonic synth voice inheriting
                                the AudioVoice class. Defaults to p5.MonoSynth
 @param {Number} [maxVoices] Number of voices, defaults to 8;
 @example
 <div><code>
 let polySynth;

 function setup() {
   let cnv = createCanvas(100, 100);
   cnv.mousePressed(playSynth);
   background(220);
   text('click to play', 20, 20);

   polySynth = new p5.PolySynth();
 }

 function playSynth() {
   userStartAudio();

   // note duration (in seconds)
   let dur = 1.5;

   // time from now (in seconds)
   let time = 0;

   // velocity (volume, from 0 to 1)
   let vel = 0.1;

   // notes can overlap with each other
   polySynth.play('G2', vel, 0, dur);
   polySynth.play('C3', vel, time += 1/3, dur);
   polySynth.play('G3', vel, time += 1/3, dur);
 }
 </code></div>