Posted on Leave a comment

JSFX on Fedora Linux: an ultra-fast audio prototyping engine

Introduction

Writing a real-time audio plugin on Linux often conjures up images of a complex environment: C++, toolchains, CMake, CLAP / VST3 / LV2 SDK, ABI…

However, there is a much simpler approach : JSFX

This article offers a practical introduction to JSFX and YSFX on Fedora Linux: we’ll write some small examples, add a graphical VU meter, and then see how to use it as an CLAP / VST3 plugin in a native Linux workflow.

JSFX (JesuSonic Effects – created by REAPER [7]) allows you to write audio plugins in just a few lines, without compilation, with instant reloading and live editing.

Long associated with REAPER, they are now natively usable on Linux, thanks to YSFX [3], available on Fedora Linux in CLAP and VST3 formats via the Audinux repository ([4], [5]).

This means it’s possible to write a functional audio effect in ten lines, then immediately load it into Carla [8], Ardour [9], or any other compatible host, all within a PipeWire / JACK [11] environment.

A citation from [1] (check the [1] link for images):

In 2004, before we started developing REAPER, we created software designed for creating and modifying FX live, primarily for use with guitar processing.

The plan was that it could run on a minimal Linux distribution on dedicated hardware, for stage use. We built a couple of prototypes.

These hand-built prototypes used mini-ITX mainboards with either Via or Intel P-M CPUs, cheap consumer USB audio devices, and Atmel AVR microcontrollers via RS-232 for the footboard controls.

The cost for the parts used was around $600 each.

In the end, however, we concluded that we preferred to be in the software business, not the hardware business, and our research into adding multi-track capabilities in JSFX led us to develop REAPER. Since then, REAPER has integrated much of JSFX’s functionality, and improved on it.

So, as you can see, this technology is not that new. But the Linux support via YSFX [3] is rather new (Nov 2021, started by Jean-Pierre Cimalando).

A new programming language, but for what ? What would one would use JSFX for ?

This language is dedicated to audio and with it, you can write audio effects like an amplifier, a chorus, a delay, a compressor, or you can write synthesizers.

JSFX is good for rapid prototyping and, once everything is in place, you can then rewrite your project into a more efficient language like C, C++, or Rust.

JSFX for developers

Developing an audio plugin on Linux often involves a substantial technical environment. This complexity can be a hindrance when trying out an idea quickly.

JSFX (JesuSonic Effects) offers a different approach: writing audio effects in just a few lines of interpreted code, without compilation and with instant reloading.

Thanks to YSFX, available on Fedora Linux in CLAP and VST3 formats, these scripts can be used as true plugins within the Linux audio ecosystem.

This article will explore how to write a minimal amplifier in JSFX, add a graphical VU meter, and then load it into Carla as a CLAP / VST3 plugin.

The goal is simple: to demonstrate that it is possible to prototype real-time audio processing on Fedora Linux in just a few minutes.

No compilation environment is required: a text editor is all you need.

YSFX plugin

On Fedora Linux, YSFX comes in 3 flavours :

  • a standalone executable ;
  • a VST3 plugin ;
  • a CLAP plugin.

YSFX is available in the Audinux [5] repository. So, first, install the Audinux repository:

$ dnf copr enable ycollet/audinux

Then, you can install the version you want:

$ dnf install ysfx
$ dnf install vst3-ysfx
$ dnf install clap-ysfx

Here is a screenshot of YSFX as a VST3 plugin loaded in Carla Rack [8]:

Screenshot of YSFX effect VST3 plugin loaded in Carla-rack

You can :

  • Load a file ;
  • Load a recent file ;
  • Reload a file modified via the Edit menu ;
  • Zoom / Unzoom via the 1.0 button ;
  • Load presets ;
  • Switch between the Graphics and Sliders view.

Here is a screenshot of the Edit window:

Screenshot of the editor Window opened via the YSFX plugin.

The  Variables  column displays all the variables defined by the loaded file.

Examples

We will use the JSFX documentation available at [4].

