<?xml version="1.0"?>
<Denemo>
  <merge>
    <title>A Denemo Keymap</title>
    <author>AT, JRR, RTS</author>
    <map>
      <row>
        <after>SmallerStaff</after>
        <action>InstrumentName</action>
        <scheme>;;;;;;;;;;;;;InstrumentName
(let ((current "") (thematch "") (indent "0.0") (size 16.0))
  (set! current (d-DirectiveGet-staff-postfix "InstrumentName" ))
  (if (boolean? current)
      (set! current "Violin")
      (begin
	(set! thematch (string-match "\\\\set Staff.instrumentName = \"([^\"]*)\"" current))
	;;(display thematch)
	(if (regexp-match? thematch)
	    (set! current (match:substring thematch 1))
	    (set! current "myname"))))
  (set! current (d-GetUserInput "InstrumentName" "Give Instrument Name:" current))
  (d-DirectivePut-staff-display "InstrumentName" current)
  (d-DirectivePut-staff-override "InstrumentName"  DENEMO_OVERRIDE_GRAPHIC)
  (d-DirectivePut-staff-postfix "InstrumentName"  (string-append "\\set Staff.instrumentName = \"" current "\""))
 (set! size (/ (string-&gt;number (d-ScoreProperties "query=fontsize")) 10.0))
 (set! indent (d-DirectiveGet-score-prefix "ScoreIndent"))
  (if (boolean? indent)
      (set! indent "0.0"))
      (begin
	(set! thematch (string-match "\\layout \\{indent = ([-0-9.]+)" indent))
	;;(display thematch)
	(if (regexp-match? thematch)
	    (set! indent (match:substring thematch 1))))
  (set! indent (number-&gt;string (max (string-&gt;number indent) (* size (string-length current)))))
    (d-DirectivePut-score-prefix "ScoreIndent" (string-append "\\layout {indent = " indent "}\n"))
  (d-DirectivePut-score-override "ScoreIndent"	DENEMO_OVERRIDE_GRAPHIC)
  (d-DirectivePut-score-display "ScoreIndent" (string-append "indent=" indent))
 (d-RefreshDisplay))
</scheme>
        <label>Instrument Name</label>
        <tooltip>Print Instrument name before staff at start of score,</tooltip>
      </row>
    </map>
  </merge>
</Denemo>
