<?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 "Bass" stop "Alto" stop "Tenor" stop "Octava bassa" stop "Soprano" stop "Drum" stop)))
(cond
((boolean? choice) () )
((equal? choice "Drum")
(begin
;(d-MoveCursorRight)
(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-MoveToBeginning)
(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-MoveCursorLeft)
(begin
(d-MoveCursorRight)
(d-InsertClef choice))
(begin
(if (equal? (d-DirectiveGetTag-clef ) "DrumClef" ) (d-DirectiveDelete-clef "DrumClef") )
(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>
