web synth docs

libllsm2

Main repo link: https://github.com/Sleepwalking/libllsm2

This is a library by [sleepwalking]. It stands for Low Level Speech Model for high-quality speech analysis/synthesis. It is written entirely in C.

The library is sparsely documented, but the code is relatively clean. There are references to research papers in several places. It links with a few other of sleepwalking's libraries which are required to build it. There are some examples in the form of files in the tests directory, but there is very little documentation aside from one-liners in the readme. That being said, once I managed to get them to build they do seem to just work, and the API interface seems relatively clean (but I have very little idea what the functions do even after looking at them closely).

It claims that "[...] you can train HMM or DNN models with libllsm2 features" so there is definitely some overlap with the functionality of [hts].

I'm not going to summarize the whole readme (it does a pretty good job), but roughly the process looks like:

  • [fundamental-frequency-estimation], likely to normalize pitch from input audio. [sinsy] does this same thing, if I'm understanding correctly.
  • layer 0 model generated directly from raw input audio
  • layer 1 (optional) generated from the layer 0 model
  • output audio generated by the model in some way. I'm unclear at the moment about what exactly is generated, what parameters are, etc.

This library uses [ciglet], another library by [sleepwalking], internally for many of the low-level DSP tasks.

building

Builds using make. There is code in the makefile specifically for building with emscripten, so it's certainly compatible

There are some instructions for building it on the website, but they aren't quite accurate and I had to make some other changes in order to get it building. Once I followed the build instructions in the readme which consist of fetching + building deps and symlinking them into the external directory of the library, I had to edit makefile to add that exports directory to the include search path (add -Iexports to the compiler flags).

The makefile seems to be broken for the tests. In order to get them building, I managed to come up with this command: cc -DFP_TYPE=float -std=c99 -Wall -fPIC -pthread -DUSE_PTHREAD -I/usr/include/ -I/usr/include/ -I/usr/include/ -Iexternal -fopenmp -Og -g -D_DEBUG -o test/realtime test/test-llsmrt.c ./build/libllsm2.a ./external/ciglet/libciglet.a ./external/libgvps/build/libgvps.a ./external/libpyin/build/libpyin.a ./external/libgvps/build/libgvps.a -lm

The test file name and output binary can be substituted as necessary.

libllsm2