Getting precompiled code (e.g., quicklisp, quicklisp libraries, swank, own libraries) running again on recent Opusmodus versionsBy torstenanders
After updating to a recent Opusmodus version 1.3, I ran into some errors when loading code that had been loaded and compiled before, e.g., quicklisp, quicklisp libraries, swank (the interface that allows using Emacs Slime with Opusmodus), and my own Lisp libraries. The errors I saw were rather cryptic, like the following:
Error: The value "CL" is not of the expected type list.
While executing: (:internal ccl::operation-on-all-specs ccl::%define-package), in process Listener-1(7).
After exchanges with Janusz (thanks a lot for your help!) I learnt that the underlying Common Lisp version of Opusmodus had been upgraded to CCL version 1.12, and the format of compiled files (fasl files or dx64fsl files) of this version had changed.
So, in case you run into similar problems, these can be fixed simply by deleting all previously compiled files (which Lisp stores if they do not change to speed up the load process), so that the Lisp compiler has to compile them again. In the folder ~/.cache/common-lisp just delete any folders starting with ccl-, so that all compiled files in this directory are compiled again.
i would like to code a NAND gate with more then two input-items (as extension to AND etc...). here is a simple version of the NAND function with two inputs, but i don't know how to exapnd it to n-inputs without putting the the inputs to in a list (like lisp-internal AND / OR)...
i dont't want it:
(nand '(t t t nil)) but like to have
(nand t nil nil t t t)
when i get a solution for that i will code an XOR, NOR etc....
so the "problem" is: how to manage in DEFUN more then two inputs (don't work with &optional, i think) i tried it and failed)...
any ideas, lisp-nerds? 🙂 thanx! andré
;;; easy with a specific number of input-items - that works! (defun nand (a b) (not (and a b))) (nand t t) => nil (nand nil nil) => t (nand nil t) => t ;;; i like to have an input perhaps like that - with any number of input-items, like lisp's AND / OR (nand t t t t) (nand nil t t t nil t t t nil) ...
By Stephane Boussuge
Here's some few examples of use of the recently updated tonality-system.
(complete opmo score attached to this post.)
;; Utility function useful for using ;; bass note of chords/scales as root ;; in tonality-series. (defun get-lowest-chord-tone (chords) (do-verbose ("get-lowest-chord-tone") (integer-to-pitch (mapcar 'find-min (pitch-to-integer chords))) )) #| ;;; USAGE (setf chords '(d4f4a4 ab3d4eb4g4 f4eb3c5)) (get-lowest-chord-tone chords) |#
It is better now to see the tonality as kind of PCS (pitch Class Set).
If you would express them in pitch, it is easier to work on C base.
Something interesting if the fact tonality can now be sorted or not.
It will be reflected in the output of tonality-map.
;; Some tests (tonality-map '(d4e4f4g4a4b4) '(c4 d4 e4 f4 g4 a4 b4)) (tonality-map '(d4e4f4g4a4b4) '(c3 e4g4)) (tonality-map '(d4e4f4g4a4b4 :root d4) '(c3 e4g4)) (tonality-map '((0 2 3 5 7 9 10) :root d4) '(c3 e4g4)) (tonality-map '((0 2 3 5 7 9 10) :root d4 :closest 'down) '(c3 e4g4)) More extended test with use of bass note as root:
(setf row '(c4 e4 f4 b4 a4 bb4 cs4 gs4 fs4 g4 eb4 d4)) (setf modes1 (harmonic-progression '(0 1 2 3 4 5 6 7 8 9 10 11) row :step 1 :size 8 )) (setf mtv '((s c4 d4 e4 f4 g4 a4 b4 c5))) (setf test1 (tonality-map (mclist modes1) (gen-repeat 12 mtv))) (setf path1 (tonality-series modes1 :root (get-lowest-chord-tone modes1) ;:closest '(down) )) (setf test2 (tonality-map path1 (gen-repeat 12 mtv))) (setf mtv2 '((s c4 cs4 d4 ds4 e4 f4 fs4 g4))) (setf test3 (tonality-map (mclist modes1) (gen-repeat 12 mtv2))) (setf test4 (tonality-map path1 (gen-repeat 12 mtv2))) (setf path2 (tonality-series modes1 :root (get-lowest-chord-tone modes1) ;:closest '(down) :map '(step) )) (setf test5 (tonality-map path2 (gen-repeat 12 mtv))) (setf test6 (tonality-map path2 (gen-repeat 12 mtv2))) (setf path3 (tonality-series modes1 :root (get-lowest-chord-tone modes1) ;:closest '(down) :map '(step) :sort t )) (setf test7 (tonality-map path3 (gen-repeat 12 mtv2))) (setf test8 (tonality-map path3 (gen-repeat 12 mtv))) SB.