BiquadFilterNode | サウンドの視覚化

BiquadFilterNode
BiquadFilterNode
PropertyValuehasOwnProperty
frequency (AudioParam)
frequency (AudioParam)
PropertyValuehasOwnProperty
detune (AudioParam)
detune (AudioParam)
PropertyValuehasOwnProperty
Q (AudioParam)
Q (AudioParam)
PropertyValuehasOwnProperty
gain (AudioParam)
gain (AudioParam)
PropertyValuehasOwnProperty
(function() {

    var onDOMContentLoaded = function() {

        window.AudioContext = window.AudioContext || window.webkitAudioContext;

        try {
            // Create the instance of AudioContext
            var context = new AudioContext();
        } catch (error) {
            window.alert(error.message + ' : Please use Chrome or Safari.');
            return;
        }

        var displayProperties = function(node, tableid, caption) {
            var html = '<caption>' + caption + '</caption>';

            html += '<thead>';
            html += '<tr>';
            html += '<th scope="col">Property</th>';
            html += '<th scope="col">Value</th>';
            html += '<th scope="col">hasOwnProperty</th>';
            html += '</tr>';
            html += '</thead>';

            html += '<tbody>';

            for (var key in node) {
                html += '<tr>';
                html += '<td>' + key + '</td>';
                html += '<td>' + node[key] + '</td>';
                html += '<td>' + node.hasOwnProperty(key) + '</td>';
                html += '</tr>';
            }

            html += '</tbody>';

            document.getElementById(tableid).innerHTML = html;
            document.getElementById(tableid).parentNode.previousElementSibling.style.display = 'block';
        };

        // Create the instance of BiquadFilterNode
        var filter = context.createBiquadFilter();

        /*
         * Display properties
         */

        displayProperties(filter,           'biquadfilternode-properties',           'BiquadFilterNode');
        displayProperties(filter.frequency, 'biquadfilternode-frequency-properties', 'frequency (AudioParam) ');
        displayProperties(filter.detune,    'biquadfilternode-detune-properties',    'detune (AudioParam) ');
        displayProperties(filter.Q,         'biquadfilternode-q-properties',         'Q (AudioParam) ');
        displayProperties(filter.gain,      'biquadfilternode-gain-properties',      'gain (AudioParam) ');
    };

    if ((document.readyState === 'interactive') || (document.readyState === 'complete')) {
        onDOMContentLoaded();
    } else {
        document.addEventListener('DOMContentLoaded', onDOMContentLoaded, true);
    }

})();
function EventWrapper(){
}

(function(){
    var click = '';
    var start = '';
    var move  = '';
    var end   = '';

    // Touch Panel ?
    if (/iPhone|iPad|iPod|Android/.test(navigator.userAgent)) {
        click = 'click';
        start = 'touchstart';
        move  = 'touchmove';
        end   = 'touchend';
    } else {
        click = 'click';
        start = 'mousedown';
        move  = 'mousemove';
        end   = 'mouseup';
    }

    EventWrapper.CLICK = click;
    EventWrapper.START = start;
    EventWrapper.MOVE  = move;
    EventWrapper.END   = end;
})();