Voici un premier essai.
Il doit y avoir certaines limitations, en particulier qu'il ne s'applique que pour le style 'baroque.
Mais je ne les ai, bien sûr, pas toutes anticipées.
\version "2.16.2"
\include "
italiano.ly"
hemiola =
#(define-music-function
(parser location musique)
(ly:music?)
#{
\override NoteHead #'stencil =
#(lambda (grob)
(let* ((sz (ly:grob-property grob 'font-size 0.0))
(mult (magstep sz))
(duration (ly:grob-property grob 'duration-log)))
(case duration
((1)
(ly:stencil-scale
(ly:make-stencil
`(path 0.001
`(moveto 0 0
curveto 0.000 -0.200 0.060 0.210 0.350 0.365
curveto 0.510 0.460 0.700 0.545 1.050 0.545
curveto 1.200 0.545 1.380 0.500 1.380 0.270
curveto 1.380 0.120 1.290 -0.140 1.120 -0.300
curveto 0.870 -0.500 0.520 -0.542 0.320 -0.542
curveto 0.200 -0.542 0.000 -0.530 0.000 -0.250
closepath)
'round 'round #t)
(cons 0 1.38)
(cons 0 .5))
mult mult))
((0)
(ly:stencil-scale
(ly:make-stencil
`(path 0.001
`(moveto 0 0
curveto 0.000 -0.350 0.549 -0.545 1.000 -0.545
curveto 1.450 -0.545 2.000 -0.340 2.000 0.000
curveto 2.000 0.350 1.470 0.545 1.000 0.545
curveto 0.530 0.545 0.000 0.350 0.000 0.000
closepath)
'round 'round #t)
(cons 0 2)
(cons 0 .5))
mult mult))
((-1)
(ly:stencil-scale
(ly:make-stencil
`(path 0.001
`(moveto 0 0
lineto 0.000 0.710
curveto 0.000 0.755 0.035 0.765 0.060 0.765
curveto 0.080 0.765 0.110 0.755 0.110 0.701
curveto 0.110 0.580 0.140 0.542 0.170 0.542
lineto 1.820 0.542
curveto 1.865 0.542 1.890 0.600 1.890 0.701
curveto 1.890 0.755 1.930 0.765 1.940 0.765
curveto 1.960 0.765 2.000 0.755 2.000 0.701
lineto 2.000 -0.701
curveto 2.000 -0.755 1.960 -0.765 1.940 -0.765
curveto 1.930 -0.765 1.890 -0.755 1.890 -0.701
curveto 1.890 -0.600 1.865 -0.542 1.820 -0.542
lineto 0.170 -0.542
curveto 0.140 -0.542 0.110 -0.580 0.110 -0.701
curveto 0.110 -0.755 0.080 -0.765 0.060 -0.765
curveto 0.035 -0.765 0.000 -0.755 0.000 -0.710
closepath)
'round 'round #t)
(cons 0 2)
(cons -0.765 0.765))
mult mult))
(else (ly:note-head::print grob))
)))
$musique
\revert NoteHead #'stencil
#})
%% Test :
\relative do {
\override NoteHead #'style = #'baroque
\clef bass
\time 3/1
\key do \major
| % mes.1
do1 do r1
| % mes.2
do\breve si1
| % mes.3
\hemiola { do1 sol\breve }
| % mes.4
do\breve
}