View Single Post
Old 11-15-2018, 07:50 AM   #1
nitsuj
Human being with feelings
 
nitsuj's Avatar
 
Join Date: Nov 2017
Posts: 165
Default ReEQ and ReSpectrum, parametric equalizer and spectrum analyzer

ReEQ and ReSpectrum:



Thought I'd share this with you. It's a couple of pet projects I've been working on for fun recently.

My question was: is it possible to create a FabFilter or EQ8 style high quality filter in JSFX?

ReEQ

ReEQ is an eight-band parametric equaliser. It defaults to HQ (High Quality) oversampled mode so that filter shapes are preserved near Nyquist at the cost of higher CPU and 16 samples latency. An ECO mode is available that runs twice as fast and with zero latency. In either case, the EQ is highly transparent.

The filter code itself is based on Andy Simper's (Cytomic) SVF filter algorithms. They are far higher quality than the usual RBJ cookbook filters. These are the same zero delay filters used in Ableton's EQ8 which is well regarded for its high quality.

In addition, I've provided 6db slope filters and increments of 6db thereof (a combination of one and two pole filters) with cutoff slopes for high and low of up to 96dB. I've also provided Butterworth filters for steeper (but more resonant) slopes.

Full mid/size or left/right stereo filter bands are implemented.

Feature wise I see it as an improvement over ReaEQ (more filter types and slopes, mid/side or left/right processing).

Features

- The spectrum display type has a gradual decay effect (as used by many other commercial EQs). I find this much more useful for musical applications.

- The 'Settings' menu at the top allows various spectrum display settings to be adjusted. That's which spectrum to show (mid/side/left/right etc), whether to fill the spectrum or use lines, the ceiling and floor range, the tilt of the spectrum (it tilts around 1k freq), window type, window size and whether to show the spectrum as it was before the EQ affected it.

- The buttons at the bottom are: Oversample mode, mid/side or left/right mode, the scale of the filter bands, total gain, mid/left gain, side/right gain. The numeric values are altered by clicking on the button and dragging the mouse up or down.

- Double clicking in space creates a filter band node. Depending where the mouse x is on the spectrum you'll either create a high pass, low shelf, peak, high shelf or low pass filter.

- Click on the filter band node and move mouse to alter its frequency and dB.

- Alt Double click deletes a node.

- Double clicking on a filter band node will toggle enable/disable.

- Hovering over a node and using the mouse wheel will adjust the filters Q value.

- Command (Mac) or Ctrl (Windows) and mouse wheel hovering over a slope filter will adjust the slope dB.

- Right click over a filter band node will bring up a menu. Options are: Disable/Enable, Invert gain, Select shape of filter, dB of slope (only for high/low pass filters), Stereo placement (mid/side, left/right), Split node which will split the node into mid/side or left/right and delete.

- When a filter node is in mid/side or left/right mode, some triangles are displayed around the node to give an indication of such.

- Clicking on the top-right yellow EQ dB number will show a menu allowing to select the EQ range from 6dB - 30dB.

- The info box at the mouse cursor when over a node or in listen mode will show useful information such as the frequency of the mouse position or node (if hovering over one), the music note and cents, dB of mouse or filter, filter Q and filter slopes.

- The drawn view scales to fit the full window and when the mouse isn't hovering over the window the programs turns off distracting menus and node handles.

- Holding the left shift key down puts the EQ into solo/listen mode. This mode works either with selected bands or as a freeform listen function. For freeform mode, simply press shift and move the mouse around. You'll see two boundary bars which specify the part of the audio spectrum that will be audible. Pressing the mouse button and moving vertically will increase or decrease the listening volume and you'll see a horizontal bar to tell you where the dB volume is. To solo a band, hold click when hovering over the band node and hold shift down. The soloing works differently for each filter type to accommodate what you may want to be listening for. Dragging filter nodes and altering Q works as normal in this mode so that you can make these adjustments whilst soloing. NB: filter band soloing also respects the mid/side or left/right assignment of the filter node.

- Axis lock for gain and frequency: ALT+drag will lock the frequency axis. CMD (or WINDOWS)+drag will lock gain but allow drag in Y axis to alter Q. CMD (or WINDOWS)+ALT+drag will lock gain and lock Q.

Press ALT or CMD (or WINDOWS) whilst dragging a filter node will lock frequency or gain.

- There is a limit function which can be toggled using the 'LIMIT' button on the bottom button row. All it does is hard clip any overflowing signal to prevent loud surprises.

- AGC (Automatic Gain Control) toggled by clicking the 'AGC' button on the bottom button row. When toggled on, ReEQ will attempt to match the output gain with the input level. A small button with 'S' (for Set) appears next to the AGC button when toggled on. Pressing this 'S' button will set ReEQ's master volume to the matching value and disable AGC once more. To cancel AGC mode simply click the AGC again.

