<?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))
 (if InstrumentName::params
 	(set! current InstrumentName::params)
  	(begin
  		(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 name of instrument/voice/part\nfor current staff:") current))))
 (if current
 	(begin
  		(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 "\""))
  		(if (&gt; (string-length current) 0)
  			(d-StaffProperties (string-append "denemo_name=" current))
  			(d-StaffProperties "denemo_name=unnamed"))
 		(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-SetSaved #f))))
</scheme>
        <label>Instrument Name</label>
        <tooltip>Print Instrument name before staff at start of score,</tooltip>
      </row>
    </map>
  </merge>
</Denemo>
