I often do math with those :
{
\override Score.BarNumber.break-visibility = ##(#t #t #t)
% Begin forte
<>\f
% At bar 4, mezzo piano
s1*#(- 4 1) <>\mp
% At bar 20, forte
s1*#(- 20 4) <>\f
% At bar 30, pianissimo
s1*#(- 30 20) <>\pp
s1\fine
}
Sure, you have to carry the last bar number and it ain't pretty but at
least the bar number is written somewhere in the code…
Hope this helps !
Le ven. 28 avr. 2023, à 09 h 09, Gianmaria Lari
<[email protected]> a écrit :
>
> Dear Robin,
>
> made some more tests.
> Your code works well but it doesn't solve the problem because it returns the
> "absolute" location of the notes while on the other hand in the variable
> where you write the dynamic you use a relative location. For example if I
> want to put a dynamic on the quarter number 3 and on the quarter number 17 I
> can't write
>
> s4*3\p
> s4*17\f
>
>
> but I have to write
>
>
> s4*3\p
> s4*20\f
>
>
> I'm sorry but it's my fault. I proposed a possible solution that was simply
> not correct. And now I understand better the reason for the thread Kieren
> linked.
>
> I probably have to go back to study the edition engraver :)
> g.
>
>
>
>
>
>
> On Thu, 27 Apr 2023 at 18:20, Robin Bannister <[email protected]> wrote:
>>
>> Gianmaria Lari wrote:
>> >
>> > 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).
>>
>> Here is a primitive include file for you to play around with.
>>
>> When hovering with the mouse
>> - over a notehead
>> - over a barline (inside a staff)
>> it shows such a position as (an inconvenient) fraction.
>>
>>
>> Cheers,
>> Robin
--
Pierre-Luc Gauthier