;CopyFromAbove
(let ((end (d-GetEndTick)))
    (if (eqv? (d-GetStartTick) 0)
        (begin
             (if (and (d-MoveToStaffUp) (not (Music?)))
                (begin
                    (d-SetMark)
                    (while  (and (not (Music?)) (d-CursorRight) (not (Appending?))))
                    (if (Music?)
                        (d-CursorLeft))
                    (d-Copy)
                    (d-MoveToStaffDown)
                    (d-Paste)))))
    (if (not end)
    	(set! end 0))
    (d-PushPosition)
    (if (and (d-MoveToStaffUp) (d-GetStartTick))
	    (begin
	    	   (while (and (< (d-GetStartTick) end) (d-MoveCursorRight) (not (Appending?))))
	    	   (if (Appending?) (d-MoveCursorLeft))
	    	   (if (and (= (d-GetStartTick) end) (not (Music?)))
	    	   	(begin
		            (d-SetMark)
		            (while (and (d-CursorRight) (not (Music?)) (not (Appending?))))
		            (d-CursorLeft)
		            (d-Copy)
		            (d-PopPosition)
		            (if (not (or (EmptyMeasure?) (Appending?))) (d-MoveCursorRight))
		            (d-Paste)
		            (d-MoveCursorRight))
                (d-PopPosition)))))