Skip to content

version 4.0.0

Compare
Choose a tag to compare
@hvianna hvianna released this 26 Mar 18:30
· 114 commits to master since this release

What's new:

🚨 BREAKING CHANGES:

  • Removed deprecated properties:

  • getBars() now includes an additional freq property for each element, representing the center frequency of the band.
    In addition, the range of each band has been adjusted so that frequencies that were previously at the lower edge (freqLo) are now located at the center of the band.

  • stereo has been DEPRECATED and will be removed in version 5 - use channelLayout instead.

Added:

  • ansiBands - use ANSI/IEC preferred frequencies for the octave bands;
  • channelLayout - adds option for dual channel combined spectrum, with both channel graphs overlaid;
  • frequencyScale - adds linear and perceptual (Bark/Mel) frequency scales;
  • gradientLeft and gradientRight - allow to select different gradients for each channel;
  • isBandsMode read-only property;
  • linearAmplitude - use linear values instead of dB for spectrum amplitudes;
  • linearBoost - amplify low energy values when using linear amplitude;
  • noteLabels - display musical note labels instead of frequency values on the X-axis;
  • weightingFilter - select from five different weighting filters for improved spectrum visualization;
  • Two new built-in gradients: orangered and steelblue.

Thank you @jonathan-annett (#28) and @TF3RDL (#30 and #38) for the suggestions that led to the implementation of several of these new features.

Fixed:

  • LED peaks showing below zero level when reflexRatio > 0.

Changed and improved:

  • Optimized generation of octave bands, with more accurate ranges and center frequencies;
  • Frequency labels on the X-axis now show different values depending on the value of ansiBands, to properly match the bands' center frequencies;
  • The onCanvasDraw callback is now passed an additional object with timestamp and gradients information;
  • The prism and rainbow gradients were recreated using the beautiful 12-bit rainbow palette by Kate Morley - If you need the old colors check this post;
  • Custom gradients can now register a single color;
  • splitGradient now works for horizontal gradients in radial visualization;
  • maxFreq is now capped to half the AudioContext's sample rate (Nyquist frequency);
  • Export additional types and interfaces in the TypeScript definition file;
  • Code optimizations, minor fixes and clean-up;
  • Revised and improved demos and documentation.