Moving dynamics horizontally: Difference between revisions
Appearance
	
	
 Import snippet from LSR  | 
			
(No difference) 
 | 
Latest revision as of 22:37, 26 October 2025
Here are two functions to move dynamics easily. The first one moves the dynamics horizontally and drops / raises it closer to the staff if there's room. With the second one you can move the dynamics also vertically.
\version "2.24.0"
%% http://lsr.di.unimi.it/LSR/Item?id=469
%LSR This snippet was contributed by Risto Vääräniemi
dynamicsX = 
#(define-music-function (offset)(number?)
  #{
     \once \override DynamicText.X-offset = $offset
     \once \override DynamicLineSpanner.Y-offset = #0
  #})
dynamicsXY = 
#(define-music-function (offsetX offsetY)(number? number?)
  #{
     \once \override DynamicText.X-offset = $offsetX
     \once \override DynamicLineSpanner.Y-offset = $offsetY
  #})
{
   b'2\f \dynamicsX #-3 b'2\f \dynamicsXY #-3 #-6 b'2\f
}