Jump to content

Opusmodus commands don't work in Aquamacs


Recommended Posts

Hello!

 

The Opusmodus commands for Emacs that are listed in file "Slime in Opusmodus" don't work for me.

 

Written commands, like "(circle-pitch-plot 'bartok :point-radius 4)", work ok, a window opens from Opusmodus and shows the plot.

But not the ?alqsv-commands, that are shown in mini buffer, but don't do anything, except command "?", that shows commands listed.

 

I'm using Aquamacs 3.5 and my Clozure version is 1.12. Is this setup ok?

 

Best wishes,

Henry

 

Link to post
Share on other sites

There is nothing to do for ?alqsv-commands with a plot. It is for snippets. The command '? explain what each symbol do.

 

Quote

I'm using Aquamacs 3.5 and my Clozure version is 1.12. Is this setup ok?

Is OK. Have you try Emacs.

Link to post
Share on other sites

I cannot answer for the builtin Opusmodus Slime functionality, but I developed something similar some time ago on my own, which works in Aquamacs for me. Try copying the Emacs Lisp code below into your Emacs initialisation file (e.g., ~/.emacs), start Aquamacs again and open a Lisp file.

 

The code below adds to Emacs buffers in Lisp mode an Opusmodus menu with some standard commands like for previewing a snippet, stopping the playback etc. together with shortcuts shown in the menu. 

 

It is all a bit hacky, but works for me and perhaps also for others 😉  It should also be easy to add menu items and keyboard shortcuts for any other commands (like plotting) that work from Lisp. 

 


;; Custom function for previewing Openmusic snippets etc
(defun slime-eval-and-preview-opmo-snippet-before-point ()
  "Evaluate the Openmusic snippet (an expression) preceding point and preview that snippet."
  (interactive)
  (let* ((score (slime-last-expression))
	 ;; wrap call to preview-score around the score before point
	 (full-expr (concat "(preview-score (list :snippet " score "))")))
    (slime-interactive-eval full-expr)))

(defun slime-eval-and-preview-opmo-score-before-point ()
  "Evaluate the score (an expression in the tot score format) preceding point and preview that score (notation and playback)."
  (interactive)
  (let* ((score (slime-last-expression))
	 ;; wrap call to preview-score around the score before point
	 (full-expr (concat "(preview-score " score ")")))
    (slime-interactive-eval full-expr)))

(defun slime-stop-opmo-playback ()
  "Stop the currently playing Openmusic sound playback."
  (interactive)
  (slime-interactive-eval "(sequencer:sequencer-stop *audition-sequencer*)"))

(defun slime-opmo-midi-playback ()
  "(Re-)play the last Opusmodus score with a separate MIDI playback window."
  (interactive)
  (slime-interactive-eval "(display-midi *last-score* :display :window)"))

(add-hook 'lisp-mode-hook
	  (lambda ()
	    (local-set-key (kbd "<A-f2>") #'slime-eval-and-preview-opmo-snippet-before-point)
	    (local-set-key (kbd "<A-f3>") #'slime-eval-and-preview-opmo-score-before-point)
	    (local-set-key (kbd "<A-f4>") #'slime-opmo-midi-playback)
	    (local-set-key (kbd "<A-f1>") #'slime-stop-opmo-playback)
	    ))


;; Creating a new "Opusmodus" menu in the menu bar to the right of "Lisp" menu.
;; This new menu is only shown when in lisp-mode
(define-key-after
  lisp-mode-map
  [menu-bar opusmodus]
  (cons "Opusmodus" (make-sparse-keymap "hoot hoot"))
  'lisp)


;; Creating a menu item, under the menu by the id “[menu-bar opusmodus]”
(define-key
  lisp-mode-map
  [menu-bar opusmodus preview-score]
  '("Preview score cmd-f3" . slime-eval-and-preview-opmo-score-before-point))

(define-key
  lisp-mode-map
  [menu-bar opusmodus preview-snippet]
  '("Preview snippet cmd-f2" . slime-eval-and-preview-opmo-snippet-before-point))

(define-key
  lisp-mode-map
  [menu-bar opusmodus stop-playback]
  '("Stop playback cmd-f1" . slime-stop-opmo-playback))

(define-key
  lisp-mode-map
  [menu-bar opusmodus replay-score]
  '("(Re)play last score cmd-f4" . slime-opmo-midi-playback))

 

Link to post
Share on other sites

Sorry, I was a little bit unclear. What I tried to say was that the Audition and Notation snippets don't work with the ?alqsv-commands. Plotting was an example of something that works.

 

Henry

Link to post
Share on other sites

I can confirm that audition and notation of snippets unfortunately does not work for me either with the builtin Slime in Opusmodus. E.g., I am trying to place the cursor behind an Opusmodus function call an execute the relevant short cut (e.g., C-c o a), but nothing happens.  C-c o ? seems to work, though.

 

Anyway, my own Slime interface works, at least for me...

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy