Jump to content

AM

Members
  • Content Count

    544
  • Joined

  • Last visited

Everything posted by AM

  1. extendig SINGLE-EVENTS with optional-datas (like instrument-name, or whatelse) and reading/filtering this EVENT-LIST by a key-value -> useful for instrumentation... greetings andré ;;; --------------------------------------------------------------------------------------------- ;;; extending single-events with optional-datas ;;; --------------------------------------------------------------------------------------------- ;; SUBFUNCTION (defun memberp (n liste) (not (equal 'nil (member n liste)))) ;; MAINFUNCTION (defun create-extended-single-events (omn-list &key (optional-data1 nil) (optional-data2 nil) (optional-data3 nil)) (loop for i in (single-events omn-list) for data-cnt = 0 then (incf data-cnt) when (< (car (omn :length i)) 0) collect (append (list (first i)) (gen-repeat 6 'nil)) else collect (append (loop repeat 4 for cnt = 0 then (incf cnt) collect (nth cnt i)) (append (list (nth data-cnt optional-data1) (nth data-cnt optional-data2) (nth data-cnt optional-data3)))))) (create-extended-single-events '(e c4 mp stacc e. -h e. p ord e e4 stacc) :optional-data1 '(trp fl trp trp fl clar) :optional-data2 '(1 3 2 4 3 5 3 1 1)) ;; events are extended with the optional-data1-x => ((e c4 mp stacc trp 1 nil) (e. c4 mp nil fl 3 nil) (-h nil nil nil nil nil nil) (e. c4 p ord trp 4 nil) (e e4 p stacc fl 3 nil)) ;;; --------------------------------------------------------------------------------------------- ;;; reads events by key-values!! ;;; --------------------------------------------------------------------------------------------- ;;; now, with this function, you can filter all EVENTS with key-value X. all others will be replaced ;;; by RESTS, so the time-length-structure will be not destroyed. you can say: i need all EVENTS ;;; with key-value 'trp in the trumpet-voice, or all EVENTS with key-value 'c4 for .... (defun read-single-events-by (event-stream &key (key-value 'c4)) (loop for i in event-stream when (memberp key-value i) collect i else collect (append (list (length-invert (first i))) (gen-repeat 6 'nil)))) (read-single-events-by '((e c4 mp stacc trp 1 nil) (e. c4 p ord fl 3 nil) (e e4 p stacc trp 2 nil)) :key-value 'trp) ;; shows all EVENTS with key-value 'trp (other events are replaced by rests) => ((e c4 mp stacc trp 1 nil) (-3/16 nil nil nil nil nil nil) (e e4 p stacc trp 2 nil)) (read-single-events-by '((e c4 mp stacc trp 1 nil) (e. c4 p ord fl 3 nil) (e e4 p stacc trp 2 nil)) :key-value '3) ;; shows all EVENTS with key-value '3 (other events are replaced by rests) => ((-1/8 nil nil nil nil nil nil) (e. c4 p ord fl 3 nil) (-1/8 nil nil nil nil nil nil)) (read-single-events-by '((e c4 mp stacc trp 1 nil) (e. c4 p ord fl 3 nil) (e e4 p stacc trp 2 nil)) :key-value 'ord) ;; shows all EVENTS with key-value 'ord (other events are replaced by rests) => ((-1/8 nil nil nil nil nil nil) (e. c4 p ord fl 3 nil) (-1/8 nil nil nil nil nil nil))
  2. violà, i think something like this -> an example you simply could evaluate!!! :-) ;;; --------------------------------------------------------------------------------------------- ;;; --------------------------------------------------------------------------------------------- ;;; KLANGFARBEN-MELODIE: A FUNCTION THAT SPLITS PITCHES/LENGTHS IN THE WAY OF THE INSTRUMENTATION ;;; SEQUENCE -> SO YOU COULD SPLIT/COMPBINE THE PAARMETERS PITCH + LENGTH + VELOCITY + ARTICULATION ;;; + C O L O R (= INSTRUMENTATION)!!!! -> SO YOU CAN CREATE KLANGFARBENMELODIEN!! ;;; --------------------------------------------------------------------------------------------- ;;; --------------------------------------------------------------------------------------------- (defun generate-events (durations pitches &key (velocity '(mf)) (articulation '(-)) (optional_data 'nil)) ;; generates an EVENT-STREAM from parameter-lists -> important is the "optional_data", ;; that's the place where the instrument's name is written in! (loop repeat (length durations) with cnt-d = 0 with cnt-rest = 0 when (> (nth cnt-d durations) 0) collect (list (nth cnt-d durations) (nth cnt-rest pitches) (nth cnt-rest velocity) (nth cnt-rest articulation) (nth cnt-rest optional_data)) and do (incf cnt-rest) and do (incf cnt-d) else collect (list (nth cnt-d durations) 'nil 'nil 'nil 'nil) and do (incf cnt-d))) (defun filtering-color (selected-color event-stream) ;; filtering the the EVENT-STREAM by instrument (let ((velocity) (articulation)) (loop for i in event-stream with match = 0 append (loop for x in (fifth i) when (equal (first x) selected-color) do (setq articulation (second x) velocity (third x)) and do (setq match 1)) when (and (= match 1) (> (first i) 0)) append (list (first i) (second i) velocity articulation) else collect (* -1 (abs (first i))) do (setq match 0)))) (defun gen-hoquetus (filtered-instrument &key pitch length instrument-list) (let ((events (generate-events length pitch :optional_data instrument-list))) (filtering-color filtered-instrument events))) ;;; --------------------------------------------------------------------------------------------- ;;; OMN_EXAMPLE: ;;; --------------------------------------------------------------------------------------------- (setq pitches '(c4 cs4 d4 ds4 e4 f4 fs4 g4 gs4 a4 bb4 b4)) ; only an example (setq lengths (gen-length '(1 2 3 -4 5 6 5 -4 3 -2 1 1 1 -8 3 2) 1/16)) ; only an example ;; instrumentation -> every LIST/LINE is the instrumentation/technique for one single pitch/length (setq instrumentation '(((pno ord ppp)) ; only an example ((vn pizz p)) ((trp ord ff)) ((vn pizz f) (va ponte f)) ((pno ord ff)) ((pno ord fff)) ((vn tasto mf) (pno ord ff) (vc tasto mf) (trp ord pp)) ((trp mute pp) (vn ponte mf)) ((trp mute pp)) ((trp mute pp)) ((trp ord f) (pno ord ff)) ((trp ord f) (vc tasto mf)))) ;;; --------------------------------------------------------------------------------------------- ;;; SCORE: YOU CAN MAP THE INSTRUMENTS ON THE CHANNEL/PORT YOU NEED FOR YOUR SOFTWARE-INSTR ;;; HAVE A LOOK TO THE SCORE AND INSTRUMENTATION-LIST ;;; --------------------------------------------------------------------------------------------- (def-score klangfarben-melodie (:key-signature '(c maj) :time-signature '(4 4) :tempo '(120) :layout (bracket-group (trumpet-layout 'trumpet) (piano-grand-layout 'piano) (violin-layout 'violin) (viola-layout 'viola) (violoncello-layout 'violoncello))) (trumpet :omn (gen-hoquetus 'trp ;; filters all trp-pitches/lengths/... :pitch pitches :length lengths :instrument-list instrumentation) :channel 1) (piano :omn (gen-hoquetus 'pno ;; filters all pno-pitches/lengths/... :pitch pitches :length lengths :instrument-list instrumentation) :channel 2) (violin :omn (gen-hoquetus 'vn :pitch pitches :length lengths :instrument-list instrumentation) :channel 3) (viola :omn (gen-hoquetus 'va :pitch pitches :length lengths :instrument-list instrumentation) :channel 4) (violoncello :omn (gen-hoquetus 'vc :pitch pitches :length lengths :instrument-list instrumentation) :channel 5))
  3. you could use the hoquetus.4-function exactly for that
  4. (defun modify-length-of-a-technique (omn-list &key technique (factor 1) (modification 'augmentation)) (flatten (loop for i in (single-events omn-list) when (equal (car (omn :articulation i)) technique) collect (cond ((equal modification 'augmentation) (length-augmentation factor i)) ((equal modification 'diminution) (length-diminution factor i))) else collect i))) (modify-length-of-a-technique '(q d4 mf ponte e fs4 tasto -e. e g4 tasto q gs4 ponte) :technique 'ponte :factor 10 :modification 'augmentation) ;; also 'diminution
  5. modifying stephane' s code (defun replace-length-of-a-technique (omn-list &key technique length) (flatten (loop for i in (single-events omn-list) when (equal (nth 3 i) technique) collect `(,(rnd-pick* length) ,(nth 1 i) ,(nth 2 i) ,(nth 3 i)) else collect i))) (replace-length-of-a-technique '(e. c4 p tasto d4 ponte e4) :technique 'tasto :length '(1/32)) (replace-length-of-a-technique '(e. c4 p tasto d4 ponte e4 d4 tasto f5 tasto) :technique 'tasto :length '(1/32 2/32 3/32)) ;; rnd
  6. (defun testp (n1 n2 &key (test '=)) (progn (cond ((pitchp n1) (setf n1 (pitch-to-midi n1) n2 (pitch-to-midi n2))) ((velocityp n1) (setf n1 (get-velocity n1) n2 (get-velocity n2)))) (eval (list test n1 n2)))) (testp 'cs4 'd4 :test '<) (testp 'cs4 'd4 :test '/=) (testp 'cs4 'cs4 :test '=) (testp 'mp 'mf :test '<) (testp 12 13 :test '=)
  7. nice, but didn't found this function in the library, so you has to code...
  8. when i evaluate this: (setf pianomainHarm (tonality-map (append (gen-repeat 4 '((scale2))) (gen-repeat 4 '((scale1))) (gen-repeat 4 '((scale3))) ) pianomain)) Error: > Error: scale2 is not a tonality or a chord. > While executing: make-tonality, in process Listener-1(6). > Type cmd-. to abort, cmd-\ for a list of available restarts. > Type :? for other options. so, take a look what is your scale2 etc or it's in YOUR library, so i can't test YOUR score/code
  9. (apply #'mapcar #'(lambda (&rest all) all) lists)) this is really cool! :-)
  10. ;;; in "pure lisp" with NIL when lists have not the same length (defun trans* (lists) (loop repeat (car (last (sort-asc (mapcar 'length lists)))) for cnt = 0 then (incf cnt) collect (loop for i in lists collect (nth cnt i)))) (trans* '((1 2 3 4) (a b c d) (11 12 13 14) (k l m n))) (trans* '((1 2 3 4) (a b c d e) (11 12 13 14 14 16) (k l m n o p q r s t))) (trans* '((1 2 3 4) (a b c d e) (11 12 13 14) (k l m n r s t)))
  11. reset a pitch-sequence on a specific pitch (lowest, highest, middle pitch of the sequence) ;;;; SUB (defun center-position-in-list (list &key (get-value 'nil)) (let ((pos)) (progn (setf pos (if (evenp (length list)) (/ (length list) 2) (/ (1+ (length list)) 2))) (if (equal get-value 'nil) (append pos) (nth (1- pos) list))))) ;;; MAIN (defun reset-pitch-sequence (pitch-sequence pitch &key (type 'low)) (let ((pitch1 (cond ((equal type 'low) (car (find-ambitus pitch-sequence :type :pitch))) ((equal type 'high) (cadr (find-ambitus pitch-sequence :type :pitch))) ((equal type 'center) (center-position-in-list pitch-sequence :get-value t))))) (pitch-transpose (car (pitch-to-interval (list (if (chordp pitch1) (car (pitch-melodize pitch1)) (append pitch1)) pitch))) pitch-sequence))) (reset-pitch-sequence '(gs2 g2 a2 fs2 ds2 f2 e2) 'fs3 :type 'low) => (b3 bb3 c4 a3 fs3 gs3 g3) (reset-pitch-sequence '(gs2 g2 a2 fs2 ds2 f2 e2) 'fs3 :type 'high) => (f3 e3 fs3 eb3 c3 d3 cs3) (reset-pitch-sequence '(gs2 g2 a2 fs2 ds2 f2 e2) 'fs3 :type 'center) => (f3 e3 fs3 eb3 c3 d3 cs3)
  12. same with gen-integer-step (defun gen-integer-step* (n intervals &key (offset 0) (every-x 1) (reverse nil)) (let ((n (* n every-x)) (seq)) (setf seq (find-everyother every-x (subseq (gen-integer-step 0 (+ n offset) intervals) offset (+ n offset)))) (if (equal reverse nil) seq (reverse seq)))) (gen-integer-step* 20 '(1 -2 3 1)) => (0 1 -1 2 3 4 2 5 6 7 5 8 9 10 8 11 12 13 11 14) (gen-integer-step* 20 '(1 -2 3 1) :every-x 2) => (0 -1 3 2 6 5 9 8 12 11 15 14 18 17 21 20 24 23 27 26) (gen-integer-step* 20 '(1 -2 3 1) :offset 6 :every-x 4 :reverse t) => (59 56 53 50 47 44 41 38 35 32 29 26 23 20 17 14 11 8 5 2) ;;;; in combination with "reading-list-by-steps" (defun reading-list-by-steps (&key steps values (start (car values))) (let ((pos (car (position-item start values)))) (append (list (nth pos values)) (loop for i in steps do (setf pos (+ pos i)) when (> pos (length values)) do (setf pos (+ 0 i)) collect (nth pos values))))) (list-plot (reading-list-by-steps :steps (gen-repeat 5 '(1 2 -1 3 4 -1)) :values (gen-integer-step* 100 '(1 2 3 1) :offset 4 :reverse t)) :join-points t)
  13. same with fibonacci (defun fibonacci* (n &key (offset 0) (every-x 1) (reverse nil)) (let ((n (* n every-x)) (seq)) (setf seq (find-everyother every-x (subseq (fibonacci 0 (+ n offset)) offset (+ n offset)))) (if (equal reverse nil) seq (reverse seq)))) (fibonacci* 5 :offset 2) => (1 2 3 5 8) (fibonacci* 5 :offset 5 :every-x 2) => (5 13 34 89 233) (fibonacci* 5 :offset 5 :every-x 2 :reverse t) => (233 89 34 13 5) ;;;; in combination with "reading-list-by-steps" (defun reading-list-by-steps (&key steps values (start (car values))) (let ((pos (car (position-item start values)))) (append (list (nth pos values)) (loop for i in steps do (setf pos (+ pos i)) when (> pos (length values)) do (setf pos (+ 0 i)) collect (nth pos values))))) (list-plot (reading-list-by-steps :steps '(1 -1 4 -3 2 -1 3 -2 4 1 1 -1) :values (fibonacci* 14 :offset 6 :reverse t) :start 89) :join-points t)
  14. a little prime-function-extension (defun primes* (n &key (offset 0) (every-x 1) (reverse nil)) (let ((n (* n every-x)) (seq)) (progn (setf seq (find-everyother every-x (subseq (primes (+ n offset)) offset (+ n offset)))) (if (equal reverse nil) seq (reverse seq))))) (primes* 4 :offset 0) => (2 3 5 7) (primes* 4 :offset 1) => (3 5 7 11) (primes* 6 :offset 8) => (23 29 31 37 41 43) (primes* 5 :offset 5 :every-x 2) => (13 19 29 37 43) (primes* 5 :offset 3 :every-x 4) => (7 19 37 53 71) (primes* 5 :offset 5 :every-x 3 :reverse t) => (61 47 37 23 13) ;;;; in combination with "reading-list-by-steps" (defun reading-list-by-steps (&key steps values (start (car values))) (let ((pos (car (position-item start values)))) (append (list (nth pos values)) (loop for i in steps do (setf pos (+ pos i)) when (> pos (length values)) do (setf pos (+ 0 i)) collect (nth pos values))))) (list-plot (reading-list-by-steps :steps '(1 2 -1 3 4 -1) :values (primes* 10 :offset 4 :reverse t)) :join-points t)
  15. new version, for LISTS with different-lengths => compensated ;;; SUB (defun compensate-list-lengths (somelists &key (value 0)) (let ((maxlength (find-max (mapcar 'length somelists)))) (loop for i in somelists when (< (length i) maxlength) collect (append i (loop repeat (- maxlength (length i)) collect value)) else collect i))) ;;; MAIN (defun sum-list-items (somelists &key (each-step nil)) (let ((somelists (compensate-list-lengths somelists)) (lista (car somelists)) (firstlist (car somelists))) (progn (setf somelists (loop for x in (rest somelists) collect (setf lista (loop for i in lista for j in x collect (+ i j))))) (if (equal each-step t) (append (list firstlist) somelists) (car (last somelists)))))) ;;; (sum-list-items '((1 0 4 4 4 4 4 4 0 1) (81 0 0 0) (0 0 1 1 99 200))) => (82 0 5 5 103 204 4 4 0 1)
  16. it's not decimal-to-binary!!! another idea... for example... 6 => 1 0 0 0 0 0 = a "1" and 5 times a "0")
  17. perhaps there's a OM-solution... in this case it's to hard to find... (search-engine?) otherwise... (defun integer-to-binary-lengths* (alist) (loop for i in alist when (> (abs i) 1) append (append (list 1) (loop repeat (- (abs i) 1) collect 0)) else collect 1)) (integer-to-binary-lengths* '(2 2 2 1 1 4 4 4 4)) (integer-to-binary-lengths* '(6 4 8 5 2 1 10 2))
  18. i think a different idea!? in my code: sum first item of all lists sum second... sum third... ... but perhaps i'm wrong
  19. very simple, i used something like this for my work... but is there somthing like this in OM? greetings andré (defun sum-list-items* (somelists &key (each-step nil)) (let ((lista (car somelists)) (firstlist (car somelists))) (progn (setf somelists (loop for x in (rest somelists) collect (setf lista (loop for i in lista for j in x collect (+ i j))))) (if (equal each-step t) (append (list firstlist) somelists) (car (last somelists)))))) (sum-list-items* '((1 0 0 1) (1 0 0 0) (0 0 1 1))) (sum-list-items* '((1 0 0 1) (1 0 0 0) (0 0 1 1)) :each-step t) (sum-list-items* '((1 0 8 1) (2 0 0 0) (0 -1 3 1))) (sum-list-items* '((1 0 8 1) (2 0 0 0) (0 -1 3 1)) :each-step t)
  20. here's an example of the combination of gen-symmetrical* + gen-stacc* (length-list-plot (gen-stacc* (gen-length (gen-symmetrical* 8 (reverse (gen-divide 3 (primes 12))) :style 'unique :type 'hierarchic) 1/32) :symmetrical t :possible-stacc-lengths '(2/32 1/32 3/32)))
  21. some extensions to the basic function... greetings andré ;;; SUB (defun rnd-pick* (alist) (if (and (listp (first alist)) (floatp (second (first alist)))) (weighted-random alist) (rnd-pick alist))) (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))) ;;; MAIN (defun gen-symmetrical* (n list &key (type 'nil)) (if (equal type 'hierarchic) (progn (let ((alist (butlast list)) (center (last list))) (if (> n (* 2 (length list))) 'list-has-too-few-items (if (evenp n) (progn (setf alist (loop repeat (/ n 2) for i in alist collect (rnd-pick* i))) (append alist (reverse alist))) (progn (setf alist (loop repeat (/ (1- n) 2) for i in alist collect (rnd-pick* i))) (append alist (list (rnd-pick* (flatten center))) (reverse alist))))))) (progn (let ((list (rnd-order list)) (newlist (rest list)) (center (car list))) (if (> n (* 2 (length list))) 'list-has-too-few-items (if (evenp n) (progn (setf list (rnd-unique (/ n 2) newlist)) (append list (reverse list))) (progn (setf list (rnd-unique (/ (1- n) 2) (rest newlist))) (append list (list center) (reverse list))))))))) ;;ordinario (gen-symmetrical* 5 '(1 2 3 4 5 6 7 8)) ;;unmittelbare wiederholungen möglich (gen-symmetrical* 9 '(1 2 3 4 5 6 7 8) :repeat t) ;;werte kommen nur doppelt vor durch die symmetrie- ;;bildung, aber nicht auf einer der symmetrieseiten. (gen-symmetrical* 9 '(1 2 3 4 5 6 7 8) :style 'unique) (gen-symmetrical* 30 '(1 2 3 4 5 6 7 8) :style 'unique) ;;=> list-has-too-few-items ;;bei ":type 'hierarchic" wird immer zuerst aus der ;;ersten sublist ausgewählt, dann aus der zweiten etc... (gen-symmetrical* 6 '((a b c) (6 7) (8 9) (10 11)) :style 'unique :type 'hierarchic) ;;auch mit weight möglich (gen-symmetrical* 5 '(((1 0.2) (2 0.8)) ((4 0.1) (5 0.9)) (6 7) (8 9) (10 11)) :style 'unique :type 'hierarchic)
  22. could be interesting for you... an really extend gen-stacc-function greetings andré ;;; SUB (defun center-position-in-list (list &key (get-value 'nil)) (let ((pos)) (progn (setf pos (if (evenp (length list)) (/ (length list) 2) (/ (1+ (length list)) 2))) (if (equal get-value 'nil) (append pos) (nth (1- pos) list))))) ;(center-position-in-list '(1 2 3 4 x 4 3 2 1) :get-value nil) ;(center-position-in-list '(1 2 3 4 x 4 3 2 1) :get-value t) (defun gen-stacc3 (n-liste liste &key (stacc-chance 1)) (loop for i in liste with n do (setq n (rnd-pick* n-liste)) when (and (> i n) (equal (weighted-t/nil stacc-chance) 't)) append (list n (* -1 (- (abs i) n))) else collect i)) ;(gen-stacc3 '(1/2) '(3 4 5 3 2 1) :stacc-chance 0.5) ;(gen-stacc3 '(1/32 3/32) '(3/32 5/32 14/8) :stacc-chance 0.5) ;;; MAIN (defun gen-stacc* (liste &key (symmetrical 'nil) (stacc-chance 1) (possible-stacc-lengths 'nil) (no-center-stacc 'nil)) (let ((alist liste) (blist) (val) (n (/ 1 (find-max (mapcar 'denominator liste))))) (if (equal symmetrical 'nil) ;;bei unsymmetrischen strukturen (gen-stacc3 (if (equal possible-stacc-lengths 'nil) (list n) possible-stacc-lengths) liste :stacc-chance stacc-chance) ;;bei symmetrischen strukturen (if (evenp (length liste)) (progn (setf alist (gen-stacc3 (if (equal possible-stacc-lengths 'nil) (list n) possible-stacc-lengths) (filter-first (/ (length liste) 2) liste) :stacc-chance stacc-chance)) (setf blist (flatten (loop for i in (reverse (gen-divide 2 alist)) collect (reverse i)))) (append alist blist)) (progn (setf alist (gen-stacc3 (if (equal possible-stacc-lengths 'nil) (list n) possible-stacc-lengths) (filter-first (/ (1- (length liste)) 2) liste) :stacc-chance stacc-chance)) (setf blist (flatten (loop for i in (reverse (gen-divide 2 alist)) collect (reverse i)))) (append alist (if (equal no-center-stacc 't) (list (center-position-in-list liste :get-value t)) (progn (setf val (/ (center-position-in-list liste :get-value t) 3)) (list (* -1 val) val (* -1 val)))) blist)))))) ;; ordinario (gen-stacc* (gen-length '(4 5 6 3 6 5 4) 1/20)) ;; vorgebener stacc-wert (gen-stacc* '(4 5 6 3 6 5 4) :possible-stacc-lengths '(1/4)) ;; wählt rnd die längen der stacc-values (gen-stacc* '(4 5 6 3 6 5 4) :possible-stacc-lengths '(2/32 1/32 5/32 1/4)) ;; rnd-stacc (gen-stacc* (gen-length '(4 5 6 3 6 5 4) 1/32) :stacc-chance 0.4) ;; rnd-stacc mit verschiedenen möglichen stacc-lengths (gen-stacc* (gen-length '(4 5 6 3 6 5 4) 1/32) :stacc-chance 0.7 :possible-stacc-lengths '(2/32 1/32)) ;; symm-strukturen werden berücksichtigt (gen-stacc* (gen-length '(4 5 6 7 6 5 4) 1/32) :symmetrical t :no-center-stacc t) ;; ohne stacc bei center-value (gen-stacc* (gen-length '(4 5 6 7 6 5 4) 1/32) :symmetrical t :no-center-stacc t)
  23. ;;; alternative function for GEN-SYMMETRICAL: in combination ;;; with FIND-UNIQUE => symmetries with unique items (except ;;; what is generated by symmetry) (defun gen-symmetrical* (n list) (let ((list (rnd-order list)) (newlist (rest list)) (center (car list))) (if (> n (* 2 (length list))) 'list-has-too-few-items (if (evenp n) (progn (setf list (rnd-unique (/ n 2) newlist)) (append list (reverse list))) (progn (setf list (rnd-unique (/ (1- n) 2) (rest newlist))) (append list (list center) (reverse list))))))) (gen-symmetrical* 5 '(1 2 3 4 5 6 7 8)) (gen-symmetrical* 9 '(1 2 3 4 5 6 7 8)) (gen-symmetrical* 30 '(1 2 3 4 5 6 7 8)) => list-has-too-few-items ; error-message
  24. you are right, but it is okay for my use - if someone wants to make it smarter, it is very welcome - but I have to do some other things :-)
×
×
  • Create New...