vult-dsp / vult

Vult is a transcompiler well suited to write high-performance DSP code
https://vult-dsp.github.io/vult
Other
490 stars 25 forks source link

Modifying fixed point type in vult runtime #51

Open ul1t opened 1 year ago

ul1t commented 1 year ago

I'm developing platform for modular synth based on relatively cheap MCUs. I prefer Vult over other DSL's due to its native support of fixed-point math. But I'd like to use 8.24 format instead of default 16.16. Is it possible to implement new format only by modifying vultin.h/vultin.c? I have almost compatible header-only 8.24 fixed-point math library from previous projects. Or is 16.16 format hardcoded inside transpiler?

modlfo commented 1 year ago

The literals and computations resulting in constants are converted internally to 16.16. That part should be easy to change in the compiler so 8.24 is used

If you have the functions in vultin.* for 8.24 I could add an option so 8.24 is assumed.