[CM] midishare: output-stop

taube@uiuc.edu taube@uiuc.edu
Tue, 2 Mar 2004 19:35:41 -0600

>(midi-close) works. but it would be nice to have a keystroke. ist there 
>a way to define them in openmcl?

Assuming that (midi-close) works then the following two functions might do what you want. The first function defines a midi-hush function for openmcl that closes and then reopens your midishare connection.

the second bit of code defines a keystroke command (C-x C-;) in emacs that invokes it when you are working in a Lisp mode buffer.

;;; add to your cminit.lisp file

(defun midi-hush (&optional ms)
  (let ((s (if (not ms)
             (find-object "midi.port" nil)
             (if (stringp ms)
               (find-object ms nil)
    (when (typep s 'midishare-stream)
      (close-io s ':force)
      (open-io s t))

;;; add to your .emacs or .xemacs/init.el file

(defun midi-hush ()
  (comint-send-string inferior-lisp-buffer

(define-key lisp-mode-map [(control ?x) (control 59)]