JSFX code is always divided into section.

  • @init : The code in the @init section gets executed on effect load, on samplerate changes, and on start of playback.
  • @slider : The code in the @slider section gets executed following an @init, or when a parameter (slider) changes
  • @block : The code in the @block section is executed before processing each sample block. Typically a block is the length as defined by the audio hardware, or anywhere from 128-2048 samples.
  • @sample : The code in the @sample section is executed for every PCM (Pulse Code Modulation) audio sample.
  • @serialize : The code in the @serialize section is executed when the plug-in needs to load or save some extended state.
  • @gfx [width] [height] : The @gfx section gets executed around 30 times a second when the plug-ins GUI is open.

A simple amplifier

In this example, we will use a slider value to amplify the audio input.

desc:Simple Amplifier
slider1:1<0,4,0.01>Gain @init
gain = slider1; @slider
gain = slider1; @sample
spl0 *= gain;
spl1 *= gain;

slider1, @init, @slider, @sample, spl0, spl1 are JSFX keywords [1].

Description:

  • slider1: create a user control (from 0 to 4 here);
  • @init: section executed during loading;
  • @slider: section executed when we move the slide;
  • @sample: section executed for each audio sample;
  • spl0 and spl1: left and right channels.
  • In this example, we just multiply the input signal by a gain.

Here is a view of the result :

Screenshot of the simple gain example

An amplifier with a gain in dB

This example will create a slider that will produce a gain in dB.

desc:Simple Amplifier (dB)
slider1:0<-60,24,0.1>Gain (dB) @init
gain = 10^(slider1/20); @slider
gain = 10^(slider1/20); @sample
spl0 *= gain;
spl1 *= gain;

Only the way we compute the gain changes.

Here is a view of the result :

Screenshot of the simple gain in dB example

An amplifier with an anti-clipping protection

This example adds protection against clipping and uses a JSFX function for that.

desc:Simple Amplifier with Soft Clip
slider1:0<-60,24,0.1>Gain (dB) @init
gain = 10^(slider1/20); @slider
gain = 10^(slider1/20);
function softclip(x) ( x / (1 + abs(x));
); @sample
spl0 = softclip(spl0 * gain);
spl1 = softclip(spl1 * gain);

Here is a view of the result :

Screenshot of the simple gain in dB with. a soft clip example

An amplifier with a VU meter

This example is the same as the one above, we just add a printed value of the gain.

desc:Simple Amplifier with VU Meter
slider1:0<-60,24,0.1>Gain (dB) @init
rms = 0;
coeff = 0.999; // RMS smoothing
gain = 10^(slider1/20); @slider
gain = 10^(slider1/20); @sample
// Apply the gain
spl0 *= gain;
spl1 *= gain;
// Compute RMS (mean value of the 2 channels)
mono = 0.5*(spl0 + spl1);
rms = sqrt((coeff * rms * rms) + ((1 - coeff) * mono * mono)); @gfx 300 200 // UI part
gfx_r = 0.1; gfx_g = 0.1; gfx_b = 0.1;
gfx_rect(0, 0, gfx_w, gfx_h); // Convert to dB
rms_db = 20*log(rms)/log(10);
rms_db < -60 ? rms_db = -60; // Normalisation for the display
meter = (rms_db + 60) / 60;
meter > 1 ? meter = 1; // Green color
gfx_r = 0;
gfx_g = 1;
gfx_b = 0; // Horizontal bar
gfx_rect(10, gfx_h/2 - 10, meter*(gfx_w-20), 20); // Text
gfx_r = gfx_g = gfx_b = 1;
gfx_x = 10;
gfx_y = gfx_h/2 + 20;
gfx_printf("Level: %.1f dB", rms_db);

The global structure of the code:

  • Apply the gain
  • Compute a smoothed RMS value
  • Convert to dB
  • Display a horizontal bar
  • Display a numerical value

Here is a view of the result :

Screenshot of the simple example with a VU meter

An amplifier using the UI lib from jsfx-ui-lib

In this example, we will use a JSFX UI library to produce a better representation of the amplifier’s elements.

First, clone the https://github.com/geraintluff/jsfx-ui-lib repository and copy the file ui-lib.jsfx-inc into the directory where your JSFX files are saved.

