I ported native guitar plugins to JavaScript (in-depth)

Photo by Thomas Litangen on Unsplash

TL;DR

Demo

Introduction

The mission

Overloud TH-U — popular native standalone application. One of my inspirations for GUI.
Overloud TH-U — popular native standalone application. One of my inspirations for GUI.

Tools

FAUST code descriptors generated by libfaust
FAUST code descriptors generated by libfaust

Challenges

struct profile {
float f1;
float f2;
// could be float bass_frequencies; int version_number and etc.
}
profile *prof;FILE *profile_file = fopen(“JazzProfile.tapf”, “rb”);fread(&prof, sizeof(profile), 2, profile_file);
fetch(“JazzProfile.tapf”).then(response =>
response.arrayBuffer()).then(buffer => {
let bufferPosition = 0;
const floatSize = 4;
const buff1 = buffer.slice(bufferPosition, floatSize);
const f1 = new Float32Array(buff1)[0];
bufferPosition += floatSize;const buff2 = buffer.slice(bufferPosition, floatSize);
const f2 = new Float32Array(buff2)[0];
});
// original code, fvariable stands for foreign variable
tonestack_low = fvariable(float LOW_CTRL, <math.h>);
// optimized for web, vslider primitive abstracts vertical
// default, min and max values are there just to avoid errors
// useable value is set from JS after a fetching profile filetonestack_low = vslider(“bass”, 0, -10, 10, 0.0001);

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Konstantine Kutalia

Aspiring software engineer specializing in front-end development and a guitar player.