<?xml version="1.0"?>
<Denemo>
  <merge>
    <title>A Denemo Keymap</title>
    <author>AT, JRR, RTS</author>
    <map>
      <row>
        <action>Anacrusis</action>
        <scheme>;;;;;;;;;;Anacrusis
(d-GoToBeginning)
(let ((duration (d-GetDurationInTicks)))
  (if (boolean? duration)
      (set! duration 0))
  (while (d-NextObjectInMeasure) 
	 (set! duration (+ duration (d-GetDurationInTicks))))
  (d-GoToBeginning)
  (set! duration (/ duration 12))
  (if (equal? 0 duration)
      (begin
	(d-WarningDialog "Put notes/rests in the first measure for the upbeat required\nThen issue this command"))
      (begin
	(d-DirectivePut-standalone-postfix "Anacrusis" (string-append "\\partial 128*" (number-&gt;string duration) " " ))
	(d-CursorLeft)
	(d-DirectivePut-standalone-override "Anacrusis" DENEMO_OVERRIDE_DYNAMIC)
	(d-DirectivePut-standalone-minpixels "Anacrusis" 60)
	(d-DirectivePut-standalone-display "Anacrusis" "Upbeat")
	(d-RefreshDisplay)
	(if (not (d-MeasureRight))
	    (begin
	      (d-AppendMeasure)
	      (d-MeasureRight))))))

       
</scheme>
        <label>Insert Anacrusis</label>
        <tooltip>Insert a LilyPond Directive to give an eighth note upbeat</tooltip>
      </row>
    </map>
  </merge>
</Denemo>
