Skip to content
View in the app

A better way to browse. Learn more.

Opusmodus Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Opusmodus commands don't work in Aquamacs

Featured Replies

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

 

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.

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))

 

  • Author

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

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...

  • Author

Ok, I'll give it a try. It seems to have all I need. Thanks for help! 😃

 

Henry

  • 3 months later...

I just noted that the code I shared above depends on other definitions in my library (e.g., the function preview-score). Below is an update that instead uses only builtin Opusmodus functions. Holler in case this is not working for you, as the code on my machine is a bit different, and I did not test the code below... (specifically, the version below only works for the scores with instruments from the ps set gm, while my own code is more flexible, but then again depends on other custom definitions).

 

 

;; Emacs lisp code: put into your Emacs init file, e.g., ~/.emacs

;; 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))
	 (full-expr (concat "(ps 'gm (list :treble " score "))"))
	 )
    ;; (print (concat "debug: " full-expr))
    (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))
	 (full-expr (concat "(ps 'gm " 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))

 

Create an account or sign in to comment


© 2014-2026 Opusmodus™ Ltd. All rights reserved.
Product features, specifications, system requirements and availability are subject to change without notice.
Opusmodus, the Opusmodus logo, and other Opusmodus trademarks are either registered trademarks or trademarks of Opusmodus Ltd.
All other trademarks contained herein are the property of their respective owners.

Powered by Invision Community

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.