desc:Simple Amplifier with UI Lib VU
import ui-lib.jsfx-inc
slider1:0<-60,24,0.1>Gain (dB) @init
freemem = ui_setup(0);
rms = 0;
coeff = 0.999;
gfx_rate = 30; // 30 FPS @slider
gain = 10^(slider1/20); @sample
spl0 *= gain;
spl1 *= gain;
mono = 0.5*(spl0 + spl1);
rms = sqrt(coeff*rms*rms + (1-coeff)*mono*mono); // ---- RMS computation ----
level_db = 20*log(rms)/log(10);
level_db < -60 ? level_db = -60; @gfx 300 200
ui_start("main"); // ---- Gain ----
control_start("main","default");
control_dial(slider1, 0, 1, 0);
cut = (level_db + 100) / 200 * (ui_right() - ui_left()) + ui_left(); // ---- VU ----
ui_split_bottom(50);
ui_color(0, 0, 0);
ui_text("RMS Level: ");
gfx_printf("%d", level_db);
ui_split_bottom(10);
uix_setgfxcolorrgba(0, 255, 0, 1);
gfx_rect(ui_left(), ui_top(), ui_right() - ui_left(), ui_bottom() - ui_top());
uix_setgfxcolorrgba(255, 0, 0, 1);
gfx_rect(ui_left(), ui_top(), cut, ui_bottom() - ui_top());
ui_pop();

The global structure of the example:

  • Import and setup: The UI library is imported and then allocated memory (ui_setup) using @init;
  • UI controls: control_dial creates a thematic potentiometer with a label, integrated into the library;
  • Integrated VU meter: A small graph is drawn with ui_graph, normalizing the RMS value between 0 and 1;
  • UI structure: ui_start(“main”) prepares the interface for each frame. ui_push_height / ui_pop organize the vertical space.

Here is a view of the result :

Screenshot of the simple example with JSFX graphic elements

A simple synthesizer

Now, produce some sound and use MIDI for that.

The core of this example will be the ADSR envelope generator ([10]).

