<?xml version="1.0"?>
<Denemo>
  <merge>
    <title>A Denemo Keymap</title>
    <author>AT, JRR, RTS</author>
    <map>
      <row>
        <after>InsertClef</after>
        <action>ClefChooser</action>
        <scheme>;;;;ClefChooser
(let ((choice "Bass"))
  (set! choice (d-GetOption  (string-append "Treble" stop "Alto" stop "Tenor" stop "Octava bassa" stop "Soprano" stop  "Drum" stop)))
    (cond
     ((boolean? choice)
      (d-WarningDialog "Operation cancelled"))
     ((equal? choice "Drum")
      (begin 
	;(d-CursorRight)
	(d-InitialClef "Bass")
	(d-DirectivePut-clef-override "DrumClef" DENEMO_OVERRIDE_LILYPOND)
	(d-DirectivePut-clef-postfix "DrumClef" "\\clef percussion\n ")
	(d-DirectivePut-clef-graphic "DrumClef" "DrumClef")
	(d-StaffProperties "midi_channel=9")
	(d-PushPosition)
	(d-GoToBeginning)
	(d-DirectivePut-standalone-postfix "MiddleCPosition" "\\set Staff.middleCPosition = #6")
	(d-PopPosition)
;;	(d-DirectivePut-voice-postfix "DrumClef"  "\\drummode ")
;;	(d-DirectivePut-voice-override "DrumClef" DENEMO_OVERRIDE_LILYPOND)
;;	(d-DirectivePut-staff-postfix "DrumClef" "&lt;&lt; { \\new DrumStaff\n")
;;	(d-DirectivePut-staff-override "DrumClef" DENEMO_OVERRIDE_LILYPOND)
	))
     (#t
      (if (d-CursorLeft)
	  (begin 
	    (d-CursorRight)
	    (d-InsertClef choice))
	  (begin
	    (d-CursorRight)
	    (d-InitialClef choice))))))
(d-RefreshDisplay)
</scheme>
        <label>Clef Chooser</label>
        <tooltip>Choose any sort of clef. If the cursor is at the start change initial clef, else insert chosen clef.</tooltip>
      </row>
    </map>
  </merge>
</Denemo>
