Thank you Leo for your answers and help.
you’ll probably need to be a little more specific about the use
case, perhaps also supply example code.
Regarding my second question, let me try to be more clear
I have a score.
I want to write the dynamics using a separate variable.
Suppose that on the first quarter of the tenth measure there is a
"forte" and then on the note of the next bar there is a "piano." If all
the measures have the same "time signature", let's say of 4/4, then it's
pretty easy: just count the beats and multiply by 4. Finally you will write:
s1*9 s4\f s4*3 s4\p
The operation is not difficult but making mistakes is pretty easy. In
fact this system works well if the "time signature" does not change or
changes very little in the piece. Otherwise you have to add up the
duration of each note individually and making mistakes becomes extremely
easy.
This thing always seemed so inconvenient to me that I thought it was
practically unusable. Or that there was some trick to maybe have
Frescobaldi tell me the "position" of the note (meant as numbers of
quarter or eight notes from the beginning).