desc:Simple MIDI Synth (Mono Sine)
// Parameters
slider1:0.01<0.001,2,0.001>Attack (s)
slider2:0.2<0.001,2,0.001>Decay (s)
slider3:0.8<0,1,0.01>Sustain
slider4:0.5<0.001,3,0.001>Release (s)
slider5:0.5<0,1,0.01>Volume @init
phase = 0;
note_on = 0;
env = 0;
state = 0; // 0=idle,1=attack,2=decay,3=sustain,4=release @slider
// Compute the increment / decrement for each states
attack_inc = 1/(slider1*srate);
decay_dec = (1-slider3)/(slider2*srate);
release_dec = slider3/(slider4*srate); @block
while ( midirecv(offset, msg1, msg23) ? ( status = msg1 & 240; note = msg23 & 127; vel = (msg23/256)|0; // Note On status == 144 && vel > 0 ? ( freq = 440 * 2^((note-69)/12); phase_inc = 2*$pi*freq/srate; note_on = 1; state = 1; ); // Note Off (status == 128) || (status == 144 && vel == 0) ? ( state = 4; ); );
); @sample
// ADSR Envelope [10]
state == 1 ? ( // Attack env += attack_inc; env >= 1 ? ( env = 1; state = 2; );
); state == 2 ? ( // Decay env -= decay_dec; env <= slider3 ? ( env = slider3; state = 3; );
); state == 3 ? ( // Sustain env = slider3;
); state == 4 ? ( // Release env -= release_dec; env <= 0 ? ( env = 0; state = 0; );
); // Sine oscillator
sample = sin(phase) * env * slider5;
phase += phase_inc;
phase > 2*$pi ? phase -= 2*$pi; // Stereo output
spl0 = sample;
spl1 = sample;

Global structure of the example:

  • Receives MIDI via @block;
  • Converts MIDI note to frequency (A440 standard);
  • Generates a sine wave;
  • Applies an ADSR envelope;
  • Outputs in stereo.

Here is a view of the result :

Screenshot of the synthesizer example

Comparison with CLAP / VST3

JSFX + YSFX

Advantages of JSFX:

  • No compilation required;
  • Instant reloading;
  • Fast learning curve;
  • Ideal for DSP prototyping;
  • Portable between systems via YSFX.

Limitations:

  • Less performant than native C++ for heavy processing;
  • Less suitable for “industrial” distribution;
  • Simpler API, therefore less low-level control.

CLAP / VST3 in C/C++

Advantages:

  • Maximum performance;
  • Fine-grained control over the architecture;
  • Deep integration with the Linux audio ecosystem;
  • Standardized distribution.

Limitations:

  • Requires a complete toolchain;
  • ABI management/compilation;
  • Longer development cycle.

Conclusion

A functional audio effect can be written in just a few lines, adding a simple graphical interface, and then loaded this script as an CLAP / VST3 plugin on Fedora Linux. This requires no compilation, no complex SDK, no cumbersome toolchain.

JSFX scripts don’t replace native C++ development when it comes to producing optimized, widely distributable plugins. However, they offer an exceptional environment for experimentation, learning signal processing, and rapid prototyping.

Thanks to YSFX, JSFX scripts now integrate seamlessly into the Linux audio ecosystem, alongside Carla, Ardour, and a PipeWire-based audio system.

For developers and curious musicians alike, JSFX provides a simple and immediate entry point into creating real-time audio effects on Fedora Linux.

Available plugins

ysfx-chokehold

A free collection of JS (JesuSonic) plugins for Reaper.

Code available at: https://github.com/chkhld/jsfx

To install this set of YSFX plugins:

$ dnf install ysfx-chokehold

YSFX plugins will be available at /usr/share/ysfx-chokehold.

ysfx-geraintluff

Collection of JSFX effects.

Code available at: https://github.com/geraintluff/jsfx

To install this set of YSFX plugins:

$ dnf install ysfx-geraintluff

YSFX plugins will be available at /usr/share/ysfx-geraintluff.

ysfx-jesusonic

Some JSFX effects from Cockos.

Code available at: https://www.cockos.com/jsfx

To install this set of YSFX plugins:

$ dnf install ysfx-jesusonic

YSFX plugins will be available at /usr/share/ysfx-jesusonic.

ysfx-joepvanlier

A bundle of JSFX and scripts for reaper.

Code available at: https://github.com/JoepVanlier/JSFX

To install this set of YSFX plugins:

$ dnf install ysfx-joepvanlier

YSFX plugins will be available at /usr/share/ysfx-joepvanlier.

ysfx-lms

LMS Plugin Suite – Open source JSFX audio plugins

Code available at: https://github.com/LMSBAND/LMS

To install this set of YSFX plugins:

$ dnf install ysfx-lms

YSFX plugins will be available at /usr/share/ysfx-lms.

ysfx-reateam

Community-maintained collection of JS effects for REAPER

Code available at: https://github.com/ReaTeam/JSFX

To install this set of YSFX plugins:

$ dnf install ysfx-reateam

YSFX plugins will be available at /usr/share/ysfx-reateam.

ysfx-rejj

Reaper JSFX Plugins.

Code available at: https://github.com/Justin-Johnson/ReJJ

To install this set of YSFX plugins:

$ dnf install ysfx-rejj

And all the YSFX plugins will be available at /usr/share/ysfx-rejj.

ysfx-sonic-anomaly

Sonic Anomaly JSFX scripts for Reaper

Code available at: https://github.com/Sonic-Anomaly/Sonic-Anomaly-JSFX

To install this set of YSFX plugins:

$ dnf install ysfx-sonic-anomaly

YSFX plugins will be available at /usr/share/ysfx-sonic-anomaly.

ysfx-tilr

TiagoLR collection of JSFX effects

Code available at: https://github.com/tiagolr/tilr_jsfx

To install this set of YSFX plugins:

$ dnf install ysfx-tilr

YSFX plugins will be available at /usr/share/ysfx-tilr.

ysfx-tukan-studio

JSFX Plugins for Reaper

Code available at: https://github.com/TukanStudios/TUKAN_STUDIOS_PLUGINS

To install this set of YSFX plugins:

$ dnf install ysfx-tukan-studio

YSFX plugins will be available at /usr/share/ysfx-tukan-studio.

Webography

[1] – https://www.cockos.com/jsfx

[2] – https://github.com/geraintluff/jsfx

[3] – https://github.com/JoepVanlier/ysfx

[4] – https://www.reaper.fm/sdk/js/js.php

[5] – https://audinux.github.io

[6] – https://copr.fedorainfracloud.org/coprs/ycollet/audinux

[7] – https://www.reaper.fm/index.php

[8] – https://github.com/falkTX/Carla

[9] – https://ardour.org

[10] – https://en.wikipedia.org/wiki/Envelope_(music)

[11] – https://jackaudio.org

Posted on Leave a comment

FMOD Studio Now Free For Indie Game Developers

FMOD, perhaps the most popular audio middleware solution for games, just updated their indie developer licenses effectively making the use of FMOD free for smaller indie game developers. So what defines an indie game developer here? First you need to make less than $200K gross revenue per year and second, you need to have less than $500K USD in funding for your game title. There are also some limitations on industry, so for example gambling and simulation projects do not qualify for this license.

The primary details of this announcement came via this tweet:

FMOD Free indie license tweet.

The key paragraph from the linked legal document is the following:

This EULA grants you the right to use FMOD Studio Engine, for Commercial use, subject to the following:

  • Development budget of the project is less than $500k (Refer to www.fmod.com/licensing#licensing-faq for information);
  • Total gross revenue / funding per year for the developer, before expenses, is less than $200k (Refer to www.fmod.com/licensing#licensing-faq for information);
  • FMOD Studio Engine is integrated and redistributed in a game application (Product) only;
  • FMOD Studio Engine is not distributed as part of a game engine or tool set;
  • Project is registered in your profile page at www.fmod.com/profile#projects;
  • Product includes attribution in accordance with Clause 3.

More details about the licensing changes are available here. FMod has support for several game engines including Unreal and Unity, if you are a Godot developer there is FMOD support available via this project, as well as a GDNative version available here. To learn more about FMOD and the new indie licensing check out the video below.

[youtube https://www.youtube.com/watch?v=XF-AbQHme3s?feature=oembed&w=1500&h=844]
Posted on Leave a comment

Hands-On With Sound Particles

Sound Particles is a one of a kind program for rendering 3D audio, capable of supporting thousands to millions of sounds in your simulation. Sound Particles has been battle tested used in big budgets movies such as Alita, Ready Player One and the new Star Wars films, as well as games such as Assassins Creed Origin.

Features of Sound Particles:

Sound Particles is a sound design software application capable of generating thousands (even millions) of sounds in a virtual 3D audio world. This immersive audio application will enable you to create highly complex sounds on the fly, which will ultimately enable you to design sound better and faster than ever.

Sound Design
The best 3D software for complex sound design. Used for film, videogames and virtual reality.

Postproduction
Working in postproduction? Use Sound Particles to add depth and richness to your sounds.

Immersive Audio
Supports immersive audio formats, such as Ambisonics, Dolby Atmos, Auro 3d and much more.

If you are interested in trying this unique audio application they have a fully functional demonstration available for Windows and Mac available here. All licenses are currently 50% off during Black Friday/Cyber Monday from indie to enterprise licenses. You can see Sound Particles in action in the video below. Sounds used during this demo were all downloaded from the excellent FreeSound.org website.

[youtube https://www.youtube.com/watch?v=mnoQPqKRHWo?feature=oembed&w=1500&h=844]
Posted on Leave a comment

Beepbox Easy Online Music Sketching Application

Beepbox is a free online tool for quickly generating music via sketching. It’s written in a combination of JavaScript and TypeScript with the source code available on GitHub under the very permissive MIT license. Getting started with Beepbox is as simple as going to the website and starting to lay down some notes. There are a variety of instruments available and you can layer multiple tracks of sounds to easily create music.

Perhaps coolest of all, as you create your song, the song’s data is encoded into the URL. You can simply share your songs URL and others can either open it in the player or they can open it in the editor and make changes. You can also download your song in .mid or .json formats for later updating, or you can export out into WAV format for use in your game engine of choice. In addition to BeepBox is there a modified more complex version called ModBox you can check out here. It is forked from the same source code but offers additional tools and levels of control at the cost of complexity.

You can learn more about BeepBox and see it in action in the video below.

[youtube https://www.youtube.com/watch?v=7hxb53xL35s?feature=oembed&w=1500&h=844]
Posted on Leave a comment

The BIG Royalty Free Music Bundle

Humble are running another bundle of interest to game developers, this one is the BIG Royalty-Free Music Bundle, a collection of “albums” containing game ready music in WAV and MP3 formats. The music is licensed in a way that enables you to distribute the music in your games, commercially or otherwise. As with all Humbles, this one is organized into tiers:

1$

  • Dark skies and other disasters
  • Haunted
  • The vanishing of Elisabeth Rose
  • Chronicles of the illusion world
  • Archives vol 1: the dark side

15$

  • Chuck kick ass
  • Shadows guild
  • The monster that lies within
  • Cult
  • Mindhunter
  • Forever and a day
  • Imagine
  • Archives vol 2: the love

25$

  • Chaos logic chaos the butterfly effect
  • The 29th planet
  • Black sails
  • Darkventures
  • Jotun
  • Pandemonium
  • Once upon a nightmare
  • Witchcraft
  • Slasher
  • The Lab
  • Dreamagination
  • Pixel: faster stronger harder
  • Superheroes

As with all Humble Bundles, you decide how the money is allocated, between Humble, Charity, the publisher and if you so choose (and thanks if you do!) to support GFS by purchasing with this link. You can learn more about the bundle in the video below.

[youtube https://www.youtube.com/watch?v=OrN3zg8rQyA?feature=oembed&w=1500&h=844]
Posted on Leave a comment

ODIN 2 Synthesizer VST

Recently updated, today we are checking out the free and open source ODIN 2 synthesizer. It is built on top of the JUCE audio framework (also open source). ODIN 2 is described as:

Ever dreamt of a kickass synthesizer which is available on every platform? With a deep synthesis engine, endless modulation capabilities and it is literally for free? Look no further, Odin’s got you covered!

The sound of this 24-voice polyphonic beast will take you from your studio right to Valhalla. Earth shattering basses, exquisite leads or mad FX, Odin’s got them all! Use the classic sound of analog waveforms – or draw your own. High quality emulations of legendary analog filters like the Moog-ladder or the Korg-35 further shape your signal. Round your sound off with four onboard FX, or get crazy with modulation. There’s much to discover in Odin 2.

The source code for Odin 2 is available on GitHub under the GPL 3 open source license. Odin 2 is available for Windows, MacOS and Linux operating systems and is implemented as an VST compatible with most modern DAWs. If you are looking for a DAW to host Odin 2, check out our coverage on Reaper, LMMS, Mixcraft or ZRythm.

You can check out Odin 2 in action in the video below.

[youtube https://www.youtube.com/watch?v=MsVzmXnL9mY?feature=oembed&w=1500&h=844]
Posted on Leave a comment

NVIDIA RTX Voice Hands-On Review

In the age of COVID, with so many people working from home or in out of the ordinary scenarios, we may not necessarily have a ton of control over our environment. This means noise cancellation is perhaps more important than it has ever been. We are not immune to the effects and the audio quality of GFS videos have certainly suffered in the last few months. Enter RTX Voice.

If you are unaware, RTX Voice is a free plugin from NVIDIA that uses machine learning to filter out background noise. RTX Voice is described as:

NVIDIA RTX Voice is a new plugin that leverages NVIDIA RTX GPUs and their AI capabilities to remove distracting background noise from your broadcasts, voice chats, and remote video conferencing meetings. This allows users to “go live” or join a meeting without having to worry about unwanted sounds like loud keyboard typing or other ambient noise in noisy environments. RTX Voice also suppresses background noise from players in loud environments, making incoming audio easier to understand.

RTX Voice requires an RTX 2060 or higher and works with the vast majority of video capture applications including OBS Studio and Camtasia. The also offer RTX Voice support in their more comprehensive, but also free, Broadcast App.

We decided to put RTX Voice to the test in a simulated real world environment, using a Shure MV51 microphone and a Logitech Pro X headset (affiliate links). The tests were done with RTX Off and On with each device, as well as with background noise including typing and television. You can see (and hear!) the results in the video below (or watch on Odysee).

[youtube https://www.youtube.com/watch?v=Qqo6cfwySYY?feature=oembed&w=1500&h=844]