<?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 ""))
  (set! current (d-DirectiveGet-staff-postfix "InstrumentName" ))
  (if (boolean? current)
      (set! current "myname")
      (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-postfix "InstrumentName"  (string-append "\\set Staff.instrumentName = \"" current "\"")))
</scheme>
        <label>Instrument Name</label>
        <tooltip>Print Instrument name before staff at start of score,</tooltip>
      </row>
    </map>
  </merge>
</Denemo>
