function BaseEffect( context ) {
    /**
     * Web Audio API's AudioContext. If the context passed to the constructor is an AudioContext, a new one is created here.
     *
     * @property audioContext
     * @type AudioContext
     */
    if ( context === undefined || context === null ) {
        log.debug( 'Making a new AudioContext' );
        this.audioContext = new SafeAudioContext();
    } else {
        this.audioContext = context;
    }

    bootAudioContext( this.audioContext );

    /**
     * The output node of this effect. This node will be connected to the next Effect or destination
     *
     * @property inputNode
     * @type AudioNode
     * @final
     */
    this.inputNode = null;

    /**
     * Number of inputs
     *
     * @property numberOfInputs
     * @type Number
     * @default 0
     */
    Object.defineProperty( this, 'numberOfInputs', {
        enumerable: true,
        configurable: false,
        get: function () {
            return this.inputNode.numberOfOutputs || 0;
        }
    } );

    /**
     * The output node of this effect. This node will be connected to the next Effect or destination
     *
     * @property outputNode
     * @type AudioNode
     * @final
     */
    this.outputNode = null;

    /**
     * Number of outputs
     *
     * @property numberOfOutputs
     * @type Number
     * @default 0
     */
    Object.defineProperty( this, 'numberOfOutputs', {
        enumerable: true,
        configurable: false,
        get: function () {
            return this.outputNode.numberOfOutputs || 0;
        }
    } );

    /**
     *  If Sound is currently playing.
     *
     * @property isPlaying
     * @type Boolean
     * @default false
     */
    this.isPlaying = false;

    /**
     *  If Sound is currently initialized.
     *
     * @property isInitialized
     * @type Boolean
     * @default false
     */
    this.isInitialized = false;

    /**
     * Set of nodes the output of this effect is currently connected to.
     *
     * @property destinations
     * @type Array
     * @default
     **/
    this.destinations = [];

    /**
     * String name of the effect.
     *
     * @property modelName
     * @type String
     * @default "Model"
     **/
    this.effectName = 'Effect';

    this.isBaseEffect = true;

    this.parameterList_ = [];

    function bootAudioContext( context ) {

        var iOS = /(iPad|iPhone|iPod)/g.test( navigator.userAgent );
        var isSafari = /Safari/.test( navigator.userAgent ) && /Apple Computer/.test( navigator.vendor );
        var desiredSampleRate = typeof desiredSampleRate === 'number' ? desiredSampleRate : 44100;
        if ( isSafari ) {
            if ( context.state && context.state === 'suspended' ) {
                context.resume();
            }
        }

        function createDummyBuffer() {
            // actually this does nothing. support for older devices support iOS 8 and below
            var buffer = context.createBuffer( 1, 1, desiredSampleRate );
            var dummy = context.createBufferSource();
            dummy.buffer = buffer;
            dummy.connect( context.destination );
            dummy.start( 0 );
            dummy.disconnect();
            if ( context.state && context.state === 'suspended' ) {
                context.resume();
            }
            log.debug( 'currentTime & state ', context.currentTime, context.state );
            setTimeout( function () {
                if ( context.state && context.state === 'running' ) {
                    log.debug( 'context state', context.state );
                    document.body.removeEventListener( 'touchend', createDummyBuffer );
                }
            }, 0 );
        }
        if ( iOS ) {
            if ( !window.liveAudioContexts ) {
                window.liveAudioContexts = [];
            }
            if ( window.liveAudioContexts.indexOf( context ) < 0 ) {
                document.body.addEventListener( 'touchend', createDummyBuffer );
                window.liveAudioContexts.push( context );
            }
        }
    }
}
/**
 * Pseudo AudioNode class the encapsulates basic functionality of an Audio Node. To be extended by all other Effects
 *
 * @class BaseEffect
 * @constructor
 * @requires AudioContextMonkeyPatch
 * @param {AudioContext} [context] AudioContext in which this Sound is defined.
 */
