korginc / logue-sdk

This repository contains all the files and tools needed to build custom oscillators and effects for the prologue synthesizer.
BSD 3-Clause "New" or "Revised" License
818 stars 304 forks source link

LUTs in Q31 #39

Open dukesrg opened 4 years ago

dukesrg commented 4 years ago

Oscillator runtime API lookups are in float now, but OSC_CYCLE natively uses Q31 format. This looks weird and leads to excessive calculations, like

I did the test: reversed necessary funcitons of osc_api and float_math to Q31 math, made a precalculation of useneeded LUTs into Q31 format on oscillator init and used only integer math (including Q31) inside the OSC_CYCLE main loop. This gives roughly 50% performance increase. This really makes sence when you trying to combine dozens of waves in unison.

Maybe it is too late to change horses in midstream, but this could give a glue to performance optimization for someone.