Jump to content

AM

Members
  • Posts

    793
  • Joined

  • Last visited

Reputation Activity

  1. Like
    AM got a reaction from torstenanders in Creating Custom Chord Symbols   
    i think it's good and important to see that opusmodus is not a notation software (like sibelius/finale/dorico...). the potential is rightly in another area and i believe that it is important to keep the basic idea of opusmodus in focus (it's important to have restrictions/limitations) - and i think the development team is very aware of that .
    you can not have everything, but what is possible should be very very smart in its kind.
     
    the longer i work with opusmodus, the more i realize, for what i can use it ...and when I have to switch to another platform. 
    and because it is so open, it is then possible for me to find solutions for my specific needs, by being able to program myself and not simply having to do what the existing tools / functions allow.
     
    okay i admit i'm a big fan of opusmodus, although i do not even compose with it but can try/simulate basic ideas of my work - doing abstract/new things and see what happens - like working in an LAB 🙂
     
  2. Like
    AM reacted to Stephane Boussuge in Make-chord-if-length study   
    Here's a small piano study using my new function make-chord-if-length and few others from my personal lib.
    Enjoy 😉
    SB.
     
    ;;; UTILITIES ;;; ======================================== ;;; GEN-PITCH-LINE ;;; Fonction de génération de hauteurs basées sur une conversion de vecteur de bruit ;;; avec un grand choix de type de bruit, taux de compression du vecteur, filtrage des répétitions et ambitus. (defun gen-pitch-line (nb-pitch &key (compress 1) (ambitus '(c4 c6)) seed filter-repeat (type :white)) (setf seed (rnd-seed seed)) (let (pitches) (do-verbose ("gen-pitch-line :seed ~s" seed) (labels ((white-or-pink (nb-pitch seed type) (if (eq type ':pink) (gen-pink-noise nb-pitch :seed seed) (gen-white-noise nb-pitch :seed seed :type (if (eq type ':white) :normal type)))) (process (nb-pitch &key (compress 1) (ambitus '(c4 c6)) seed filter-repeat type) (setf pitches (vector-to-pitch ambitus (vector-smooth compress (white-or-pink nb-pitch seed type)))) (when filter-repeat (setf pitches (gen-trim nb-pitch (filter-repeat filter-repeat pitches)))) pitches) ) (process nb-pitch :compress compress :ambitus ambitus :filter-repeat filter-repeat :seed (seed) :type type))))) #| USAGE (gen-pitch-line 24 :compress 0.42 :type :white :filter-repeat 1) (gen-pitch-line 24 :compress 0.42 :type :pink :filter-repeat 1) (gen-pitch-line 24 :compress 0.42 :type :extreme :filter-repeat 1) (gen-eval 8 '(make-omn :pitch (gen-pitch-line 24 :compress 0.42 :type :white :filter-repeat 1) :length (euclidean-rhythm 16 1 16 's :type 2) ) :seed 33) |# ;;; OMN-ARTICULATION-PROCESSOR (defun omn-articulation-processor (map omn-mat &key (section nil)) (do-verbose ("omn-articulation-processor") (let ((artic (pattern-map map (omn :length omn-mat) :otherwise '(default) :section section)) ) (omn-replace :articulation artic omn-mat) ))) ;;; MAKE-CHORD-IF-LENGTH (defun make-chord-if-length-aux (omn &key (test #'>) (length-val 1/8) (interval-list '((4 7)(7 12))) (cycle t)(relative nil) seed) (setf seed (rnd-seed seed)) (let ((s-events (single-events omn))) (loop for e in s-events when (funcall test (omn-encode (first e)) length-val) append (omn-replace :pitch (gen-chord3 (list (second e)) interval-list :cycle cycle :relative relative :seed (seed)) e ) else append e))) (defun make-chord-if-length (omn &key (test #'>) (length-val 1/8) (interval-list '((4 7)(7 12)))(cycle nil)(relative nil) seed) (setf seed (rnd-seed seed)) (do-verbose ("make-chord-if-length :seed ~s :length-val ~s :interval-list ~s :cycle ~s :relative ~s" seed length-val interval-list cycle relative) (let ((test-fn (case test (> #'>) (< #'<) (= #'=) (otherwise test)))) (if (listp (car omn)) (mapcar #'(lambda (x) (make-chord-if-length-aux x :test test-fn :length-val (omn-encode length-val) :interval-list interval-list :cycle cycle :relative relative :seed (seed))) omn) (make-chord-if-length-aux omn :test test-fn :length-val (omn-encode length-val) :interval-list interval-list :cycle cycle :relative relative :seed (seed)))))) ;;; ======================================== ;;;--------------------------------------------------------- ;;; Parameters ;;;--------------------------------------------------------- (setf size 24) (setf flow1 (pitch-transpose -7 (make-omn :pitch (gen-pitch-line 128 :compress 0.33 :seed 729353) :length (rnd-sample size '((s s s s s s s s -q) (e e h)(h.)(q q e e) (e e q q)(s s s s q q) (q s s s s q)(s s e -e s s q) ) :seed 729355) :velocity (rnd-sample size '((ppp)(pp)(p)(mp)(mf)) :seed 729356) ))) (setf flow2 (pitch-transpose -4 (make-omn :pitch (gen-pitch-line 128 :compress 0.73 :seed 353) :length (rnd-sample size '((h. ) (q. e q)(h.)(q q q) (h -q)(e e h) (h e e) ) :seed 729355) :velocity (rnd-sample size '((ppp)(pp)(p)) :seed 729356) ))) (setf flow3 (pitch-transpose -7 (make-omn :pitch (gen-pitch-line 128 :compress 0.33 :seed 7353) :length (rnd-sample size '((s s s s s s s s -q) (e e h)(h.)(q q e e) (e e q q)(s s s s q q) (q s s s s q)(s s e -e s s q) ) :seed 7255) :velocity (rnd-sample size '((ppp)(pp)(p)(mp)(mf)) :seed 7256) ))) ;;; Articulation remap (setf map '(((1/16 1/16 1/16 1/16)(leg leg leg default)))) (setf with-ch1 (omn-articulation-processor map (pitch-ornament (make-chord-if-length flow1 :interval-list '((-7 -19 3 9)(-4 -16 3 7) (-5 -17 4 12)(-3 -15 7)) :cycle nil :relative t :seed 729358 )))) (setf with-ch2 (omn-articulation-processor map (pitch-ornament (make-chord-if-length flow2 :interval-list '((-7 -19 3 9)(-4 -16 3 7) (-5 -17 4 12)(-3 -15 7)) :cycle nil :relative t :seed 729358 )))) (setf with-ch3 (omn-articulation-processor map (pitch-ornament (make-chord-if-length flow3 :interval-list '((-7 -19 3 9)(-4 -16 3 7) (-5 -17 4 12)(-3 -15 7)) :cycle nil :relative t :seed 729358 )))) ;;; SCORE ASSEMBLY (setf piano-rh (omn-replace :articulation '(default leg leg leg default fermata-l) (ambitus-filter '(c4 c8) (assemble-seq with-ch1 with-ch2 with-ch3)) :section '(71))) (setf piano-lh (omn-replace :articulation '(default fermata-l) (ambitus-filter '(c0 b3) (assemble-seq with-ch1 with-ch2 with-ch3)) :section '(71))) ;;;--------------------------------------------------------- ;;; Score and Layout ;;;--------------------------------------------------------- (def-score Study (:title "Mcil-study" :composer "S.Boussuge" :copyright "Copyright © 2018 s.boussuge " :key-signature 'chromatic :time-signature '((1 1 1) 4) :tempo 82 :layout (piano-solo-layout 'piano-rh 'piano-lh)) (piano-rh :omn piano-rh :channel 1 :sound 'gm :program 'acoustic-grand-piano :volume 100 :pan 64 :controllers (91 '(48)) ) (piano-lh :omn piano-lh :channel 2 :controllers (91 '(48)) ) )  
  3. Like
    AM reacted to lviklund in Make-chord-if-length study   
    Add this to the top of the file:
     
    (add-program-attributes '(default) ) It is not defined.
    SB missed to include that 🙂.
     
    /Lasse
  4. Like
    AM got a reaction from JulioHerrlein in replace-velocity-of-a-length   
    i did not realize that there is an OPMO-function for that 😕
     
    in OPMO:
    (setf omn-seq '(s c4 ffff e e s e. s q q q q q)) (length-map '((1/16 mp) (2/16 pp) (3/16 ppp)) omn-seq) => (s c4 mp e pp c4 s mp e. ppp s mp q ffff c4 c4 c4 c4)  
  5. Like
    AM reacted to Stephane Boussuge in How to apply different voicings over a chord progression   
    I think you can use gen-chord3.
     
    also i have finished the function you asked in another post about a different version of add-interval-if-length.
     
    This one is make-chord-if-length and is based on gen-chord3.
     
    i'll post it here for convenience but will also post it in programming forums section.
     
    ;;; ============================================== ;;; UTILITY FUNCTIONS ;;; (defun make-chord-if-length-aux (omn &key (test #'>) (length-val 1/8) (interval-list '((4 7)(7 12))) (cycle t)(relative nil) seed) (setf seed (rnd-seed seed)) (let ((s-events (single-events omn))) (loop for e in s-events for i in (gen-trim (length s-events) interval-list) when (funcall test (omn-encode (first e)) length-val) append (omn-replace :pitch (gen-chord3 (list (second e)) i :cycle cycle :relative relative :seed (seed)) e ) else append e))) ;(make-chord-if-length-aux '(q c4 d4 e4 f4 e g4 a4)) ;(make-chord-if-length-aux '(q c4 d4 e4 f4 e g4 a4) :interval-list '((4 7)(3 10))) ;(make-chord-if-length-aux '(q c4 d4 e4 f4 e g4 a4) :interval-list '((4 7 11 14)(7 9 16)) :cycle nil) ;(make-chord-if-length-aux '(q c4 d4 e4 f4 e g4 a4) :interval-list '((4 7 11 14)(7 9 16)) :cycle nil :seed 4) ;(make-chord-if-length-aux '(q c4 d4 e4 f4 e g4 a4) :interval-list '((4 7 11 14)(7 9 16)) :cycle nil :relative t) ;(make-chord-if-length-aux '(q c4 d4 e4 f4 e g4 a4) :interval-list '((4 7 11 14)(7 9 16)) :cycle nil :relative t :seed 4) ;;; ============================= ;;; MAIN FUNCTION (defun make-chord-if-length (omn &key (test #'>) (length-val 1/8) (interval-list '((4 7)(7 12)))(cycle nil)(relative nil) seed) (setf seed (rnd-seed seed)) (do-verbose ("make-chord-if-length :seed ~s :length-val ~s :interval-list ~s :cycle ~s :relative ~s" seed length-val interval-list cycle relative) (let ((test-fn (case test (> #'>) (< #'<) (= #'=) (otherwise test)))) (if (listp (car omn)) (mapcar #'(lambda (x) (make-chord-if-length-aux x :test test-fn :length-val (omn-encode length-val) :interval-list interval-list :cycle cycle :relative relative :seed (seed))) omn) (make-chord-if-length-aux omn :test test-fn :length-val (omn-encode length-val) :interval-list interval-list :cycle cycle :relative relative :seed (seed)))))) ;;; Tests ;(make-chord-if-length '((q c4 e d4 e4 f4 h d4)(s a4 b4 a4 g4 h f4)(q c4 d4 h e4))) ;(make-chord-if-length '((q c4 e d4 e4 f4 h d4)(s a4 b4 a4 g4 h f4)(q c4 d4 h e4)) :seed 8) ;(make-chord-if-length '((q c4 e d4 e4 f4 h d4)(s a4 b4 a4 g4 h f4)(q c4 d4 h e4)) :interval-list '((2 9)(7 11))) ;(make-chord-if-length '((q c4 d4 e4 f4 g4)(s a4 b4 a4 g4 h f4)(q c4 d4 h e4)) :cycle t) ;(make-chord-if-length '((q c4 e d4 e4 f4 h d4)(s a4 b4 a4 g4 h f4)(q c4 d4 h e4)) :cycle nil :relative t) ;(make-chord-if-length '((q c4 e d4 e4 f4 h d4)(s a4 b4 a4 g4 h f4)(q c4 d4 h e4)) :cycle nil :relative t :seed 8) SB.
  6. Like
    AM reacted to opmo in conTimbre library + pitchbend   
    We will delay the midi note-on events that start at time 0 by 5 ticks this might will solve the problem.
  7. Like
    AM reacted to lviklund in Composing with Piano Reductions   
    Thx Julio,
    Lot's of useful ideas for me.
     
    Brilliant!
    /Lasse
  8. Like
    AM got a reaction from Stephane Boussuge in inserting a sequence by overwriting   
    OVERWRITE FUNCTION: first time i'm working with this function (i coded it a year ago)... to overwrite the output/score => INSERTS....
    - and it's very useful, perhaps JANUSZ could code an official OPMO-version of this which works perfect?
     
    greetings
    andré
    ;;; OVERWRITE!! ---------------------------------------------- (defun memberp (n liste) (not (equal 'nil (member n liste)))) (defun get-resolution2 (be) (cond ((memberp (cadr be) '(3 6 12 24 48)) 1/24) ((memberp (cadr be) '(1 2 4 8 16 32)) 1/16) ((memberp (cadr be) '(5 10 20 40)) 1/20) ((memberp (cadr be) '(7 14 28 56 1)) 1/28))) (defun overwrite (seq &key insert bar/beat) (car (last (let ((bar) (beat) (resolution) (distance)) (progn (setf bar (loop for i in bar/beat collect (car i)) beat (loop for j in bar/beat collect (cadr j))) (loop for ba in bar for be in beat for ins in insert with time-sign = (get-time-signature seq) with ord-time-sign = (get-time-signature seq) do (setf resolution (get-resolution2 be) time-sign (if (listp (car time-sign)) (loop for i in time-sign when (> (caddr i) 1) append (loop repeat (caddr i) collect (list (car i) (cadr i))) else collect (list (car i) (cadr i))) (append time-sign)) distance (if (listp (car time-sign)) (+ (sum (loop repeat (- ba 1) for i in time-sign collect (/ (/ (car i) (cadr i)) (get-resolution2 be)))) (/ (/ (1- (car be)) (cadr be)) (get-resolution2 be))) (+ (/ (* (1- ba) (/ (car time-sign) (cadr time-sign))) (get-resolution2 be)) (/ (/ (1- (car be)) (cadr be)) (get-resolution2 be))))) do (setf seq (omn-to-time-signature (length-rest-merge (omn-merge-ties (flatten (loop repeat (length (omn-to-time-signature seq (list (numerator resolution) (denominator resolution)))) for cnt = 0 then (incf cnt) with new-seq = (omn-to-time-signature seq (list (numerator resolution) (denominator resolution))) with ins-rounded = (append ins (rest (length-rational-quantize (list (apply '+ (omn :length ins))) :round resolution))) when (= cnt distance) collect ins-rounded and do (setf cnt (+ (/ (get-span (flatten ins-rounded)) resolution) cnt -1)) else collect (nth cnt new-seq))))) ord-time-sign)) do (setf time-sign ord-time-sign) collect seq))))))  
     
     
    TWO EXAMPLES:
     
    ;;; in a 3/4 (setf seq1 '((e c6 a5 h b5 tie) (q b5 b5 a5 tie) (h a5 q a5) (h. g5))) (overwrite seq1 :insert '((3q c5 b4 bb4 a4) (3q c4 b3 bb3 a3)) :bar/beat '((2 (2 12)) (3 (7 12)))) ;;; with changing time-signatures (setf seq2 '((e c6 a5 h b5 q tie) (q b5 b5 a5 tie) (q a5 q a5) (h. g5))) (overwrite seq2 :insert '((3q c5 b4 bb4 a4) (3q c4 b3 bb3 a3)) :bar/beat '((1 (2 12)) (3 (1 12))))  
     
     
     
  9. Like
    AM reacted to opmo in write tuning-cents into omn / extract them   
    The future pitch (v1.4) will look like: c4 c4[50] fs4[50] d6[-30] etc... chord c4fs5[50]
    Every cents value which falls into microtonal notation (50, 30 -50 -75 ...) will be part of the notation all others will be written above the note: -43c
     
  10. Like
    AM got a reaction from opmo in write tuning-cents into omn / extract them   
    with these functions you could write your CENTS for tuning directly into OMN-attributes, and extract it afterwards
     
    1. generate by add-cents-tuning-to-text-atrributes the cent values into text-attributes (only one time), you could decide if it will be shown in the score "as CENTS or as FLOAT"
    2. now you could write your CENTS for tuning into OMN-attributes like 50ct, -34ct ...also in combination with other text-attributes legno+50ct, pizz+-65ct, -45ct+batt
    3. you could EXTRACT afterwards your LIST for TUNING directly from OMN by   get-tuning-from-omn*.if an EVENT has no cent-attribute it will be unchangend (= 0 cents)
     
     
    ;;; ------------------------------------------------------------------------------------------------------------------- ;;; ------------------------------------------------------------------------------------------------------------------- ;;; this function adds CENTS or FLOATS to text-attributes, in this way you can notate ;;; - have a look how it's written in the score -> all combinations of attributes possible ;;; ------------------------------------------------------------------------------------------------------------------- ;;; ------------------------------------------------------------------------------------------------------------------- (defun add-cents-tuning-to-text-atrributes (&key (centlist nil) (type nil)) (loop for i in (loop for x in (if (null centlist) (append (loop for i from 0 upto 99 collect i) (loop for i from 1 upto 99 collect (neg! i))) centlist) collect (compress (list x 'ct))) append (add-text-attributes (list i (write-to-string (if (equal type :float) (float (/ (append (compress (if (equal (car (explode i)) '-) (if (= (length (explode i)) 5) (filter-first 3 (explode i)) (filter-first 2 (explode i))) (if (= (length (explode i)) 4) (filter-first 2 (explode i)) (filter-first 1 (explode i))) ))) 100)) i)))))) ;;; EXAMPLES (add-cents-tuning-to-text-atrributes :type :float) ;; have a look to notation: cmd3 (-q -q e c4 fff q c4 mf 50ct e c4 mf -40ct e c5 ff) (add-cents-tuning-to-text-atrributes :type :cents) ;; cents are written ;; have a look to notation: cmd3 (-q -q e c4 fff q c4 mf 50ct e c4 mf -40ct e c5 ff) ;;; ------------------------------------------------------------------------------------------------------------------- ;;; ------------------------------------------------------------------------------------------------------------------- ;;; this function get out all notated microtones for TUNING ;;; if there is nothing written it will be 0 cents (0) ;;; you can combine all kinds of attributes ;;; ------------------------------------------------------------------------------------------------------------------- ;;; ------------------------------------------------------------------------------------------------------------------- (defun memberp (n liste) (not (equal 'nil (member n liste)))) (defun find-duplicates (lst) (cond ((null lst) '()) ((member (car lst) (cdr lst)) (cons (car lst) (find-duplicates (cdr lst)))) (t (find-duplicates (cdr lst))))) (defun get-tuning-from-omn* (omnlist centlist) (loop for i in (single-events (length-rest-remove omnlist)) with n = 0 when (not (null (find-duplicates (append (disjoin-attributes (car (last i))) centlist)))) do (setf n (float (/ (append (compress (remove-if-not #'numberp (explode (car (find-duplicates (append (disjoin-attributes (car (last i))) centlist))))))) 100))) and collect (if (equal (car (explode (car (find-duplicates (append (disjoin-attributes (car (last i))) centlist))))) '-) (* -1 n) n) else collect 0)) ;;; EXAMPLES (setf centlist (add-cents-tuning-to-text-atrributes :type :float)) ;;; evaluate this and you will get the tuning-list with all combinations of attributes (get-tuning-from-omn* '(-q -q e c4 fff q c4 mf legno+50ct+num1 e c4 mf -50ct+legno+batt e c5 ff pizz+-34ct) centlist) => (0 0.5 0.5 -0.34) (get-tuning-from-omn* '(-q -q e c4 fff -34ct+pizz q c4 mf legno+50ct e c4 mf -50ct+legno+batt e c5 ff pizz+-34ct) centlist) => (-0.34 0.5 -0.5 -0.34) (get-tuning-from-omn* '(-q -q e c4 fff -34ct+pizz+num11 q c4 mf legno+50ct e c4 mf -50ct+legno+batt e c5 ff pizz+-34ct) centlist) => (-0.34 0.5 -0.5 -0.34) ;;; cmd3 for LAYOUT/SCORE (-q -q e c4 fff -34ct+pizz+num11 q c4 mf legno+50ct e c4 mf -50ct+legno+batt e c5 ff pizz+-34ct) (-q -q e c4 fff q c4 mf legno+50ct+num1 e c4 mf -50ct+legno+batt+num2 e c5 ff pizz+legno+-34ct)  
  11. Like
    AM got a reaction from opmo in write tuning-cents into omn / extract them   
    EXAMPLE, very easy to use...
     
    ;;; EXAMPLE HOW TO USE <get-tuning-from-omn*> (setf centlist (add-cents-tuning-to-text-atrributes :type :float)) ;;; generating a omn-seq with mictronoes (by using articulation-SLOT (setf omn-seq (make-omn :length (quantize (gen-white-noise 50) '(2 3 5) :scale 1.4 :tolerance 0.02) :pitch (filter-repeat 1 (vector-to-pitch '(c2 b6) (gen-white-noise 50))) :span :pitch :velocity (vector-to-velocity 0.1 0.99 (gen-white-noise 50)) :articulation (rnd-repeat 50 '(0ct 7ct -5ct 16ct -31ct -14ct 50ct -50ct)))) ;;; generating SCORE/MIDI (def-score microtonal (:title "microtonal" :key-signature 'atonal :time-signature '(4 4) :tempo 120) (instr :omn omn-seq :channel 1 :tuning (get-tuning-from-omn* omn-seq centlist) :sound 'gm :program 'acoustic-grand-piano))  
     
  12. Like
    AM got a reaction from opmo in write tuning-cents into omn / extract them   
    another EXAMPLE, with mapped pitches/cents
     
    ;;; ----------------------------------------------------------------------------------------- ;;; MAPPED CENTS/PITCHES ;;; ----------------------------------------------------------------------------------------- ;(setf pitches (rnd-repeat 100 '(d1 c2 g3 c4 d4 e4 f4 g4 gs4 bb4 c5 d5 e5 f5 g5 gs5 bb5))) (setf pitches (rnd-repeat 100 '(e4 f4 g4 gs4 bb4 c5 d5 e5 f5 g5 gs5 bb5))) (setf centlist (replace-map '(((bb4 bb5) -31ct) ((c4 c5 c2) 0ct) ((d1 d4 d5) 2ct) ((e4 e5) -14ct) ((f4 f5) 50ct) ((g3 g4 g5) 5ct) ((gs4 gs5) 41ct)) pitches :otherwise '0ct)) (setf omn-seq (make-omn :length (quantize (gen-white-noise 50) '(2 3 5) :scale 0.8 :tolerance 0.02) :pitch (filter-repeat 1 pitches) :span :pitch :velocity (vector-to-velocity 0.1 0.99 (gen-white-noise 50)) :articulation centlist)) ;;; generating SCORE/MIDI (def-score microtonal (:title "microtonal" :key-signature 'atonal :time-signature '(4 4) :tempo 160) (instr :omn omn-seq :channel 1 :tuning (get-tuning-from-omn* omn-seq centlist) :sound 'gm :program 'acoustic-grand-piano))  
  13. Like
    AM got a reaction from torstenanders in MIDI-pitch-bend-messages   
    I do not work / almost never with DAW's. OPMO (before pwgl) and sibelius.
    i think the conTimbre library is much better - not all samples are quite perfect, but the selection of playing techniques eg. in the strings or in the drums is just very good. my last piece was for ensemble, virtual conductor and e-player (a piece whitch generates its form in quasi-realtime (completely new every time) - by sochastic/markov-procedures)
     
     
    - it was possible to play the add-SCORE from the library directly at the concert (midi-files read out with flexible tempo and played on CT) without any problems - mix extremely well with the live instruments. 
     
    I do not think the library is very user-friendly, but I do not produce music (i compose, which - in my view - is a different kind of thinking), so that's not so important for me. but it contains many extra features and (or information about sound analysis (and apparently a direct access to LISP to make algorithmic orchestrations)
    as I said, not quite smart designed, but the possibilities (compared to the IRCAM library) I feel as much bigger. CT can now also play well from SIBELIUS / FINALE over VST.
     
    so I would be much happier if CT ran so well (with microtonal stuff) on OPUSMODUS.
  14. Like
    AM reacted to JulioHerrlein in PAT MARTINO Idiomatic Jazz Lines Generator   
    This is for generating some jazz licks in the style of the LINEAR EXPRESSIONS, by jazz guitarist PAT MARTINO.
    The rhythm slots of the example contain the same 16th value, but it can be worked out as Rhythmic Cells. I was testing straight 16th lines.
     
    https://www.amazon.com/Linear-Expressions-Pat-Martino/dp/1423460898/ref=sr_1_1?ie=UTF8&amp;qid=1539901867&amp;sr=8-1&amp;keywords=linear+expression+martino
     
    ;;; PAT MARTINO LINEAR Expressions Lick Generator JAZZ IDIOMS (setf r0 '(s) r1 '(s s s s) r2 '(s s s s s s s s) r3 '(s s s s) r4 '(s s s s) r5 '(s s s s s s s s) r6 '(s s s s s s s s) r7 '(s s s s s s s s) r8 '(s s s s s s s s) r9 '(s s s s s s s s) r10 '(s s s s s s s s)) (setf p0 '(g3 a3 bb3 c4 cs4 d4 f4 d4) p1 '(e4 fs4 g4 a4 c5 a4 bb4 d5) p2 '(f5 a5 ab5 e5 g5 f5 e5 d5) p3 '(c5 a4 bb4 d5 a4 bb4 a4 g4) p4 '(a3 bb3 d4 f4 a4 bb4 a4 ab4) p5 '(g4 a4 bb4 c5 d5 f5 a5 c6) p6 '(bb5 d5 f5 a5 g5 gb5 f5 g5) p7 '(e5 f5 e5 d5 c5 a4 g4 a4) p8 '(d4 e4 fs4 a4 fs4 g4 a4 c5) p9 '(a4 bb4 d5 f5 a5 bb5 a5 ab5) p10 '(g5 f5 d5 ds5 e5 g5 bb5 d6)) (setf v0 '(f) v1 '(mp) v2 '(f) v3 '(pp) v4 '(p f mf) v5 '(fff) v6 '(fff) v7 '(mf) v8 '(p) v9 '(f) v10 '(ff)) (setf sec (gen-repeat 10 (rnd-unique 12 '(0 1 2 3 4 5 6 7 8 9 10) ))) (setf r-list (assemble-section 'r sec)) (setf p-list (assemble-section 'p sec)) (setf v-list (assemble-section 'v sec)) (setf phrases (make-omn :length r-list :pitch p-list :velocity v-list)) (def-score collage (:key-signature 'atonal :time-signature '(2 4) :tempo 144 :layout (piano-grand-layout 'piano)) (piano :omn phrases :channel 1 :sound 'gm :program 0) )  
  15. Thanks
    AM got a reaction from JulioHerrlein in how to number pitches   
    this is the simple solution...
    (defun add-numbers-to-text-attributes (a b) (loop for i from a to b append (add-text-attributes (list (compress (list 'nr i)) (write-to-string i))))) (add-numbers-to-text-attributes 12 23) => (nr12 nr13 nr14 nr15 nr16 nr17 nr18 nr19 nr20 nr21 nr22 nr23)  
  16. Like
    AM reacted to opmo in MIDI-pitch-bend-messages   
    Great piece, thank you for sharing.
    I will download the CT demo version and will see what can be done.
  17. Thanks
    AM got a reaction from lviklund in MIDI-pitch-bend-messages   
    I do not work / almost never with DAW's. OPMO (before pwgl) and sibelius.
    i think the conTimbre library is much better - not all samples are quite perfect, but the selection of playing techniques eg. in the strings or in the drums is just very good. my last piece was for ensemble, virtual conductor and e-player (a piece whitch generates its form in quasi-realtime (completely new every time) - by sochastic/markov-procedures)
     
     
    - it was possible to play the add-SCORE from the library directly at the concert (midi-files read out with flexible tempo and played on CT) without any problems - mix extremely well with the live instruments. 
     
    I do not think the library is very user-friendly, but I do not produce music (i compose, which - in my view - is a different kind of thinking), so that's not so important for me. but it contains many extra features and (or information about sound analysis (and apparently a direct access to LISP to make algorithmic orchestrations)
    as I said, not quite smart designed, but the possibilities (compared to the IRCAM library) I feel as much bigger. CT can now also play well from SIBELIUS / FINALE over VST.
     
    so I would be much happier if CT ran so well (with microtonal stuff) on OPUSMODUS.
  18. Like
    AM got a reaction from JulioHerrlein in respell/enharmonic change   
    code it, julio!! 🙂
     
     
  19. Like
    AM got a reaction from opmo in MIDI-pitch-bend-messages   
    I do not work / almost never with DAW's. OPMO (before pwgl) and sibelius.
    i think the conTimbre library is much better - not all samples are quite perfect, but the selection of playing techniques eg. in the strings or in the drums is just very good. my last piece was for ensemble, virtual conductor and e-player (a piece whitch generates its form in quasi-realtime (completely new every time) - by sochastic/markov-procedures)
     
     
    - it was possible to play the add-SCORE from the library directly at the concert (midi-files read out with flexible tempo and played on CT) without any problems - mix extremely well with the live instruments. 
     
    I do not think the library is very user-friendly, but I do not produce music (i compose, which - in my view - is a different kind of thinking), so that's not so important for me. but it contains many extra features and (or information about sound analysis (and apparently a direct access to LISP to make algorithmic orchestrations)
    as I said, not quite smart designed, but the possibilities (compared to the IRCAM library) I feel as much bigger. CT can now also play well from SIBELIUS / FINALE over VST.
     
    so I would be much happier if CT ran so well (with microtonal stuff) on OPUSMODUS.
  20. Like
    AM got a reaction from torstenanders in add tuning float to single-events?   
    dear janusz
     
    is there an OPMO-solution to put the FLOAT for tuning in every event (with pitch) . some times ago i coded such an "add-data-to-event"-function for my own, but a OPMO-one would be more professional 🙂
     
    greetings
    andré
  21. Like
    AM reacted to JulioHerrlein in Giant Steps Improvisation generator   
    Hello, All
     
    The idea is to generate some improvised lines over the Giant Steps progression.
    Every time the code is evaluated, a different comping and improvisation is generated.
    In this first effort, the improvisation is generated by the arpeggios resultating from the voice-leading of the progression.
    After that, I want to code some superimpositions of other chord substitutions.
     
    This is something I came with after studying the Harmonic-Path Function ( through some example by Stephane Boussuge)
    I also got some Drums from Jazz Trio, by Janusz Podrazik.
    Below is the commented code and an mp3 showing the result.
     
    All the best,
     
    Julio
     
    gsteps_GEN2.mp3
     
    ;; Giant Steps Progression provided as Harmonic Path. ;; Some chords are repeated (the chords that last more time). (setf harmpath '((h (b3 maj7) (d3 7)) (h (g3 maj7) (bb3 7)) (h (eb3 maj7) (eb3 maj7)) (h (a3 m7) (d3 7)) (h (g3 maj7) (bb3 7)) (h (eb3 maj7) (gb3 7)) (h (b3 maj7) (b3 maj7)) (h (f3 m7) (bb3 7)) (h (eb3 maj7) (eb3 maj7)) (h (a3 m7) (d3 7)) (h (g3 maj7) (g3 maj7)) (h (cs3 m7) (fs3 7)) (h (b3 maj7) (b3 maj7)) (h (f3 m7) (bb3 7)) (h (eb maj7) (eb maj7)) (h (cs3 m7) (fs3 7))) ;; Just the Roots from the chord progression: for building the bassline later. basshpath (pitch-demix 4 harmpath) ;; Taking out the rhythm information of the bassline OMN, ;; organizing sublist of 1 element for repeating the tones twice, ;; preparing for another rhythm purposes. basspitches (gen-repeat 6 (flatten (gen-repeat '(2) (gen-divide 1 (flatten (omn :pitch (ambitus '(e1 g2) basshpath))))))) ;; Using the same harmonic path as a voice leading comping and repeating it ;; in the same way I did with the bass line (twice each chord). ;; Bass line and comping will have the same rhythm kicks. comping (gen-repeat '(2) (gen-divide 1 (flatten (omn :pitch (chord-closest-path '(b3c4e4g4) '((h (b3 maj7) (d3 7)) (h (g3 maj7) (bb3 7)) (h (eb3 maj7) (eb3 maj7)) (h (a3 m7) (d3 7)) (h (g3 maj7) (bb3 7)) (h (eb3 maj7) (gb3 7)) (h (b3 maj7) (b3 maj7)) (h (f3 m7) (bb3 7)) (h (eb3 maj7) (eb3 maj7)) (h (a3 m7) (d3 7)) (h (g3 maj7) (g3 maj7)) (h (cs3 m7) (fs3 7)) (h (b3 maj7) (b3 maj7)) (h (f3 m7) (bb3 7)) (h (eb maj7) (eb maj7)) (h (cs3 m7) (fs3 7)))))))) ;; MELODIZANDO HAR-PATH. Melodizing the same voice-leading of the comping ;; to get the arpeggios for soloing. melodia (flatten (pitch-melodize (chord-closest-path '(b3c4e4g4) '((h (b3 maj7) (d3 7)) (h (g3 maj7) (bb3 7)) (h (eb3 maj7) (eb3 maj7)) (h (a3 m7) (d3 7)) (h (g3 maj7) (bb3 7)) (h (eb3 maj7) (gb3 7)) (h (b3 maj7) (b3 maj7)) (h (f3 m7) (bb3 7)) (h (eb3 maj7) (eb3 maj7)) (h (a3 m7) (d3 7)) (h (g3 maj7) (g3 maj7)) (h (cs3 m7) (fs3 7)) (h (b3 maj7) (b3 maj7)) (h (f3 m7) (bb3 7)) (h (eb maj7) (eb maj7)) (h (cs3 m7) (fs3 7)))))) ;; Repeating the melody list some times. gstepspitches (gen-repeat 6 (flatten (omn :pitch melodia))) ) ;; Defining and randomizing rhythms. (setf r1 (rnd-order '((s s s s -s -s -s -s))) r2 (rnd-order '((s s s s -s -s -s -s))) r3 (rnd-order '((s s s s -s -s -s -s))) r4 (rnd-order '((s s s s -s -s -s -s))) r5 (rnd-order '((s s s s -s -s -s -s))) r6 (rnd-order '((s s s s -s -s -s -s))) r7 (rnd-order '((s s s s -s -s -s -s))) r8 (rnd-order '((s s s s -s -s -s -s))) r9 (rnd-order '((s -s -s -s))) r9b (rnd-order '((s -s -s -s))) r10 '(s -s -s -s) r11 (rnd-order '((s s s -s))) r12 '(-s -s -s -s) rhy2 (flatten (apply-eval (rnd-order '((r1 r2 r3 r4 r5 r6 r7 r8 r1 r2 r3 r4 r5 r6 r7 r8 r1 r2 r3 r4 r5 r6 r7 r8 r1 r2 r3 r4 r5 r6 r7 r8 r1 r2 r3 r4 r5 r6 r7 r8 r1 r2 r3 r4 r5 r6 r7 r8))))) rhyinv (length-invert rhy2) bdbsch (gen-repeat 6 (flatten (apply-eval (rnd-order '((r10 r9 r10 r9b r9 r10 r9 r10 r9b r9 r10 r9 r10 r9b r9 r10 r9 r10 r9b r9 r10 r9 r10 r9b r9 r10 r9 r10 r9b r9 r10 r9 r10 r9b r9 r10 r9 r10 r9b r9 r10 r9 r10 r9b r9))))))) ;; Setting Up OMN for each instrument. (setf gssolo (make-omn :length rhy2 :pitch gstepspitches :velocity (rnd-order'(mf p f p ff mf))) bassline (make-omn :length bdbsch :pitch basspitches :velocity (rnd-order'(mf p f p ff mf))) pnocomp (make-omn :length bdbsch :pitch comping :velocity (rnd-order'(mf p f p ff mf))) ) ;;--------------------------------------------------------- ;; Some Drums ;; (From Janusz Jazz Trio, with some tweaks in the hats) ;;--------------------------------------------------------- (setf hh1 (length-span 8/4 '(-s gs2 ff))) ;(setf oh1 (length-span 8/4 '(-s - bb2 ff -))) ;(setf ch1 (length-span 8/4 '(s fs2 ff -))) (setf sn1 (length-span 8/4 '(-e d2 - - a2 - - s = q f2 e))) (setf bd1 (length-span 8/4 '(-s b1 ff e c2 = -e. e = -e. -s))) (setf hh (rnd-order (gen-repeat 18 (list hh1)))) ;(setf oh (rnd-order (gen-repeat 18 (list oh1)))) ;(setf ch (rnd-order (gen-repeat 18 (list ch1)))) (setf sn (pitch-figurate '(3 2) (rnd-order (gen-repeat 18 (list sn1))) :interval '(-1 -2 14))) (setf bd (rnd-order (gen-repeat 18 (list bd1)))) ;; ------- SCORE (adapted from Harmonic Path Study, Boussuge) (def-score giant-steps-vl-improv (:title "giant-steps-vl-improv" :composer "Julio Herrlein" :copyright "Copyright © 2018 HERRLEIN" :key-signature '(c maj) :time-signature '(4 4) :tempo 124 :ignore-velocity t :layout (list (xylophone-single-layout 'i1) (guitar-layout 'i2) (contrabass-layout 'i3))) (i1 :omn gssolo :channel 1 :sound 'gm :program 'Clarinet :volume 100) (i2 :omn pnocomp :channel 2 :sound 'gm :program 'Electric-Piano-1 :volume 80) (i3 :omn bassline :channel 4 :sound 'gm :program 'Electric-Bass-Finger :volume 100) (hh :omn hh :channel 10 :sound 'gm :program 0 :volume 70) ;(oh :omn oh) ;(ch :omn oh) (sn :omn sn) (bd :omn bd) )  
  22. Like
    AM reacted to opmo in text-attributes above rests (or how to number events)   
    I will see what I can do.
  23. Like
    AM reacted to opmo in Circle-Pitch-Plot   
    A new CIRCLE-PITCH-PLOT function (examples below) will be part of the forthcoming Opusmodus 1.3.
     
    The function CIRCLE-PIOTCH-PLOT returns a geometrical representation of relationships among the 12 pitch classes of the chromatic scale in pitch class space and provides an easy way to identify patterns and similarities between harmonic structures.
     
    Clockwise motion represents ascending pitch motion, and counterclockwise motion represents descending pitch motion.
     
    Examples:
     
    Major Triad
    (circle-pitch-plot '(c4e4g4))
     
    Minor Triad
    (circle-pitch-plot '(c4f4ab4))
     
    Augmented Triad
    (circle-pitch-plot '(c4e4gs4))
     
    All 4 augmented triads
    (circle-pitch-plot '(c4e4gs4 db4f4a4 d4fs4bb4 eb4g4b4))
     
     
    With :style :fill
    (circle-pitch-plot '(c4e4gs4 db4f4a4 d4fs4bb4 eb4g4b4) :style :fill)
     
    Example with chord names.
    Fully-Diminished 7th Chord
    (circle-pitch-plot 'dim7)
     
    All 3 fully-diminished 7th chords
    (circle-pitch-plot '((c4 dim7) (cs4 dim7) (d4 dim7)))
     
    Whole-Tone Scale
    (circle-pitch-plot '(0 2 4 6 8 10))
     
    The complex of 2 Whole-Tone Scale
    (circle-pitch-plot '((0 2 4 6 8 10) (1 3 5 7 9 11)) :style :fill)
     
    Chromatic Scale
    (circle-pitch-plot 'chromatic :point-radius 4)
     
    The complex of 6 tritones
    (circle-pitch-plot '((0 6) (1 7) (2 8) (3 9) (4 10) (5 11)) :point-radius 4)
     
    Tonalities
    (circle-pitch-plot 'mixolydian-greek :point-radius 4)
    (circle-pitch-plot 'bartok :point-radius 4)
    (circle-pitch-plot 'messiaen-mode3 :point-radius 4)
    (circle-pitch-plot 'hyojo :point-radius 4)
     
    Contrary Motion
    (circle-pitch-plot '(0 1 11 2 10 3 9 4 8 5 7 6)              :sort nil :join-first nil)
    (circle-pitch-plot '((0 1) (0 2) (0 3) (0 4) (0 5) (0 6)                (0 7) (0 8) (0 9) (0 10) (0 11)) :point-radius 4)
     
    Example with Forte notation
    (circle-pitch-plot '(6-32 6-7))
     
    Example with omn-form sequence and :type :pitches
     
    (circle-pitch-plot '(((leg s g2 p dbow+sul d3 sul b3 dig1 a3 b3 d3 b3 d3)                 (leg g2 d3 b3 a3 b3 d3 b3 d3)))              :type :pitches)  

     
    Circle types
    (circle-pitch-plot '((4 9 11) (3 5 10) (0 3 6 9)) :style :fill)
    (circle-pitch-plot '((4 9 11) (3 5 10) (0 3 6 9))              :type :pitches :style :fill)  

    (circle-pitch-plot '((4 9 11) (3 5 10) (0 3 6 9))              :type :fifths :style :fill)  

     
    Examples with :sort and :remove-duplicates set to nil
    (circle-pitch-plot '(0 2 6 0 3 7 0 4 8))
    (circle-pitch-plot '(0 2 6 0 3 7 0 4 8) :sort nil)
    (circle-pitch-plot '(0 2 6 0 3 7 0 4 8)              :sort nil :remove-duplicates nil)
    (circle-pitch-plot '(0 2 6 0 3 7 0 4 8)              :sort nil :remove-duplicates nil :join-first nil)  

    (circle-pitch-plot '(8 4 2 0 10 2 8 10 4 6 8)              :sort nil :remove-duplicates nil)
     
    Best wishes,
    Janusz
  24. Thanks
    AM got a reaction from loopyc in count-up/down   
    use it or not...
    greetings
    andré
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; count-up/down => not well coded but it works ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; A FUNCTION which counts a integer-list from its values (individual) ;;; to value B (all the same end-value :to (default is 1)) ;;; n => how many output values (approx: depends on input/round... was not important for my project) ;;; up or down (default is 'down) ;;; with variabel STEPS => sequencieally (horizontal) or with steps for each value individiual (vertical) ;;; with COUNT => means how many lists with same values (like "global-steps") ;;; SUB (defun round-to (number precision &optional (what #'round)) (let ((div (expt 10 precision))) (/ (funcall what (* number div)) div))) ;;; MAIN (defun count-up/down (n intlist &key (steps '(1)) (count 1) (type 'horizontal) (direction 'down) (to 1)) (let* ((cycles (round-to (/ (1- n) (length intlist)) 0)) (intlists (cond ((equal type 'horizontal) (loop repeat cycles for cnt = 0 then (incf cnt) for stp in (if (< (length steps) cycles) (filter-first cycles (flatten (gen-repeat cycles steps))) steps) when (= cnt 0) append (loop repeat count collect intlist) when (integerp (/ cnt count)) collect (setf intlist (if (equal direction 'down) (loop for i in intlist when (>= (- i stp) to) collect (- i stp) else collect to) (loop for i in intlist when (<= (+ i stp) to) collect (+ i stp) else collect to))) else collect intlist)) ((equal type 'vertical) (loop repeat cycles for cnt = 0 then (incf cnt) when (= cnt 0) append (loop repeat count collect intlist) when (integerp (/ cnt count)) collect (setf intlist (if (equal direction 'down) (loop for i in intlist for stp in steps when (>= (- i stp) to) collect (- i stp) else collect to) (loop for i in intlist for stp in steps when (<= (+ i stp) to) collect (+ i stp) else collect to))) else collect intlist))))) (loop repeat cycles for x in intlists collect x))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; SIMPLE EXAMPLES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (list-plot (flatten (count-up/down 100 '(9 8 7 6 7 9 8 7 6 7) :to 3 :direction 'down)) :join-points t) => ((9 8 7 6 7 9 8 7 6 7) (8 7 6 5 6 8 7 6 5 6) (7 6 5 4 5 7 6 5 4 5) (6 5 4 3 4 6 5 4 3 4) (5 4 3 3 3 5 4 3 3 3) (4 3 3 3 3 4 3 3 3 3) (3 3 3 3 3 3 3 3 3 3) (3 3 3 3 3 3 3 3 3 3) (3 3 3 3 3 3 3 3 3 3) (3 3 3 3 3 3 3 3 3 3)) (list-plot (flatten (count-up/down 100 '(9 8 7 6 7 9 8 7 6 7) :count 2 :to 5 :direction 'down)) :join-points t) => ((9 8 7 6 7 9 8 7 6 7) (9 8 7 6 7 9 8 7 6 7) (8 7 6 5 6 8 7 6 5 6) (8 7 6 5 6 8 7 6 5 6) (7 6 5 5 5 7 6 5 5 5) (7 6 5 5 5 7 6 5 5 5) (6 5 5 5 5 6 5 5 5 5) (6 5 5 5 5 6 5 5 5 5) (5 5 5 5 5 5 5 5 5 5) (5 5 5 5 5 5 5 5 5 5)) (list-plot (flatten (count-up/down 100 '(9 8 7 6 7 9 8 7 6 7) :to 15 :direction 'up)) :join-points t) => ((9 8 7 6 7 9 8 7 6 7) (10 9 8 7 8 10 9 8 7 8) (11 10 9 8 9 11 10 9 8 9) (12 11 10 9 10 12 11 10 9 10) (13 12 11 10 11 13 12 11 10 11) (14 13 12 11 12 14 13 12 11 12) (15 14 13 12 13 15 14 13 12 13) (15 15 14 13 14 15 15 14 13 14) (15 15 15 14 15 15 15 15 14 15) (15 15 15 15 15 15 15 15 15 15)) (list-plot (flatten (count-up/down 200 '(9 8 7 6 7 9 8 7 6 7) :count 2 :to 15 :direction 'up)) :join-points t) => ((9 8 7 6 7 9 8 7 6 7) (9 8 7 6 7 9 8 7 6 7) (10 9 8 7 8 10 9 8 7 8) (10 9 8 7 8 10 9 8 7 8) (11 10 9 8 9 11 10 9 8 9) (11 10 9 8 9 11 10 9 8 9) (12 11 10 9 10 12 11 10 9 10) (12 11 10 9 10 12 11 10 9 10) (13 12 11 10 11 13 12 11 10 11) (13 12 11 10 11 13 12 11 10 11) (14 13 12 11 12 14 13 12 11 12) (14 13 12 11 12 14 13 12 11 12) (15 14 13 12 13 15 14 13 12 13) (15 14 13 12 13 15 14 13 12 13) (15 15 14 13 14 15 15 14 13 14) (15 15 14 13 14 15 15 14 13 14) (15 15 15 14 15 15 15 15 14 15) (15 15 15 14 15 15 15 15 14 15) (15 15 15 15 15 15 15 15 15 15) (15 15 15 15 15 15 15 15 15 15)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; MORE COMPLEX/INTERESTING EXAMPLES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; horizontal means every cycle has a new step-value (list-plot (flatten (count-up/down 100 '(9 8 7 6 7 15 8 7 6 7) :steps '(1 2 1 1 1 1 1 1 1 1) :type 'horizontal :to 2)) :join-points t) => ((9 8 7 6 7 15 8 7 6 7) (8 7 6 5 6 14 7 6 5 6) (6 5 4 3 4 12 5 4 3 4) (5 4 3 2 3 11 4 3 2 3) (4 3 2 2 2 10 3 2 2 2) (3 2 2 2 2 9 2 2 2 2) (2 2 2 2 2 8 2 2 2 2) (2 2 2 2 2 7 2 2 2 2) (2 2 2 2 2 6 2 2 2 2) (2 2 2 2 2 5 2 2 2 2)) ;; vertical means every value has its individual step (list-plot (flatten (count-up/down 100 '(9 8 7 6 7 30 8 7 6 7) :steps '(1 2 1 1 1 5 1 1 1 1) :type 'vertical :to 2)) :join-points t) => ((9 8 7 6 7 30 8 7 6 7) (8 6 6 5 6 25 7 6 5 6) (7 4 5 4 5 20 6 5 4 5) (6 2 4 3 4 15 5 4 3 4) (5 2 3 2 3 10 4 3 2 3) (4 2 2 2 2 5 3 2 2 2) (3 2 2 2 2 2 2 2 2 2) (2 2 2 2 2 2 2 2 2 2) (2 2 2 2 2 2 2 2 2 2) (2 2 2 2 2 2 2 2 2 2)) (list-plot (flatten (count-up/down 100 '(9 8 7 6 7 30 8 7 6 7) :steps '(1 2 1 3 1 5 3 1 2 1) :type 'vertical :to 1)) :join-points t)  
    could be extended: would be nice if the END-VALUE (:to)  would/could be also "in between" the start values... start '(6 7 5 1 2 3 9 19)  => :to 4  => values incf, and decf to 4
  25. Thanks
    AM got a reaction from loopyc in count-up/down   
    a less flexible version but with nicer output/usage...
    greetings
     
    (defun round-to (number precision &optional (what #'round)) (let ((div (expt 10 precision))) (/ (funcall what (* number div)) div))) ;;; (defun incf/decf-alist (n alist &key (steps '(1 2)) (end 1)) (let ((span (round-to (/ n (length alist)) 0))) (progn (setf alist (loop for start in alist for step in (if (< (length steps) (length alist)) (filter-first (length alist) (loop repeat (length alist) append steps)) steps) when (> start end) collect (loop for i from start downto end by step collect i) else collect (loop for i from start to end by step collect i))) (setf alist (loop for i in alist collect (append i (gen-repeat (- span (length i)) end)))) (loop repeat (length (car alist)) for cnt = 0 then (incf cnt) collect (loop for i in alist collect (nth cnt i)))))) (list-plot (flatten (incf/decf-alist 90 '(9 8 7 1 7 30 8 7 6 1) :steps '(1 2 1 3 1 5 3 1 2 1) :end 11)) :join-points t) =>((9 8 7 1 7 30 8 7 6 1) (10 10 8 4 8 25 11 8 8 2) (11 11 9 7 9 20 11 9 10 3) (11 11 10 10 10 15 11 10 11 4) (11 11 11 11 11 11 11 11 11 5) (11 11 11 11 11 11 11 11 11 6) (11 11 11 11 11 11 11 11 11 7) (11 11 11 11 11 11 11 11 11 8) (11 11 11 11 11 11 11 11 11 9))
     
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy