Hi Valentin, Have you looked at Harm's work in this sphere? e.g. https://lists.gnu.org/archive/html/lilypond-user/2019-09/msg00159.html
It really would be nice for Lilypond to have a built-in, unified, custom/on-the-fly dynamic function/framework that supported an intuitive interface [like the one in Harm's function]. I've worked with custom dynamics a lot, so I know all the pros and cons of all the methods — if you have any questions, or would like to work together on an optimal implementation, let me know! Cheers, Kieren.