All Activity

This stream auto-updates   

  1. Last week
  2. great... that's a smart solution :-) simpler then mine ...i didn't know how to set "-1" outside the FUNCTION without DEFSTRUCT thanx!! i like it when the program tells me that it has done the job... so i coded a little extension: (let ((i -1)) (defun next (liste &key (stop 'nil) (one-cycle 'nil)) (if (equal stop 't) (if (< i (1- (length liste))) (nth (mod (incf i) (length liste)) liste) (if (equal one-cycle 'nil) (progn (setf i -1) 'nil) 'nil)) (nth (mod (incf i) (length liste)) liste)))) (next '(a b c d e f)) (next '(a b c d e f) :stop t :one-cycle nil) ;; shows a NIL after last value, then starts again (next '(a b c d e f) :stop t :one-cycle t) ;; shwows only NILs after the last value
  3. (let ((i -1)) (defun next (liste) (nth (mod (incf i) (length liste)) liste))) ;;; (next '(a b c d e f)) SB.
  4. is there another way to code such a function/idea? this is (at the moment) a "theoretically function"... no concret use - l'art pour l'art :-) thanx for smarter LISP-code-IDEAS! andré ;;; evaluate PROGN (as a reset) (progn (defstruct counter n) (defvar cnt) (setf cnt (make-counter :n -1)) (defun read-list-in-steps (alist) (nth (setf (counter-n cnt) (1+ (counter-n cnt))) alist))) ;;; evaluate a view times, so one value after the other will be in the output ;;; you have to evaluate the progn-seq before every new start!!! (read-list-in-steps '(1 2 3 4 5 6)) (read-list-in-steps '(c4 f4 e4 f4 g5))
  5. Thanks for the quick and thorough answer! I'll take a look at the documents you suggested.
  6. The notation in your examples are correct. The 23w length value is a tuplet and is a 23rd part of the whole note. The best thing I would suggest is to spend some time to read the introduction to OMN. This way you will progress without to much frustration. Experimentation is the way to learn but the basics are paramount. Here are the documents I suggest to read: Introduction to OMN 1st Element - Length 2nd Element - Pitch 3rd Element - Velocity 4th Element - Attribute (Articulation) The Length, Pitch and Velocity are essentials to understand. This will give you a good basis to play, explore and experiment with Opusmodus. Next, check the 'Snippet.opmo' examples. This document illustrates the omn grammar. After that I would go through the Howto documentation. All this will take no more than a few hours. All the document you’ll find in the Utilities/Documentation panel on the right - second icon. As for the prime numbers - simple example. First we generate a few prime numbers: (setf pnum (primes-to 10)) => (2 3 5 7) Now the duration with our prime numbers: (setf len (gen-length pnum '1/16)) => (1/8 3/16 5/16 7/16) And a few more: (setf my-lengths (gen-eval 12 '(rnd-order len))) => ((5/16 1/8 3/16 7/16) (1/8 5/16 3/16 7/16) (5/16 3/16 1/8 7/16) (1/8 3/16 5/16 7/16) (3/16 5/16 1/8 7/16) (7/16 5/16 3/16 1/8) (7/16 3/16 5/16 1/8) (5/16 7/16 3/16 1/8) (3/16 1/8 5/16 7/16) (1/8 3/16 5/16 7/16) (5/16 7/16 3/16 1/8) (3/16 5/16 7/16 1/8)) Now we generate a 12tone row (at random): (setf my-pitches (rnd-row :type :pitch)) => (c4 b4 bb4 fs4 f4 d4 g4 cs4 eb4 a4 e4 gs4) The MAKE-OMN funtion allows us to put all our parameters together: (setf my-mat (make-omn :length my-lengths :pitch my-pitches)) => ((qs c4 e. eb4 e e4 q.. a4) (e. f4 q.. fs4 qs b4 e g4) (q.. d4 qs cs4 e gs4 e. bb4) (e. c4 q.. eb4 qs e4 e a4) (e f4 q.. fs4 qs b4 e. g4) (e d4 q.. cs4 e. gs4 qs bb4) (e c4 qs eb4 e. e4 q.. a4) (e f4 qs fs4 q.. b4 e. g4) (e. d4 qs cs4 q.. gs4 e bb4) (q.. c4 qs eb4 e e4 e. a4) (e f4 e. fs4 qs b4 q.. g4) (q.. d4 qs cs4 e gs4 e. bb4)) Here we use the TONALITY-MAP function to force the minor scale on our material. (tonality-map '(minor :map step) my-mat) => ((qs c4 e. eb4 e f4 q.. bb4) (e. f4 q.. qs bb4 e g4) (q.. d4 qs e gs4 e. bb4) (e. c4 q.. eb4 qs f4 e gs4) (e f4 q.. qs bb4 e. g4) (e d4 q.. e. gs4 qs bb4) (e c4 qs eb4 e. q.. bb4) (e f4 qs q.. bb4 e. g4) (e. d4 qs q.. gs4 e bb4) (q.. c4 qs eb4 e e. gs4) (e f4 e. qs c5 q.. g4) (q.. d4 qs e gs4 e. bb4)) What about lessons with Stephane Boussuge, here is the link to the request: https://opusmodus.com/lessons.html Best, JP
  7. Thanks. For completeness, below is a link to another rnd-pick variant with probability support. Best, Torsten
  8. Hello! (this is my first post so bear with me..) I was experimenting around with Opusmodus and tried to apply various odd-divisions (particularly prime-numbers interest me) to some notes and lengths to audition some of them. I've been having some problems with this. The error I get most of the time is: "malformed time-signature." Is there a way to avoid this? 1. I wrote: ((h_23w c3)(h c4)) - which results in the aforementioned error when auditioning - notation is usually more or less correct. 2. I wrote ((12/23 c3)(1/2 c4)) - error again 3. I wrote ((h c3 tie)(23w c3)(h c4)) - expressing it like this allows me to audition it, but when I try to write something which repeats the oddity, then it results in the error again. I tried to repeat the snippet a few times and put the new structure inside parenthesis and then OM outputs the error again. Something like this: (((h c3 tie)(23w c3)(h c4))((h c3 tie)(23w c3)(h c4))((h c3 tie)(23w c3)(h c4))) Example: the first (1) example outputs the malformed time-signature in the listener as follows: ((23/2 23/2 2) 46 1) Something tells me that it somehow interprets my writing wrong. I'm very new to working like this so I guess it could be just something very obvious that I overlooked.
  9. a "rnd-pick" that works with different "input-formats"... so it's flexible to use... for many (not all) input-cases ;;; subfunction (defun weighted-random (list) (loop for item in list with rand-num = (random (loop for x in list sum (second x))) for add = (second item) then (+ add (second item)) when (< rand-num add) return (first item))) ;;; mainfunction (defun rnd-pick* (alist) (if (and (listp (first alist)) (floatp (second (first alist)))) (weighted-random alist) (rnd-pick alist))) ;;; examples ;;; without weight (rnd-pick* '(1 2 3 4 5)) (rnd-pick* '((1 2 3 4) (3 4 5 7 3) (75 392 2))) ;;; with weight (rnd-pick* '((2 0.2) (3 0.4) (4 0.2))) (rnd-pick* '(((2 3 4 5) 0.2) ((8 796 5) 0.4))) (rnd-pick* '(((1 3) 0.2) (3 0.3)))
  10. Some changes to the Text & Lyrics tools. If you used one of them please check the new functions. The text-to-pitch function is replaced with TEXT-MAP with more options and functionality. text-map map text &key flat rnd-order otherwise seed [Function] Arguments and Values: map a list of lists (<letter><symbol>) text a string, a string list list of a list of letters. flat T or NIL. The default is T. rnd-order T or NIL. The default is NIL. otherwise Nil, symbol or list of symbols. The default is NIL. seed an integer - ensure the same result each time the code is evaluated. The default is NIL. Description: This function converts a body of text into any symbol (parameter). It’s a further way to use words ("text") or a list of letters to create parametric material. Notice, that the function creates lists for each word and that punctuation is ignored. In the following examples we will map a text to integers. First we create a map: (defparameter *map-integer1* '(((a à á â ã ä å æ ą) 0) (b 1) ((c ç ć) 2) (d 3) ((e è é ê ë ę) 4) (f 5) (g 6) (h 7) ((i ì î ï) 8) (j 9) (k 10) ((l ł) 11) (m 12) ((n ñ ń) 13) ((o ò ó ô õ ö) 14) (p 15) (q 16) (r 17) ((s ś) 18) (t 19) ((u ù ú û ü) 20) (v 21) (w 22) (x 23) ((y ý ÿ) 24) ((z ż ź) 25))) (setf text '("To be, or not to be, that is the question")) (text-map *map-integer1* text) => ((19 14) (1 4) (14 17) (13 14 19) (19 14) (1 4) (19 7 0 19) (8 18) (19 7 4) (16 20 4 18 19 8 14 13)) In the following map each letter is mapped into a list of two integer values. The letter (a à á â ã ä å æ ą) is mapped to 0 and -12. Every time the letter (a à á â ã ä å æ ą) is processed, 0 or -12 integer is picked at random. (defparameter *map-integer2* '(((a à á â ã ä å æ ą) (0 -12)) (b (1 -1)) ((c ç ć) (2 -2)) (d (3 -3)) ((e è é ê ë ę) (4 -4)) (f (5 -5)) (g (6 -6)) (h (7 -7)) ((i ì î ï) (8 -8)) (j (9 -9)) (k (10 -10)) ((l ł) (11 -11)) (m (12 -12)) ((n ñ ń) (13 -13)) ((o ò ó ô õ ö) (14 -14)) (p (15 -15)) (q (16 -16)) (r (17 -14)) ((s ś) (18 -18)) (t (19 -19)) ((u ù ú û ü) (20 -20)) (v (21 -21)) (w (22 -22)) (x (23 -23)) ((y ý ÿ) (24 -24)) ((z ż ź) (25 -25)))) (text-map *map-integer2* text) => ((19 -14) (-1 -4) (14 17) (-13 -14 -19) (-19 -14) (1 4) (19 7 0 -19) (-8 18) (19 -7 -4) (-16 20 -4 -18 19 8 -14 -13)) (text-map *map-integer2* text) => ((-19 14) (1 -4) (-14 17) (13 14 19) (19 14) (1 4) (19 7 0 19) (8 18) (19 -7 -4) (16 20 4 18 -19 8 -14 -13)) A seed will ensure the same result each time the code is evaluated: (text-map *map-integer2* text :seed 48) => ((19 -14) (1 -4) (14 -14) (-13 -14 19) (19 -14) (-1 4) (19 7 -12 -19) (8 18) (-19 -7 4) (16 -20 -4 18 19 -8 -14 -13)) In the following examples we map a text to lengths. If a letter is mapped to a nested list ((e e. s)) then the entire list is selected. (defparameter *map-length* '(((a à á â ã ä å æ ą) ((s s s))) (b ((s e s))) ((c ç ć) ((e s s))) (d ((s s e))) ((e è é ê ë ę) ((e e. s))) (f ((q e. s))) (g ((e. e s))) (h ((q s s))) ((i ì î ï) ((s e. e))) (j ((s e. e))) (k ((s s q))) ((l ł) ((e s e.))) (m ((e e e))) ((n ñ ń) ((e q e))) ((o ò ó ô õ ö) ((q e e))) (p ((e e q))) (q ((q q. e))) (r ((h q. e))) ((s ś) ((q e q.))) (t ((h e e))) ((u ù ú û ü) ((e q. q))) (v ((q. e h))) (w ((e e h))) (x ((q e q.))) ((y ý ÿ) ((q q q))) ((z ż ź) ((q h q))))) (text-map *map-length* text) => ((h e e q e e) (s e s e e. s) (q e e h q. e) (e q e q e e h e e) (h e e q e e) (s e s e e. s) (h e e q s s s s s h e e) (s e. e q e q.) (h e e q s s e e. s) (q q. e e q. q e e. s q e q. h e e s e. e q e e e q e)) (text-map *map-length* text :flat nil) => ((h e e) (q e e) (s e s) (e e. s) (q e e) (h q. e) (e q e) (q e e) (h e e) (h e e) (q e e) (s e s) (e e. s) (h e e) (q s s) (s s s) (h e e) (s e. e) (q e q.) (h e e) (q s s) (e e. s) (q q. e) (e q. q) (e e. s) (q e q.) (h e e) (s e. e) (q e e) (e q e)) With the rnd-order option we can randomise the order of the elements in the list: (text-map *map-length* text :flat nil :rnd-order t) => ((h e e) (q e e) (s e s) (s e. e) (e e q) (h e q.) (e q e) (e q e) (h e e) (h e e) (e q e) (s e s) (s e e.) (e h e) (q s s) (s s s) (e e h) (e. e s) (q. q e) (e h e) (s q s) (s e e.) (q. e q) (q. e q) (s e e.) (q q. e) (e h e) (s e e.) (e q e) (e e q)) In the following examples we map text to pitches. First we create a simple map with a letter mapped to a single pitch: (defparameter *map-pitch1* '(((a à á â ã ä å æ ą) c3) (b cs3) ((c ç ć) d3) (d eb3) ((e è é ê ë ę) e3) (f f3) (g fs3) (h g3) ((i ì î ï) gs3) (j a4) (k bb3) ((l ł) b3) (m c4) ((n ñ ń) cs4) ((o ò ó ô õ ö) d4) (p eb4) (q e4) (r f4) ((s ś) fs4) (t g4) ((u ù ú û ü) gs4) (v a4) (w bb4) (x b4) ((y ý ÿ) c5) ((z ż ź) cs5))) (text-map *map-pitch1* text) => ((g4 d4) (cs3 e3) (d4 f4) (cs4 d4 g4) (g4 d4) (cs3 e3) (g4 g3 c3 g4) (gs3 fs4) (g4 g3 e3) (e4 gs4 e3 fs4 g4 gs3 d4 cs4)) Here we map a letter to a list of two pitches: (defparameter *map-pitch2* '(((a à á â ã ä å æ ą) (c4 c3)) (b (cs4 b3)) ((c ç ć) (d4 bb3)) (d (eb4 a3)) ((e è é ê ë ę) (e4 gs3)) (f (f4 g3)) (g (fs4 fs3)) (h (g4 f3)) ((i ì î ï) (gs4 e3)) (j (a4 eb3)) (k (bb4 d3)) ((l ł) (b4 cs3)) (m (c5 c3)) ((n ñ ń) (cs5 b2)) ((o ò ó ô õ ö) (d5 bb2)) (p (eb5 a2)) (q (e5 gs2)) (r (f5 g2)) ((s ś) (fs5 fs2)) (t (g5 f2)) ((u ù ú û ü) (gs5 e2)) (v (a5 eb2)) (w (bb5 d2)) (x (b5 cs2)) ((y ý ÿ) (c6 c2)) ((z ż ź) (cs6 b1)))) (text-map *map-pitch2* text) => ((g5 bb2) (b3 e4) (bb2 f5) (b2 d5 f2) (f2 d5) (b3 gs3) (f2 f3 c4 f2) (gs4 fs5) (g5 g4 gs3) (gs2 gs5 gs3 fs2 f2 gs4 bb2 cs5)) Example with a velocity map: (defparameter *map-velocity* '(((a à á â ã ä å æ ą) ppp) (b ppp) ((c ç ć) ppp) (d pp) ((e è é ê ë ę) pp) (f pp) (g p) (h p) ((i ì î ï) p) (j mp) (k mp) ((l ł) mp) (m mf) ((n ñ ń) mf) ((o ò ó ô õ ö) mf) (p f) (q f) (r f) ((s ś) ff) (t ff) ((u ù ú û ü) ff) (v fff) (w fff) (x fff) ((y ý ÿ) ffff) ((z ż ź) ffff))) (text-map *map-velocity* '(o p u s m o d u s)) => (mf f ff ff mf mf pp ff ff) Example with binary map: (defparameter *map-binary* '(((a à á â ã ä å æ ą) ((1))) (b ((1 0))) ((c ç ć) ((1 1))) (d ((1 0 0))) ((e è é ê ë ę) ((1 0 1))) (f ((1 1 0))) (g ((1 1 1))) (h ((1 0 0 0))) ((i ì î ï) ((1 0 0 1))) (j ((1 0 1 0))) (k ((1 0 1 1))) ((l ł) ((1 1 0 0))) (m ((1 1 0 1))) ((n ñ ń) ((1 1 1 0))) ((o ò ó ô õ ö) ((1 1 1 1))) (p ((1 0 0 0 0))) (q ((1 0 0 0 1))) (r ((1 0 0 1 0))) ((s ś) ((1 0 0 1 1))) (t ((1 0 1 0 0))) ((u ù ú û ü) ((1 0 1 0 1))) (v ((1 0 1 1 0))) (w ((1 0 1 1 1))) (x ((1 1 0 0 0))) ((y ý ÿ) ((1 1 0 0 1))) ((z ż ź) ((1 1 0 1 0))))) (text-map *map-binary* '(o p u s m o d u s)) => ((1 1 1 1) (1 0 0 0 0) (1 0 1 0 1) (1 0 0 1 1) (1 1 0 1) (1 1 1 1) (1 0 0) (1 0 1 0 1) (1 0 0 1 1)) Example with otherwise option. (setf map4 '((e e3) (f f3) (g fs3) (h g3) (i gs3) (j a4) (k bb3) (l b3) (m c4) (n cs4) (o d4))) (text-map map4 '(o p u s m o d u s)) => (d4 c4 d4) The result of the expression above is not equal to the length of the (o p u s m o d u s) list because the letters d, p, s and u are not in the map. Use the otherwise option to get the same count: (text-map map4 '(o p u s m o d u s) :otherwise '((eb4e5) (f3fs4))) => (d4 (eb4e5) (f3fs4) (eb4e5) c4 d4 (eb4e5) (f3fs4) (f3fs4)) In the following examples our maps are created algorithmically: (setf map (mapcar 'list (make-alphabet) (integer-to-pitch (gen-integer-step 0 26 '(1 -2 3 1))))) => ((a c4) (b cs4) (c b3) (d d4) (e eb4) (f e4) (g d4) (h f4) (i fs4) (j g4) (k f4) (l gs4) (m a4) (n bb4) (o gs4) (p b4) (q c5) (r cs5) (s b4) (t d5) (u eb5) (v e5) (w d5) (x f5) (y fs5) (z g5)) (text-map map text) => ((d5 gs4) (cs4 eb4) (gs4 cs5) (bb4 gs4 d5) (d5 gs4) (cs4 eb4) (d5 f4 c4 d5) (fs4 b4) (d5 f4 eb4) (c5 eb5 eb4 b4 d5 fs4 gs4 bb4)) (setf map2 (mapcar 'list (make-alphabet) (mapcar 'list (integer-to-pitch (gen-integer-step 0 26 '(1 -2 3 1))) (integer-to-pitch (gen-integer-step -6 26 '(1 -2 3 1)))))) => ((a (c4 fs3)) (b (cs4 g3)) (c (b3 f3)) (d (d4 gs3)) (e (eb4 a3)) (f (e4 bb3)) (g (d4 gs3)) (h (f4 b3)) (i (fs4 c4)) (j (g4 cs4)) (k (f4 b3)) (l (gs4 d4)) (m (a4 eb4)) (n (bb4 e4)) (o (gs4 d4)) (p (b4 f4)) (q (c5 fs4)) (r (cs5 g4)) (s (b4 f4)) (t (d5 gs4)) (u (eb5 a4)) (v (e5 bb4)) (w (d5 gs4)) (x (f5 b4)) (y (fs5 c5)) (z (g5 cs5))) (text-map map2 text :seed 63) => ((d5 d4) (g3 a3) (d4 cs5) (bb4 gs4 d5) (d5 d4) (g3 a3) (d5 b3 c4 d5) (c4 f4) (d5 f4 eb4) (c5 eb5 eb4 b4 d5 c4 gs4 bb4)) In the next example we map a group of letters to a group of pitches. Example: a = (c4 cs4 d4) b = (c4 cs4 d4) and c = (c4 cs4 d4) etc... (setf map3 (mapcar 'list (gen-divide 3 (make-alphabet)) (integer-to-pitch (gen-divide 3 (gen-integer 26))))) => (((a b c) (c4 cs4 d4)) ((d e f) (eb4 e4 f4)) ((g h i) (fs4 g4 gs4)) ((j k l) (a4 bb4 b4)) ((m n o) (c5 cs5 d5)) ((p q r) (eb5 e5 f5)) ((s t u) (fs5 g5 gs5)) ((v w x) (a5 bb5 b5)) ((y z) (c6 cs6 d6))) (text-map map3 text) => ((g5 c5) (cs4 f4) (c5 f5) (cs5 d5 g5) (gs5 d5) (c4 f4) (fs5 gs4 d4 g5) (g4 fs5) (gs5 g4 f4) (e5 gs5 f4 fs5 g5 gs4 c5 d5)) => ((gs5 c5) (c4 e4) (c5 eb5) (c5 c5 g5) (gs5 c5) (c4 e4) (g5 gs4 cs4 fs5) (gs4 fs5) (gs5 fs4 e4) (eb5 gs5 eb4 fs5 gs5 fs4 cs5 c5)) => . . . Best wishes to all, JP
  11. Great solution to keep things simple!
  12. not the same number of pitches/rhythms, like phase-shifted
  13. ;;; SWAPS THE POSITIONS SYMMETRICALLY AND RANDOMIZED ;;; n => number of generations, output: last gen or all gens... ;;; new-version works also for symmetrical-sequences! (special cas) (defun rnd-symmetrical-position-swap (n liste &key (out 'all)) (let ((n1) (n2)) (progn (setf liste (loop repeat n do (setf n1 (random (1- (list-length-divide liste))) n2 (random (1- (list-length-divide liste)))) collect (progn (setf liste (position-swap (list (list n1 n2) (list (- (1- (length liste)) n1) (- (1- (length liste)) n2))) liste))))) (cond ((equal out 'last) (car (last liste))) ((equal out 'all) (append liste)))))) (rnd-symmetrical-position-swap 2 '(1 2 3 4 3 2 1) :out 'last) (rnd-symmetrical-position-swap 5 '(1 2 3 4 5 6) :out 'last) (rnd-symmetrical-position-swap 2 '(a b c d e f g h) :out 'all)
  14. ;;; ----------------------------------------------------------------------------------------------- ;;; A QUASI-UNISONO by proportional length-differences ;;; SAME PITCHES IN ALL VOICES INCLUDING START/END-PITCH ;;; ----------------------------------------------------------------------------------------------- ;;; a random-pitch-seq (rnd-walk) ;;; ;;; immediate-pitch-repetitions are building the rhythm ;;; ;;; with MODIFY-PROPORTIONS i'm generating "proportional variants" of this rhythm, in this example ;;; by 16 generations -> then i take the generations 1, 8, and 15 for each voice ;;; ;;; by "(filter-repeat 1 sequence)" i swallow the immediate-pitch-repetitions for correct ;;; of PITCH- and RHYTHM-phases ;;; ;;; ----------------------------------------------------------------------------------------------- ;;; FUNCTION (defun modify-proportions (n prop-list &key (style 'sharpen)) (let ((rest-pos (loop for i in prop-list for cnt = 0 then (incf cnt) when (< i 0) collect cnt)) (prop-list (abs! prop-list)) (liste)) (progn (setf liste (append (list prop-list) (loop repeat n when (or (= (length (find-above 1 prop-list)) 1) (= (length (find-unique prop-list)) 1)) collect prop-list else collect (setf prop-list (loop for i in prop-list for cnt = 0 then (incf cnt) collect (cond ((= cnt (position (find-closest 2 (find-above 1 prop-list)) prop-list)) (if (equal style 'sharpen) (1- i) (1+ i))) ((= cnt (position (find-max prop-list) prop-list)) (if (equal style 'sharpen) (1+ i) (1- i))) (t i))))))) (loop for i in liste collect (loop for k in i for cnt = 0 then (incf cnt) when (memberp cnt rest-pos) collect (* -1 k) else collect k))))) ;;; ----------------------------------------------------------------------------------------------- ;;; GENERATING SCORE (setf sequence (gen-walk 100 :step '(0 0 0 0 0 0 0 1 2) :start 'c5)) (setf rhy 1/32) ;;; ----------------------------------------------------------------------------------------------- (def-score quasi-unisono (:title "quasi-unisono" :key-signature 'atonal :time-signature '(4 4) :tempo 90) (instr1 :omn (make-omn :length (gen-length (nth 1 (modify-proportions 16 (count-repeat sequence) :style 'sharpen)) rhy) :pitch (filter-repeat 1 sequence)) :channel 1 :port 0 :sound 'gm) (instr2 :omn (make-omn :length (gen-length (nth 8 (modify-proportions 16 (count-repeat sequence) :style 'sharpen)) rhy) :pitch (filter-repeat 1 sequence)) :channel 2 :port 0 :sound 'gm) (instr3 :omn (make-omn :length (gen-length (nth 15 (modify-proportions 16 (count-repeat sequence) :style 'sharpen)) rhy) :pitch (filter-repeat 1 sequence)) :channel 3 :port 0 :sound 'gm)) there is no BUG when i work without "omn-to-time-signature", but is also not necessary!
  15. Sorry -- this is really about single-nested alternatives for rnd-pick, not a double nested lists. Torsten
  16. Thanks! Torsten
  17. Great Tortsten and very useful !! Thank you for this function !! Stéphane
  18. This is not a trivial thing to do because the function has to deal with so many cases. Please give me a REAL example of the use of double nested lists, especially with omn symbols.
  19. It is in our TODO list.
  20. Is there perhaps a way to specify different noteheads as articulation, or is this perhaps planned for the future? For example, diamond, triangle, cross, accent shape etc. are used in contemporary music, e.g., to indicate certain playing techniques. Just asking Thanks! Best, Torsten
  21. Sorry, you seemingly just misread my question These double nested lists are single-nested alternatives for rnd-pick, but rnd-pick by default removes the nesting. (rnd-pick '(((h q) (h)) ((h. q) (h)) ((h. h) (h)))) => (3/4 1/4 1/2) Stephane pointed out that this can be avoided by setting the argument :encode to nil, but if others later run into this problem again this is still not explained in the documentation. I would argue that the default behaviour should be to preserve the (single) nesting, should it not? > In OM we don't use double nested list. > what is the purpose of this. This was not my question here, but I actually do use further nesting levels occasionally to represent additional information for intermediate processing, e.g., for representing sections Best, Torsten
  22. Great, thanks! I somehow missed omn-replaced. Torsten
  23. I want to manually revise some score, but I would get lost in a very long list of OMN data. So, I automatically added bar number comments to the pretty printout -- helps me a lot :) (pprint-part '((s g1 ff gs1 p a1 ff b1) (s c2 mf cs2 ff d2 e2 mf) (e f2 p s fs2 ff g2 p a2) (s b2 mf e c3 s cs3 ff eb3) (s e3 mf f3 ff fs3 p a3 mf) (s bb3 ff b3 e c4 p s e4) (e e4 ff s f4 e s b4 p) (e b4 s s mf e fs5 ff) (s fs5 mf f5 p mf e cs6) (s cs6 c6 p e b5 mf s g6 ff) (s g6 p ff e f6 g6 mf) (s g6 g6 p ff e fs6) (s g6 mf p e s fs6) (s fs6 fs6 ff mf ff) (e fs6 p s ff fs6 fs6 mf) (s fs6 fs6 ff p f6) (s fs6 ff mf e e f6) (s f6 e fs6 fs6 p s f6) (s f6 mf fs6 fs6 p f6) (e f6 f6 ff s fs6 p f6 ff) (s f6 p e s s) (s f6 e mf p s ff) (s f6 mf p mf e ff) (s f6 p e s mf p) (s f6 ff e mf s e p) (e f6 s e ff mf) (s f6 p mf e6 ff f6 p) (s f6 ff e6 mf e eb6 p f6 mf) (s f6 e6 d6 f6) (s f6 e6 ff d6 e f6 p) (s f6 mf e6 ff cs6 f6 mf) (s f6 ff f6 cs6 mf f6 ff) (e f6 mf s s cs6 p fs6 mf) (s f6 ff e e6 p s bb5 mf f6) (s e6 p b5 f5 eb6) (s bb5 fs5 ff e cs5 p s a5 mf) (e e5 ff s c5 e gs4 mf s d5) (e bb4 s fs4 d4 e g4) (s e4 ff d4 b3 mf e eb4) (s cs4 p bb3 mf e gs3 p s c4 ff) (s a3 a3 mf e b3 ff gs3) (s bb3 c4 d4 e b3 mf) (s cs4 p eb4 mf e f4 p s eb4 ff) (s e4 fs4 gs4 p fs4 ff) (e g4 p s a4 mf bb4 a4) (s bb4 c5 cs5 p c5 mf) (s cs5 eb5 ff e e5 mf eb5 ff) (s e5 mf e fs5 g5 p s fs5 ff) (s g5 mf gs5 a5 p a5) (e bb5 ff b5 mf s c6 ff c6))) => ? ( ;; Bar 1 (s g1 ff gs1 p a1 ff b1) ;; Bar 2 (s c2 mf cs2 ff d2 e2 mf) ;; Bar 3 (e f2 p s fs2 ff g2 p a2) ;; Bar 4 (s b2 mf e c3 s cs3 ff eb3) ;; Bar 5 (s e3 mf f3 ff fs3 p a3 mf) ;; Bar 6 (s bb3 ff b3 e c4 p s e4) ;; Bar 7 (e e4 ff s f4 e s b4 p) ;; Bar 8 (e b4 s s mf e fs5 ff) ;; Bar 9 (s fs5 mf f5 p mf e cs6) ;; Bar 10 (s cs6 c6 p e b5 mf s g6 ff) ;; Bar 11 (s g6 p ff e f6 g6 mf) ;; Bar 12 (s g6 g6 p ff e fs6) ;; Bar 13 (s g6 mf p e s fs6) ;; Bar 14 (s fs6 fs6 ff mf ff) ;; Bar 15 (e fs6 p s ff fs6 fs6 mf) ;; Bar 16 (s fs6 fs6 ff p f6) ;; Bar 17 (s fs6 ff mf e e f6) ;; Bar 18 (s f6 e fs6 fs6 p s f6) ;; Bar 19 (s f6 mf fs6 fs6 p f6) ;; Bar 20 (e f6 f6 ff s fs6 p f6 ff) ;; Bar 21 (s f6 p e s s) ;; Bar 22 (s f6 e mf p s ff) ;; Bar 23 (s f6 mf p mf e ff) ;; Bar 24 (s f6 p e s mf p) ;; Bar 25 (s f6 ff e mf s e p) ;; Bar 26 (e f6 s e ff mf) ;; Bar 27 (s f6 p mf e6 ff f6 p) ;; Bar 28 (s f6 ff e6 mf e eb6 p f6 mf) ;; Bar 29 (s f6 e6 d6 f6) ;; Bar 30 (s f6 e6 ff d6 e f6 p) ;; Bar 31 (s f6 mf e6 ff cs6 f6 mf) ;; Bar 32 (s f6 ff f6 cs6 mf f6 ff) ;; Bar 33 (e f6 mf s s cs6 p fs6 mf) ;; Bar 34 (s f6 ff e e6 p s bb5 mf f6) ;; Bar 35 (s e6 p b5 f5 eb6) ;; Bar 36 (s bb5 fs5 ff e cs5 p s a5 mf) ;; Bar 37 (e e5 ff s c5 e gs4 mf s d5) ;; Bar 38 (e bb4 s fs4 d4 e g4) ;; Bar 39 (s e4 ff d4 b3 mf e eb4) ;; Bar 40 (s cs4 p bb3 mf e gs3 p s c4 ff) ;; Bar 41 (s a3 a3 mf e b3 ff gs3) ;; Bar 42 (s bb3 c4 d4 e b3 mf) ;; Bar 43 (s cs4 p eb4 mf e f4 p s eb4 ff) ;; Bar 44 (s e4 fs4 gs4 p fs4 ff) ;; Bar 45 (e g4 p s a4 mf bb4 a4) ;; Bar 46 (s bb4 c5 cs5 p c5 mf) ;; Bar 47 (s cs5 eb5 ff e e5 mf eb5 ff) ;; Bar 48 (s e5 mf e fs5 g5 p s fs5 ff) ;; Bar 49 (s g5 mf gs5 a5 p a5) ;; Bar 50 (e bb5 ff b5 mf s c6 ff c6) ) I revise only a single part at a time, as I will also re-bar the music. If I later want to update bar number comments, I can just call pprint-part on the result again. BTW: get-time-signature is useful to extract the time signatures for def-score from the part data. The function pprint-part is defined below. Best, Torsten ;; based on https://groups.google.com/forum/#!topic/comp.lang.lisp/_NP7Ub6hLsE (setf *print-pretty* t *print-miser-width* 0 *print-right-margin* 80) (defun pprint-part (part &optional (stream *standard-output*)) "Pretty prints a part one bar a time, adding a bar line comment before each bar. Args: part: nested OMN list. Example: (pprint-part '((q c4 d4 e4) (h f4 q e4) (h. d2)))" (pprint-logical-block (stream nil :prefix "(" :suffix ")") (pprint-logical-block (stream part) (loop for bar-no from 1 to (length part) for bar in part do (progn (pprint-indent :block 1 stream) (pprint-newline :mandatory stream) (format stream ";; Bar ~A" bar-no) (pprint-newline :mandatory stream) (prin1 bar stream)))) (pprint-indent :block -1 stream) (pprint-newline :mandatory stream)))
  1. Load more activity