assets/js/BB_equalizer-app.js
// Continuously loop and update chart with frequency data.
Continuously loop and update chart with frequency data.
Continuously loop and update chart with frequency data .
function renderChart() {
           requestAnimationFrame(renderChart);
           analyser.getByteFrequencyData(frequencyData);
           svg.selectAll('rect')
              .data(frequencyData)
              .attr('y', function(d) {
                 return svgHeight - d;
              })
              .attr('height', function(d) {
                 return d;
              })
              .attr('fill', function(d,i) {
                 return 'rgb(125, ' +Math.round(.75*d)+ ', ' +d+ ')';
              })
        }
function renderChart ( ) { requestAnimationFrame ( renderChart ) ; analyser . getByteFrequencyData ( frequencyData ) ; svg . selectAll ( 'rect' ) . data ( frequencyData ) . attr ( 'y' , function ( d ) { return svgHeight - d ; } ) . attr ( 'height' , function ( d ) { return d ; } ) . attr ( 'fill' , function ( d , i ) { return 'rgb(125, ' + Math . round ( .75 * d ) + ', ' + d + ')' ; } ) }
Continuously loop and update chart with frequency data.
Continuously loop and update chart with frequency data .
// Copy frequency data to frequencyData array. // Update d3 chart with new data. //                 return 'rgb(125, 0, ' + d + ')'; //                 return 'rgb(125, 0, ' + i + ')'; //            console.log(frequencyData)