<?xml version="1.0"?>
<Denemo>
  <merge>
    <title>A Denemo Keymap</title>
    <author>AT, JRR, RTS</author>
    <map>
      <row>
        <action>StaffAlias</action>
        <scheme>;Give staff an alias-by DRW.  Useful for voices which change staff.
(let ((Name "Upper")(Dummy #f) (ListOfNames '() ) (Go? #t))

( define (GetNames) 
	(begin
		(set! Dummy  (d-DirectiveGet-staff-display  "StaffAlias"))

		(if Dummy (set! ListOfNames (append  ListOfNames  (list Dummy)  ) ))
		(if (d-MoveToStaffDown) (GetNames))
	)
)

(set! Name (d-GetOption (string-append "Upper" stop "Lower" stop "Other" stop)) )
(if (equal? Name "Other") (set! Name (d-GetUserInput "Set staff alias" "Enter staff alias:" "Other")))

(d-PushPosition)
(while (d-MoveToStaffUp))
(GetNames)
(d-PopPosition)

(if (member Name  ListOfNames )  
	(begin
		(d-InfoDialog "That name already exists.  Rerun this command with another choice.")
		(set! Go? #f)
	)
)
(if Go? 
	(begin
		(d-DirectivePut-staff-prefix "StaffAlias" (string-append "=\"" Name "\"" )   )
		(d-DirectivePut-staff-display "StaffAlias" Name )
		(d-DirectivePut-staff-midibytes "StaffAlias" "")
		(d-RefreshDisplay)
	)
)
);let</scheme>
        <label>Designate Alias</label>
        <tooltip>Sets the alias of the staff.  Used when a voice changes staffs.</tooltip>
      </row>
    </map>
  </merge>
</Denemo>
