Giter Site home page Giter Site logo

Comments (13)

DazDSP avatar DazDSP commented on May 29, 2024

I'm finding a lot of the problems I'm getting when trying to compile working Faust code into a VST appear to be due to combining the following functions...

  • Sliding Reduce operations
  • FIR filter
  • Other filters like highshelf etc.

When the VST compiles in broken form, the VST file size is SMALLER - even though functions have been added to the code!

It's as if the Faust compiler is dropping some parts of the code entirely.

The code works as expected if the code is broken up and compiled into separate VSTs, but this is troublesome to run in cascade.

Any ideas on ways to fix the problem? Or have I hit some compiler or VST limitations?

Daz

from faustservice.

sletz avatar sletz commented on May 29, 2024

When using the online compiler, the same DSP code is sent for any choosen target.

  • are you using the Faust IDE (https://faust.grame.fr/ide) to edit and test the code?
  • are you exporting for macOS ?
  • is the DSP code open and available somewhere to be tested?
  • have you tried the JUCE path ? (since JUCE can also export VST)

from faustservice.

DazDSP avatar DazDSP commented on May 29, 2024

I edit locally on the PC, and test code in FaustLive on Windows 7.
To export to Windows 32 VST, I've been using the Faust editor.

I haven't tried the Faust IDE until now. When loaded, it consumed all available RAM and became almost unresponsive.
I have not tried JUCE.

Here is some audio processing code that causes the VST problem:
The code has a 10 second buffer for look-ahead, so there will be no output for the first ten seconds.
This code runs fine in FaustLive. The metering has been removed for this version.
http://homepages.ihug.com.au/~daz2002/tech/Auto_Stereoizer-5v13d.dsp

from faustservice.

sletz avatar sletz commented on May 29, 2024

Nothing seems wrong with the code. I would suggest to try the JUCE VST export (tested here on OSX and Ableton Live and it seems to work correcly AFAICS)

Capture d’écran 2019-12-23 à 16 29 12

from faustservice.

DazDSP avatar DazDSP commented on May 29, 2024

Does the method shown produce a compiled VST, or just source code?
When I tested it, it saved a zip file that appeared to contain cpp source, and a "jucer" file only.

from faustservice.

sletz avatar sletz commented on May 29, 2024

Yes, it produces a JUCE project (the jucer file) that you'll have to compile yourself to get the compiled VST.

from faustservice.

DazDSP avatar DazDSP commented on May 29, 2024

That is a considerably more troublesome path to take, as I am not familiar with Juce.
This also raises the question: Have I hit a resource limitation of the Faust compiler, or does it appear to have a bug?
I couldn't find any references to VSTs having particular complexity or memory limits.

from faustservice.

sletz avatar sletz commented on May 29, 2024

If you install the JUCE SDK, it should be quite straightforward. For now there is no reason to think there is a specific bug.

from faustservice.

DazDSP avatar DazDSP commented on May 29, 2024

How could there not be a bug if it is compiling broken VST code?
You would expect the size of the VST to grow larger when more code is added. Instead - when the compiled VST is broken - the VST has a smaller size than previously, even though it has become more complex.

from faustservice.

sletz avatar sletz commented on May 29, 2024

I mean, it could be a bug in the specific VST architecture file (that is the generic file that is added around the code produced by the Faust compiler), but not in he compiler itself. Trying the JUCE path can help answering this question.

from faustservice.

DazDSP avatar DazDSP commented on May 29, 2024

Is it just a matter of loading the exported JUCE project saved from Faust into Projucer, and compiling it into a VST? I can't seem to find any option to compile the JUCE project to a VST (but this is the first time I have used Projucer).
The "Selected Exporters" list only shows:
Xcode (MacOSX)
Xcode (iOS)
Visual Studio 2015
Linux Makefile
Android

from faustservice.

DazDSP avatar DazDSP commented on May 29, 2024

Using JUCE to build a VST will require some more time and effort to figure out.
In the mean time, I have done some testing.

Even the "music_detect" routine by itself would not compile into a working VST.
Removing the sliding RMS and recursion made no difference.
BUT.. removing the large look ahead delay enabled it to compile successfully.

Further testing revealed if this code was removed:

//old code
sps = ma.SR; //samples per second
delay = (nmax)+(trim/2)+(3*sps);
trim = 8 * sps;
ddd = dd,dd@(trim):min;
out = l@delay,r@delay,ddd;

and was replaced with this:

//new code
ddd = dd,dd@352800:min;
ld = l@374236; //only one audio output channel is needed because it's mono
out = ld,ddd;

Then the code compiles into a working VST.

Even with only one audio channel being delayed, the VST still breaks using the old code.
But the old code should evaluate the delays to the same numerical result as the new code!

Applying delays to both audio channels breaks the VST. But only one channel is needed because of the mono input.
Applying the "ddd" delay AND including the rest of the original code also breaks the VST.
Leaving out the "ddd" trim delay allows the rest of the original code to compile correctly. But this doesn't function as needed.

At this stage, the easiest option is to compile the code into two sections:
1: The Music Detect code (output is mono audio and a DC control signal)
2: The Stereoizing code, including EQ and limiting (output is two channel stereoized audio)

This also allows the automatic music detection of the first stage to be inspected and edited in a normal sound editor, which is actually an adavantage.

from faustservice.

DazDSP avatar DazDSP commented on May 29, 2024

A video demo of the code running in FaustLive, with some improvements. Audio is from a mono shortwave broadcast (with some special enhancements).
https://storage.googleapis.com/dazman/misc/2019-12-28-TIAMS-AutoStereo-05.mp4

from faustservice.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.