Pseudo AudioNode class the encapsulates basic functionality of an Audio Node. To be extended by all other Effects
@class BaseEffect
@constructor
@requires AudioContextMonkeyPatch
@param {AudioContext} [context] AudioContext in which this Sound is defined.
Pseudo AudioNode class the encapsulates basic functionality of an Audio Node . To be extended by all other Effects @class BaseEffect @constructor @requires AudioContextMonkeyPatch @param { AudioContext } [ context ] AudioContext in which this Sound is defined .
function BaseEffect( context ) {
    if ( context === undefined || context === null ) {
        log.debug( 'Making a new AudioContext' );
        this.audioContext = new SafeAudioContext();
    } else {
        this.audioContext = context;
    }
    bootAudioContext( this.audioContext );
    this.inputNode = null;
    Object.defineProperty( this, 'numberOfInputs', {
        enumerable: true,
        configurable: false,
        get: function () {
            return this.inputNode.numberOfOutputs || 0;
        }
    } );
    this.outputNode = null;
    Object.defineProperty( this, 'numberOfOutputs', {
        enumerable: true,
        configurable: false,
        get: function () {
            return this.outputNode.numberOfOutputs || 0;
        }
    } );
    this.isPlaying = false;
    this.isInitialized = false;
    this.destinations = [];
    this.effectName = 'Effect';
    this.isBaseEffect = true;
    this.parameterList_ = [];
    function bootAudioContext( context ) {
        var iOS = /(iPad|iPhone|iPod)/g.test( navigator.userAgent );
        var isSafari = /Safari/.test( navigator.userAgent ) && /Apple Computer/.test( navigator.vendor );
        var desiredSampleRate = typeof desiredSampleRate === 'number' ? desiredSampleRate : 44100;
        if ( isSafari ) {
            if ( context.state && context.state === 'suspended' ) {
                context.resume();
            }
        }
        function createDummyBuffer() {
            var buffer = context.createBuffer( 1, 1, desiredSampleRate );
            var dummy = context.createBufferSource();
            dummy.buffer = buffer;
            dummy.connect( context.destination );
            dummy.start( 0 );
            dummy.disconnect();
            if ( context.state && context.state === 'suspended' ) {
                context.resume();
            }
            log.debug( 'currentTime & state ', context.currentTime, context.state );
            setTimeout( function () {
                if ( context.state && context.state === 'running' ) {
                    log.debug( 'context state', context.state );
                    document.body.removeEventListener( 'touchend', createDummyBuffer );
                }
            }, 0 );
        }
        if ( iOS ) {
            if ( !window.liveAudioContexts ) {
                window.liveAudioContexts = [];
            }
            if ( window.liveAudioContexts.indexOf( context ) < 0 ) {
                document.body.addEventListener( 'touchend', createDummyBuffer );
                window.liveAudioContexts.push( context );
            }
        }
    }
}
function BaseEffect ( context ) { if ( context === undefined || context === null ) { log . debug ( 'Making a new AudioContext' ) ; this . audioContext = new SafeAudioContext ( ) ; } else { this . audioContext = context ; } bootAudioContext ( this . audioContext ) ; this . inputNode = null ; Object . defineProperty ( this , 'numberOfInputs' , { enumerable : true , configurable : false , get : function ( ) { return this . inputNode . numberOfOutputs || 0 ; } } ) ; this . outputNode = null ; Object . defineProperty ( this , 'numberOfOutputs' , { enumerable : true , configurable : false , get : function ( ) { return this . outputNode . numberOfOutputs || 0 ; } } ) ; this . isPlaying = false ; this . isInitialized = false ; this . destinations = [ ] ; this . effectName = 'Effect' ; this . isBaseEffect = true ; this . parameterList_ = [ ] ; function bootAudioContext ( context ) { var iOS = / (iPad|iPhone|iPod) / g . test ( navigator . userAgent ) ; var isSafari = / Safari / . test ( navigator . userAgent ) && / Apple Computer / . test ( navigator . vendor ) ; var desiredSampleRate = typeof desiredSampleRate === 'number' ? desiredSampleRate : 44100 ; if ( isSafari ) { if ( context . state && context . state === 'suspended' ) { context . resume ( ) ; } } function createDummyBuffer ( ) { var buffer = context . createBuffer ( 1 , 1 , desiredSampleRate ) ; var dummy = context . createBufferSource ( ) ; dummy . buffer = buffer ; dummy . connect ( context . destination ) ; dummy . start ( 0 ) ; dummy . disconnect ( ) ; if ( context . state && context . state === 'suspended' ) { context . resume ( ) ; } log . debug ( 'currentTime & state ' , context . currentTime , context . state ) ; setTimeout ( function ( ) { if ( context . state && context . state === 'running' ) { log . debug ( 'context state' , context . state ) ; document . body . removeEventListener ( 'touchend' , createDummyBuffer ) ; } } , 0 ) ; } if ( iOS ) { if ( ! window . liveAudioContexts ) { window . liveAudioContexts = [ ] ; } if ( window . liveAudioContexts . indexOf ( context ) < 0 ) { document . body . addEventListener ( 'touchend' , createDummyBuffer ) ; window . liveAudioContexts . push ( context ) ; } } } }
Pseudo AudioNode class the encapsulates basic functionality of an Audio Node.
Pseudo AudioNode class the encapsulates basic functionality of an Audio Node .
/**
     * Web Audio API's AudioContext. If the context passed to the constructor is an AudioContext, a new one is created here.
     *
     * @property audioContext
     * @type AudioContext
     */ /**
     * The output node of this effect. This node will be connected to the next Effect or destination
     *
     * @property inputNode
     * @type AudioNode
     * @final
     */ /**
     * Number of inputs
     *
     * @property numberOfInputs
     * @type Number
     * @default 0
     */ /**
     * The output node of this effect. This node will be connected to the next Effect or destination
     *
     * @property outputNode
     * @type AudioNode
     * @final
     */ /**
     * Number of outputs
     *
     * @property numberOfOutputs
     * @type Number
     * @default 0
     */ /**
     *  If Sound is currently playing.
     *
     * @property isPlaying
     * @type Boolean
     * @default false
     */ /**
     *  If Sound is currently initialized.
     *
     * @property isInitialized
     * @type Boolean
     * @default false
     */ /**
     * Set of nodes the output of this effect is currently connected to.
     *
     * @property destinations
     * @type Array
     * @default
     **/ /**
     * String name of the effect.
     *
     * @property modelName
     * @type String
     * @default "Model"
     **/ // actually this does nothing. support for older devices support iOS 8 and below