Performance Tips: the cost of allocation

Looking at the performance results of algorithms using arrays I noticed something very drastic. LuaJIT was terribly slow compared to the other languages.


Performance Tips: floating-point mod

Recently I implemented in Vult a simpler way for me to measure the performance of the generated code. Running the command $ make perf generates code for all languages and runs it for most of the examples.


Generating Web Audio code

For a long time it has been possible to generate JavaScript code that runs in the browser (check the Vult demo). However the code was not very easy to integrate since it still needed some manual coding.

Now Vult provides a new template for JavaScript that generates the code of a ScriptProcessorNode that can be easily added to a Web Audio project.


New structure of the examples

In the past, the examples folder of Vult contained just a few files that were developed in an early stage. Most of the ‘real’ examples were developed in a separate repository. In order to improve the testing of the Vult compiler the examples have been moved into the Vult repository.


Compile-time embedding of WAV files

Around the 2000’s I got my first VST plugin; it was a PPG Wave. The sounds produced by this plugin got me intrigued because it sounded very different from other soft synths that I have heard. The main difference was that the PPG was based on wavetables. Since I started working on Vult, making a wavetable synthesizer has been in the list.


Compile-time creation of tables

This is one of the features that has been in the TODO list since the creation of Vult. When generating code, now is possible to annotate a function and Vult will automatically create a table-based implementation which will be faster. This is specially useful when generating code for microcontrollers.


Automatic loading of Vult files

Recently I implemented simpler way to call the Vult compiler with multiple files. Previously Vult required that you passed every file in a correct order. For example:


New repository with more PureData examples

A new repository with more Vult examples is available:

https://github.com/modlfo/vult-examples


Generating up-to-date binaries with CI

I have been using Travis CI for running tests and checking that Vult build correctly. Travis CI can build Vult in OSX and Linux. However, due to the status of OCaml it was difficult to setup something similar in Windows with AppVeyor. Thankfully the OCaml community has published a set of script to configure different CI services:


Now Vult can be installed from npm

In the last months I have been making many improvements to the Vult compiler. These improvements cannot be easily tried by the users due to the fact that for me creating binaries for all the platforms is very time consuming. Therefore, in order for the users to try the latests changes they need to compile Vult from the source code. Even though the process is well documented in the repository, this can be time consuming and difficult for people unfamiliar with the OCaml tools.


LuaJIT as backend for Vult

I have been keeping an eye on LuaJIT (http://luajit.org) for some time. It’s a very interesting project and I have read very good things about it. Some time ago I made a small benchmark comparing an optimized algorithm written in C++11 against a lazy coded version in OCaml and LuaJIT. In case you are curious here are the results:


Generating Pure Data and Teensy Audio templates

As part of the Vult project I have developed a new standalone library: Pla (https://modlfo.github.io/pla/). Pla is a templating library that is used in Vult to generate code in a simpler way. Thanks to this library I have developed two templates to simplify using Vult:


New site for Vult

I have been working on giving a refresh of the Vult site. The result is what you see now. After trying a few alternatives I settle to use Hugo (https://gohugo.io). The reason I used Hugo was because I could make it do exactly what I wanted with the help of the documentation.