Old 09-15-2019, 03:24 PM   #1
DrTT
Human being with feelings
 
Join Date: Jan 2019
Posts: 21
Default JSFX-SOX: EEL2 Reimplementation of some SOX effects

Dear all,

I am almost a bit embarrassed to present my JSFX-SOX tool package here in this forum, because most other FX presented have very well implemented user interfaces, while mine only allows some parametrization via sliders and just processes audio. (For my rehabilitation at least some debug views are built-in (like e.g. a memory viewer), but all in all they cannot compete UI-wise with other offerings here.)

Nevertheless the package may be worthwhile, because JSFX-SOX implements some of the audio processing effects from SOX like filters, compander, reverb etc. SOX (http://sox.sourceforge.net/) is a command line audio processing tool for Unix, Windows and Mac OS that transforms source audio files in several formats into other audio files. Although SOX does not always provide the "best" effects, it still is a reliable and well-defined audio tool.

Several of the sox effects have been rewritten by me in JSFX-SOX. I also restructured the original C code for easier maintenance during the transformation into EEL, because in the original sources there are some redundancies and unnecessary complexity due to its several contributors. The effects provided aim at producing bit-exact identical renderings in the DAW, i.e. one can be sure that the DAW will produce exactly the same results as the external rendering by sox.

Note that a spiffy user interface is not at all a priority in this project, but only the correct reproduction of the sox algorithms with adequate (slider) parametrisation.

By the way: the correctness of implementation can easily be tested by rendering some audio externally with SOX and internally with the plugins and subtracting the results. Apart from roundoff errors (SOX often uses 32bit integer processing, while EEL always uses double floating point processing) the results cancel out with typically a residual noise of -140dBFS (with 24 bit FLAC files) or even less for higher external bit depths (see figure 1).




Figure 1: Checking the Residual Noise of JSFX-SOX Effects in a Reaper Test Project

Why is this helpful? I am using a command-line based toolchain for generating band notation videos from a text file score in the lilypond notation language plus some configuration file telling about instruments and audio postprocessing etc. The main idea in that tool-chain is that generation of those notation videos with audio tracks can be done with command-line open-source tools from text files without any human intervention.

Part of this tool-chain is sox, because the raw audio generation from MIDI via fluidsynth needs some beefing up by an audio processor.

If you're interested, you can find details on this tool-chain at (https://www.tensi.eu/thomas/iPod/notation-video.html with its source at GitHub https://github.com/prof-spock/Lilypo...VideoConverter).

Of course, since a configuration-driven generation is not very interactive, you sometimes just have to tweak effect settings or instruments directly. Hence I am using Reaper on intermediate audio files of the tool-chain and fiddle with the audio postprocessing there to get the necessary parameters for the command line tool-chain.

Note, however, because sox has rich command line options for its effects, not every effect configuration from sox can be transported into the slider oriented GUI for JSFX. E.g. the compander of sox allows the definition of a transfer function having multiple segments. Although the internal engine of the JSFX compander implements exactly the same internal segment logic, the user interface only allows the typical definition of a threshold and a compression ratio (with three segments).

This is okay for my purposes, but might be problematic for expert sox users. All those deviations from sox are documented in the manual. As an example figure 2 shows the UI of a two-band MCompander with this logic.




Figure 2: Two-Band MCompander in JSFX-SOX

All in all, the following effects are available in this package:
  • allpass: a biquad allpass filter two-poled with filter frequency and the filter bandwith (in several units),
  • band: a biquad bandpass filter with center filter frequency and the filter bandwith (in several units) and an option for unpitched audio,
  • bandpass/bandreject: a biquad filter for bandpass or bandreject with center filter frequency and the filter bandwith (in several units),
  • bass/treble: a biquad filter for boosting or cutting bass or treble with a shelving characteristics with settings for filter frequency and the filter bandwith (in several units),
  • biquad: a generic biquad (iir) filter with 6 coefficients b0, b1, b2, a0, a1 and a2,
  • compand: a compander with attack, release, input gain shift, threshold and compression and soft knee; this is a reduced version of SOX compand with only a simple transfer function,
  • equalizer: a biquad filter for equalizing with settings for the pole count, the filter frequency and the filter bandwith (in several units),
  • gain: a volume changer by exact decibels...,
  • lowpass/highpass: a biquad filter for either lowpass or highpass with settings for the pole count, the filter frequency and the filter bandwith (in several units),
  • mcompand: a multiband compander with a Linkwitz-Riley crossover filter and for each band a compander with attack, release, input gain shift, threshold and compression and soft knee; again the companders only allow a simple transfer function,
  • overdrive: a simple tanh distortion with gain and colour specification,
  • phaser: a phaser effect with sine or triangle modulation,
  • reverb: a reverb effect (based on Freeverb) with several parameters for the room (like size and HF damping) as well as a possible predelay, and
  • tremolo: a tremolo effect with sine modulation using a double-sideband suppressed carrier modulation
The time-variant effects phaser and tremolo are time-locked (see post https://forum.cockos.com/showthread.php?p=2164884 and the documentation); hence the rendering can be exactly synchronized to externally rendered audio snippets.

Documentation is available here, the package itself is at https://github.com/prof-spock/JSFX-SOX-Plugins.

I am also currently looking into providing a ReaPack index file, but I am still working on it.

Hope this is helpful for you.

Best regards
DrTT
DrTT is offline   Reply With Quote
Old 11-16-2019, 10:00 AM   #2
DrTT
Human being with feelings
 
Join Date: Jan 2019
Posts: 21
Default

Dear all,

for easier installation of the JSFXSOX plugins (for bit-exact reproduction of SOX command-line effects) I have now provided an index.xml file for ReaPack.

You can find it at https://github.com/prof-spock/JSFX-S...ster/index.xml.

To import this package, select "Import Repositories..." in ReaPack and write the above URL into the appropriate edit field.

Best regards,
DrTT

Last edited by DrTT; 11-16-2019 at 10:16 AM.
DrTT is offline   Reply With Quote
Old 11-16-2019, 11:02 AM   #3
beingmf
Human being with feelings
 
beingmf's Avatar
 
Join Date: Jul 2007
Location: Jazz City
Posts: 3,949
Default

I'd love to try those, but how to add the repo to ReaPack? I know there's the index file, but I'm too dumb ...
__________________
Windows 7x64 SP2 | NVidia Quadro2000, 10.18.13.6191 | Marian Seraph AD2, 4.0.7.1
Experience the Blunzeworscht!
beingmf is offline   Reply With Quote
Old 11-17-2019, 06:15 AM   #4
DrTT
Human being with feelings
 
Join Date: Jan 2019
Posts: 21
Default

Hello beingmf,

when you have ReaPack available in Reaper, just select Extensions::ReaPack::Import repositories... and paste the index file location
https://github.com/prof-spock/JSFX-SOX-Plugins/raw/master/index.xml into the dialog window.

In principle ReaPack should scan that file and provide a new repository "Dr_TT" in your list. Enable this repository by checkmarking it.



Now you have to install the package via Extensions::ReaPack::Browse packages....

Right-click on the JSFXSOX package and you should see an "Install v0.9" entry in the context menu (here it is "Reinstall" because I have already installed this package). Select this entry and ReaPack should install the files into the "Effects" directory of Reaper.



Now you're ready to go. The JSFXSOX effects should appear in the list of effects within Reaper.
Hope this helps!

Best regards,
DrTT
DrTT is offline   Reply With Quote
Old 11-17-2019, 02:11 PM   #5
Eliseat
Human being with feelings
 
Eliseat's Avatar
 
Join Date: Mar 2018
Location: Cologne
Posts: 1,174
Default

Hi DrTT,

thanks for your effects. I tested some of them quickly and it seems that most of the parameter ranges are really extreme or not optimized for proper handling. Maybe I will take a closer look at them tomorrow and give you a more detailed feedback.

As already mentioned. Thanks for supporting the community with your efforts.

Greetings
Eli
__________________
☆.。.:*・°☆.。.:*・°☆.。.:*・°☆REAPER//✿◔‿◔)°☆.。.:*・°☆.。.:*・°☆
Eliseat is offline   Reply With Quote
Old 11-18-2019, 11:20 AM   #6
DrTT
Human being with feelings
 
Join Date: Jan 2019
Posts: 21
Default

Hello Eliseat,


thanks for your comments and also for looking deeper into the effects!

Quote:
Originally Posted by Eliseat View Post
I tested some of them quickly and it seems that most of the parameter ranges are really extreme or not optimized for proper handling. Maybe I will take a closer look at them tomorrow and give you a more detailed feedback.
You are quite right that some ranges are quite extreme, but be aware that the parameter ranges are not solely for musical purposes, but should mimic the ranges of the corresponding effects in SOX as far as possible.

When looking at the sox sources in https://github.com/chirlu/sox/tree/master/src you'll find e.g. the parameter settings in "phaser.c" (where "NUMERIC_PARAMETER" defines the range and the "p->" parts the default value) as
Code:
NUMERIC_PARAMETER(in_gain  , .0, 1)
NUMERIC_PARAMETER(out_gain , .0, 1e9)
NUMERIC_PARAMETER(delay_ms , .0, 5)
NUMERIC_PARAMETER(decay    , .0, .99)
NUMERIC_PARAMETER(mod_speed, .1, 2)
...
/* Set non-zero defaults: */
p->in_gain   = .4;
p->out_gain  = .74;
p->delay_ms  = 3.;
p->decay     = .4;
p->mod_speed = .5;
The corresponding implementation in JSFXSOX/SOX_Phaser.jsfx is
Code:
slider1:inGain=0.4<0,1,0.001>In Gain [dB]
slider2:outGain=0.74<0,1000,0.001>Out Gain [dB]
slider3:delayInMilliseconds=3.0<0,5,0.001>Delay [ms]
slider4:decay=0.4<0,0.99,0.001>Decay
slider5:frequency=0.5<0.1,2.0,0.001>Modulation [Hz]
So the outGain is even limited here to 1000 instead of the 1E9 in sox (because I thought that a gain of 10⁹dB might be a bit over the top...). The same logic applies to the other effects, where I tried to faithfully deduce the allowed ranges from the original code as far as possible.

So do not spend too much time on the range exploration; the ranges are typically not defined by me, but by sox.
But nevertheless, I am looking forward to hearing your analysis!

Best regards,
DrTT
DrTT is offline   Reply With Quote
Old 11-18-2019, 12:24 PM   #7
beingmf
Human being with feelings
 
beingmf's Avatar
 
Join Date: Jul 2007
Location: Jazz City
Posts: 3,949
Default

Quote:
Originally Posted by DrTT View Post
Hello beingmf,
[...]
Hope this helps!

Best regards,
DrTT
Thanks a lot - I've done this before, I just didn't know, that it's the "master/index.xml" URL that is recognized by ReaPack. So all good now, testing
__________________
Windows 7x64 SP2 | NVidia Quadro2000, 10.18.13.6191 | Marian Seraph AD2, 4.0.7.1
Experience the Blunzeworscht!
beingmf is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:39 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.