I’m working on some faust code that works just fine when I compile it using my nixos system-wide installed faust2jack
, or the one in my profile, but has a subtle bug in the audio when I compile it using either a shell.nix
or a flake.nix
.
I’ve been using and contributing to nixos for 10 years now, but I know just enough for that.
I totally new to nix shells.
To reproduce, you need to have jack running:
services.jack.jackd.enable = true;
Then run:
git clone https://github.com/magnetophon/lamb
cd lamb
git checkout flake
nix develop
faust2jack -double -time -t 0 lamb.dsp && x42-scope & ./lamb
Run some audio trough lamb
and connect it’s outputs to x42-scope.
Turn up the input gain of lamb until you see the gain reduction meters move.
Output nr 3 and 4 will show the gain reduction on the scope.
The bug can be seen as jumps in these lines, like this:
Without the bug, these are smooth lines:
To compile without the bug, open a new terminal an do:
nix profile install nixpkgs#faust2jack
nix profile install nixpkgs#x42-pluins
faust2jack -double -time -t 0 lamb.dsp && x42-scope & ./lamb
Faust is a transpiler that outputs C++.
It seems that the problem is not with faust itself, but with the way the C++ it outputs is compiled, since the C++ output is the same in both environments:
faust -time -t 0 -double -o lamb.cpp lamb.dsp