- By default, when a filter node is selected you'll see the bottom centred panel reflect it's properties. You can adjust freq, gain and Q by dragging the mouse on the corresponding dial. To hide or show the panel click on the 'PANEL' toggle button at the bottom of the window.

Press ALT or CMD (or WINDOWS) and double click on a value in the bottom row to reset the numeric values to default.

ReSpectrum

- The same 'Settings' options as ReEQ.

- 'keys' button toggles a piano roll. Hover over the piano keys to see a vertical beam to pinpoint spectrum frequencies.

- 'peaks' button toggles the spectrum display of maximum peaks.

Caveats

- I've only tried it on OSX as I develop on Mac.

- It should support both retina and non-retina displays.

- Only the first five filter bands are exposed as sliders for automation.

- You'll need a reasonable machine performance wise. Closing the window when not in use helps.

- I've used showmenu() for the menus. Technically it's not documented for JSFX so I don't know how well it works on other platforms.

- I borrowed Theo Niessink's RBJ filter code but only for the display magnitude calculations, not for sound processing.

I've attached a zip file which can be unzipped to your Reaper effects directory. The intention is to move to ReaPack at some point.

ReEQ is a labour of love and whilst I'm doing it for fun and to give something to the community, I've been asked if anyone can buy me a beer. If you so wish you can do that using the following link.

https://www.paypal.me/nitsujdsp

15th November 2019
* Minor update - fixed the gfx_showmenu positions for retina mode as the latest Reaper no longer requires adjusted coordinates

12th June 2019
* Close [X] is now DELETE in panel
* Fixed the 6db high/low pass filter bug
* Increase the dial values font size on the panel
* Altered the default window size
* Reaper notified when dials change
* CMD/Window key + double click now zeros values in the bottom row

10th June 2019
* Added filter node panel and toggle.
* Added more frequency labels, now centred, in bottom spectrum row.
* Mouse tracking frequency now also centred.
* Enlarged filter nodes and added node index.
* Improved node stereo indicators.

19th May 2019
* Fixed a long standing AGC glitch issue. Introduced an epsilon clamp check to RMS calcs.
* Added 'Zero Gain' to the filter node menu.
* Added 'Duplicate' to the filter node menu.
* Removed mouse crosshair.
* Changed the license over to MIT.

7th May 2019
* Filter node can now be Mid/Side/Right/Left. Extra transfer curves are shown when appropriate. Mid/Side or Left/Right in bottom bar only selects volume/polarity adjustment in bottom bar.
* Creating a band node uses the same stereo mode as the last selected node.
* Holding CMD/WND key whilst dragging a node now alters Q. Press ALT+CMD/WND and drag to not alter Q. ALT alone and drag still alters node gain only.
* Naming of decibels (dB) now consistent.

3rd May 2019
* Fixed nasty audio spiking bug. Happened when AGC was on and Volume Adjustment JS was prior in chain.
* Improved spectrum rendering (antialiased + gradient)
* Limited low/high pass filter slope selection to smaller sensible set
* Added low/high pass filter slopes up to 120dB
* Added FIR code for oversampling HQ mode at 48kHz.

15th April 2019
* Optimised HQ mode FIR half-band filtering by reducing multiplies and copy operations.
* More improvements to Q handling. Sliders now handle Q as 0..100 (0.10 .. 40) and map linearly rather than logarithmically meaning it'll be easier to automate and better for controllers.

10th April 2019
* Bug fix. Wasn't updating sliders after first 5 properly after loading a project. Artifact of separating out audio and render code for filters.

9th April 2019
* Add frequency to bottom of mouse crosshair
* Disabled nodes now show filter shape as a line (not filled)
* Improved node selection. Mouse now selects nearest node for info box and Q alteration
* Node info box now behaves better in terms of positioning and clamping to window side
* Improved filter smoothing when moving, enabling and disabling filter nodes
* Improved filter node Q sensitivity and smoothness when using mouse wheel
* Fixed graphic glitching when automating a band
* Fixed slider naming bug
* ANA (oversampling) mode now renamed to HQ (for High Quality)

11th March 2019
* Fixed AGC. Deviated from sai'ke's implementation in that it now directly maps output amplitude from the input amplitude rather than iterating to it. Matches ~0db difference when fed white noise.
Attached Files
File Type: zip ReJJ-1.0.6.zip (50.5 KB, 221 views)

Last edited by nitsuj; 11-15-2019 at 02:03 PM. Reason: New release
nitsuj is offline   Reply With Quote