Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 04/24/2018 in all areas

  1. 3 points
    AM

    gen-brownian-bridge

    something new... greetings andré ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; BROWNIAN BRIDGE -> could be use as a rnd-process from A to B (integers or pitches) ;;; if you have a look to example with ":all-gen t", you will see the process with all generations, how it works ;;; or take a look to: ;;; https://de.wikipedia.org/wiki/Wiener-Prozess#/media/File:BrownscheBewegung.png ;;; https://de.wikipedia.org/wiki/Brownsche_Brücke ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; SUB (defun pick (a b &key (span 5)) (let ((rnd1 (car (rnd-number 1 (+ a span) (- a span)))) (rnd2 (car (rnd-number 1 (+ b span) (- b span)))) (n)) (progn (setf n (car (rnd-number 1 rnd1 rnd2))) (if (or (= n a) (= n b)) (+ (rnd-pick '(1 -1)) n) n)))) ;;; MAIN ;;; MAIN (defun gen-brownian-bridge (n startend &key (all-gen nil) (output 'integer) (span 5)) (let ((seq)) (progn (setf seq (append (list startend) (loop repeat n with liste = startend do (setf liste (filter-repeat 1 (loop repeat (1- (length liste)) for cnt = 0 then (incf cnt) append (append (list (nth cnt liste) (pick (nth cnt liste) (nth (1+ cnt) liste) :span span) (nth (1+ cnt) liste)))))) collect liste))) (setf seq (if (equal all-gen t) seq (car (last seq)))) (if (equal output 'pitch) (integer-to-pitch seq) seq)))) ;;; EXAMPLES ;; SPAN influence -> span 2 (list-plot (gen-brownian-bridge 5 '(50 23) :span 2 :all-gen t) :zero-based t :point-radius 3 :join-points t) ;; SPAN influence -> span 10 (list-plot (gen-brownian-bridge 5 '(50 23) :span 20 :all-gen t) :zero-based t :point-radius 3 :join-points t) ;;; SPAN default (5) (list-plot (gen-brownian-bridge 5 '(50 23) :all-gen t) :zero-based t :point-radius 3 :join-points t) (list-plot (gen-brownian-bridge 5 '(50 23)) :zero-based t :point-radius 3 :join-points t) (gen-brownian-bridge 5 '(50 23) :all-gen t :output 'pitch) (gen-brownian-bridge 5 '(50 23) :output 'pitch) some sound-examples ;;; EXAMPLE with ALL GENS / seperated by rests (def-score brownian-bridge (:title "score title" :key-signature 'atonal :time-signature '(4 4) :tempo 72) (instrument :omn (make-omn :pitch (setf n (gen-brownian-bridge 5 '(30 10) :all-gen t :output 'pitch)) :length (loop for i in n append (list '-1/4 (loop repeat (length i) append '(t)))) :span :pitch) :channel 1 :sound 'gm :program 'acoustic-grand-piano)) ;;; EXAMPLE with LAST GEN -> rnd-evaluations => rnd-ways from a to b (def-score brownian-bridge (:title "score title" :key-signature 'atonal :time-signature '(4 4) :tempo 72) (instrument :omn (make-omn :pitch (gen-brownian-bridge (car (rnd-number 1 2 7)) '(30 10) :output 'pitch) :length '(t) :span :pitch) :channel 1 :sound 'gm :program 'acoustic-grand-piano)) two examples with different SPAN on MESSIEAN's mode5 mapped with <tonality-map> ;;; on MESSIAENS- mode5 - > 8 cycles + SPAN 10 => bigger intervals/steps (def-score brownian-bridge (:title "score title" :key-signature 'atonal :time-signature '(4 4) :tempo 90) (instrument :omn (make-omn :pitch (setf n (tonality-map '(messiaen-mode5 :map step :root 'fs3) (integer-to-pitch (gen-brownian-bridge 8 '(10 27) :span 10 :all-gen t)))) :length (loop for i in n append (list '-1/4 (loop repeat (length i) append '(t)))) :span :pitch) :channel 1 :sound 'gm :program 'acoustic-grand-piano)) ;;; on MESSIAENS- mode5 - > 8 cycles + SPAN 3 => smaller intervals/steps (def-score brownian-bridge (:title "score title" :key-signature 'atonal :time-signature '(4 4) :tempo 90) (instrument :omn (make-omn :pitch (setf n (tonality-map '(messiaen-mode5 :map step :root 'fs3) (integer-to-pitch (gen-brownian-bridge 8 '(10 27) :span 3 :all-gen t)))) :length (loop for i in n append (list '-1/4 (loop repeat (length i) append '(t)))) :span :pitch) :channel 1 :sound 'gm :program 'acoustic-grand-piano))
  2. 3 points
    AM

    sorting algorithms

    i solved the problems. here is a workspace/files to experiment with SORTING ALGORITHMS thanx to torsten and philippe! greetings andré functions.opmo abstract examples.opmo sound examples.opmo sorting algorithms.opmows
  3. 2 points
    I will make some changes to the TONALITY-MAP which will allow us to use scales lager then an octave.
  4. 2 points
    opmo

    mapping integer?

    There is an internal function which expand any scale (a sequence) to a total octaves span with ambitus from -60 to 67. I will make a document for it.
  5. 2 points
    Stephane Boussuge

    mapping integer?

    With vector-map function, you can map anything: (vector-map (expand-tonality '(c4 messiaen-mode5)) '(0 1 2 3 4 2 1 5 3 1)) SB.
  6. 2 points
    opmo

    Opusmodus 1.2.23267

    View File Opusmodus 1.2.23267 New function: GEN-SORT, thanks to Andre Meier and Torsten Anders. I have extended the functionality and made it more into a Opusmodus function. The function GEN-SORT sorts a sequence with a given type function and returns all the generations of the sorting process. Examples: (setf seq (rnd-order (gen-integer 11) :seed 49)) => (5 11 4 1 2 0 7 10 9 8 3 6) (gen-sort seq) => ((5 11 4 1 2 0 7 10 9 8 3 6) (5 4 11 1 2 0 7 10 9 8 3 6) (5 4 1 11 2 0 7 10 9 8 3 6) (5 4 1 2 11 0 7 10 9 8 3 6) (5 4 1 2 0 11 7 10 9 8 3 6) (5 4 1 2 0 7 11 10 9 8 3 6) (5 4 1 2 0 7 10 11 9 8 3 6) (5 4 1 2 0 7 10 9 11 8 3 6) (5 4 1 2 0 7 10 9 8 11 3 6) (5 4 1 2 0 7 10 9 8 3 11 6) (5 4 1 2 0 7 10 9 8 3 6 11) (4 5 1 2 0 7 10 9 8 3 6 11) (4 1 5 2 0 7 10 9 8 3 6 11) (4 1 2 5 0 7 10 9 8 3 6 11) (4 1 2 0 5 7 10 9 8 3 6 11) (4 1 2 0 5 7 9 10 8 3 6 11) (4 1 2 0 5 7 9 8 10 3 6 11) (4 1 2 0 5 7 9 8 3 10 6 11) (4 1 2 0 5 7 9 8 3 6 10 11) (1 4 2 0 5 7 9 8 3 6 10 11) (1 2 4 0 5 7 9 8 3 6 10 11) (1 2 0 4 5 7 9 8 3 6 10 11) (1 2 0 4 5 7 8 9 3 6 10 11) (1 2 0 4 5 7 8 3 9 6 10 11) (1 2 0 4 5 7 8 3 6 9 10 11) (1 0 2 4 5 7 8 3 6 9 10 11) (1 0 2 4 5 7 3 8 6 9 10 11) (1 0 2 4 5 7 3 6 8 9 10 11) (0 1 2 4 5 7 3 6 8 9 10 11) (0 1 2 4 5 3 7 6 8 9 10 11) (0 1 2 4 5 3 6 7 8 9 10 11) (0 1 2 4 3 5 6 7 8 9 10 11) (0 1 2 3 4 5 6 7 8 9 10 11)) In the first part of the document we visualise the results of the different types using the LIST-PLOT function. (setf values (rnd-number 20 1 10 :seed 2346)) => (1 5 1 7 9 6 7 4 4 1 8 9 4 10 6 4 3 4 10 9) Type NIL (bubble sort): Ascending: (list-plot (flatten (gen-sort values)) :zero-based t :point-radius 1 :join-points t) Descending: (list-plot (flatten (gen-sort values :sort '>)) :zero-based t :point-radius 1 :join-points t) Each sort generation (ascending or descending) selected at random: (list-plot (flatten (gen-sort values :sort '? :seed 1345)) :zero-based t :point-radius 1 :join-points t) Five step process: (list-plot (flatten (gen-sort values :step 5)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values :sort '> :step 5)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values :sort '? :step 5 :seed 1345)) :zero-based t :point-radius 1 :join-points t) Examples with type selection: (list-plot (flatten (gen-sort values :type 'selection)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values :type 'selection :sort '>)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values :type 'selection :sort '? :seed 1345)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values :type 'selection :step 5)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values :type 'selection :sort '> :step 5)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values :type 'selection :sort '? :step 5 :seed 1345)) :zero-based t :point-radius 1 :join-points t) Examples with type insertion: (list-plot (flatten (gen-sort values :type 'insertion)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values :type 'insertion :sort '>)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values :type 'insertion :sort '? :seed 1345)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values :type 'insertion :step 5)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values :type 'insertion :sort '> :step 5)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values :type 'insertion :sort '? :step 5 :seed 1345)) :zero-based t :point-radius 1 :join-points t) Examples with type min-max: (setf values2 (rnd-number 50 1 50 :seed 346)) => (22 22 13 19 33 20 10 28 28 46 21 29 10 31 4 40 21 34 5 34 23 16 40 6 3 11 12 17 11 40 46 32 18 4 8 22 24 13 28 2 36 41 32 30 38 37 37 25 32 25) (list-plot (flatten (gen-sort values2 :type 'min-max)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values2 :type 'min-max :sort '>)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values2 :type 'min-max :sort '? :seed 1345)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values2 :type 'min-max :step 5)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values2 :type 'min-max :sort '> :step 5)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values2 :type 'min-max :sort '? :step 5 :seed 1345)) :zero-based t :point-radius 1 :join-points t) Examples with type divide and division values: By default there are three division lists '((2 3 4) (5 7 11) (17 11)) but you can use any number of list devisions. (list-plot (flatten (gen-sort values2 :type 'divide)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values2 :type 'divide :sort '>)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values2 :type 'divide :sort '? :seed 1345)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values2 :type 'divide :step 5)) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values2 :type 'divide :sort '> :division '((2 3 5) (6 13))) :zero-based t :point-radius 1 :join-points t) (list-plot (flatten (gen-sort values2 :type 'divide :sort '? :division '((3 6) (6 9) (2 4 6) (11 13)) :zero-based t :point-radius 1 :join-points t) The next few examples are with pitches and lengths values: (gen-sort (rnd-air :type :pitch) :step 6) => ((c4 cs4 bb4 d4 a4 b4 f4 eb4 gs4 e4 g4 fs4) (c4 cs4 d4 a4 bb4 f4 eb4 b4 gs4 e4 g4 fs4) (c4 cs4 d4 a4 bb4 f4 eb4 gs4 e4 g4 fs4 b4) (c4 cs4 d4 a4 f4 eb4 gs4 e4 bb4 g4 fs4 b4) (c4 cs4 d4 f4 eb4 a4 gs4 e4 g4 fs4 bb4 b4) (c4 cs4 d4 eb4 e4 f4 fs4 g4 gs4 a4 bb4 b4)) (gen-sort (rnd-air :type :pitch) :type 'divide) (gen-sort '(c2 d4 e3 g6 f5 c2 d4 e3 g6 f5) :type 'divide :seed 56 :division '((2 3) (1 3 6))) => ((c2 d4 e3 g6 f5 c2 d4 e3 g6 f5) (c2 d4 e3 f5 g6 c2 d4 e3 f5 g6) (c2 e3 d4 f5 c2 e3 d4 f5 g6 g6) (c2 c2 e3 e3 d4 d4 f5 f5 g6 g6)) (gen-sort '(s e e e s q q. s e e e s q q.) :type 'divide :division '((2 3) (4)) :omn t) => ((s e = = s q q. s e = = s q q.) (s e s e = q q. s e = s e q q.) (s = e = s e q q. s e = = q q.) (s = = = e = = = = = q = q. =)) OMN example: (make-omn :pitch (setf n (gen-sort (vector-to-pitch'(c4 bb5) (gen-white-noise 24)) :type 'min-max :step 5)) :length (gen-repeat (length n) (append (gen-repeat 24 '(t)) (list '-e))) ) (make-omn :pitch (setf n (gen-sort (vector-to-pitch '(c4 bb5) (gen-white-noise 24)) :type 'divide :sort '? :step 5 :division '((2 3 4) (3 4)))) :length (gen-repeat (length n) (append (gen-repeat 24 '(t)) (list '-e))) ) To explore the expressions and to see scores using the GEN-SORT function go to Howto Score/Sort/Sorting.opmo file which you find in the Utilities/Documents panel. Best wishes, Janusz Submitter opmo Submitted 04/28/2018 Category Opusmodus Latest Release
  7. 2 points
    opmo

    sorting algorithms

    A random sort '? - RND-PICK from ascending and descending result of a sequence. Ascending: (list-plot (flatten (sorting (rnd-number 20 1 10 :seed 2346) :type 'selection :sort '<)) :zero-based t :point-radius 1 :join-points t) Descending: (list-plot (flatten (sorting (rnd-number 20 1 10 :seed 2346) :type 'selection :sort '>)) :zero-based t :point-radius 1 :join-points t) At random: (list-plot (flatten (sorting (rnd-number 20 1 10 :seed 2346) :type 'selection :sort '?)) :zero-based t :point-radius 1 :join-points t) In 5 steps: (list-plot (flatten (sorting (rnd-number 20 1 10 :seed 2346) :type 'selection :sort '? :step 5)) :zero-based t :point-radius 1 :join-points t) The default sort is ascending.
  8. 2 points
    opmo

    sorting algorithms

    Will add the MIN-MAX as well to the SORTING function.
  9. 2 points
    AM

    sorting algorithms

    MIN/MAX-SORT a new function: min/max -> 1. max-pitch, 2. min-pitch, 3.rest of the seq .... starting next gen.... have a look at the list-plot. minmax-sort.opmo functions.opmo ;;; ordinary examples (make-omn :pitch (setf n (sorting (vector-to-pitch'(g4 eb5) (gen-white-noise 40)) :algorithm 'min/max)) :length (gen-repeat (length n) (append (gen-repeat 40 '(t)) (list '-e)))) (make-omn :pitch (setf n (sorting (vector-to-pitch'(g4 eb5) (gen-white-noise 40)) :algorithm 'min/max :n '>)) :length (gen-repeat (length n) (append (gen-repeat 40 '(t)) (list '-e)))) (make-omn :pitch (setf n (sorting (vector-to-pitch'(c4 bb5) (gen-white-noise 40)) :algorithm 'min/max)) :length (gen-repeat (length n) (append (gen-repeat 40 '(t)) (list '-e)))) (make-omn :pitch (setf n (sorting (vector-to-pitch'(c4 bb5) (gen-white-noise 40)) :algorithm 'min/max :n '>)) :length (gen-repeat (length n) (append (gen-repeat 40 '(t)) (list '-e)))) (make-omn :pitch (setf n (sorting (rnd-order '(g4 gs4 a4 bb4 b4 c5 cs5 d5 eb5 e5 f5 fs5)) :algorithm 'min/max)) :length (gen-repeat (length n) (append (gen-repeat 12 '(t)) (list '-e)))) (make-omn :pitch (setf n (sorting (rnd-order '(g4 gs4 a4 bb4 b4 c5 cs5 d5 eb5 e5 f5 fs5)) :algorithm 'min/max :n '>)) :length (gen-repeat (length n) (append (gen-repeat 12 '(t)) (list '-e)))) ;;; combined with filter-tie -> ties all pitch repetitions!! (filter-tie (make-omn :pitch (setf n (sorting (vector-to-pitch'(c4 bb5) (gen-white-noise 40)) :algorithm 'min/max)) :length (gen-repeat (length n) (append (gen-repeat 40 '(t)) (list '-e))))) (filter-tie (make-omn :pitch (setf n (sorting (vector-to-pitch'(c4 bb5) (gen-white-noise 40)) :algorithm 'min/max :n '>)) :length (gen-repeat (length n) (append (gen-repeat 40 '(t)) (list '-e))))) ;;; THREE SCORES with min/max (def-score example-score (:key-signature 'atonal :time-signature '(4 4) :tempo 120 :layout (piano-solo-layout 'rhand 'lhand)) (rhand :omn (make-omn :pitch (setf n (sorting (rnd-order '(g6 gs6 a6 bb6 b6 c7 cs7 d7 eb7 e7 f7 fs7)) :algorithm 'min/max :n '<)) :length (gen-repeat (length n) (append (gen-repeat 12 '(t)) (list '-e)))) :channel 1 :sound 'gm :program 0) (lhand :omn (make-omn :pitch (setf n (sorting (rnd-order '(g1 gs1 a1 bb1 b1 c2 cs2 d2 eb2 e2 f2 fs2)) :algorithm 'min/max :n '>)) :length (gen-repeat (length n) (append (gen-repeat 12 '(t)) (list '-e)))) :channel 2)) (def-score example-score (:key-signature 'atonal :time-signature '(4 4) :tempo 120 :layout (piano-solo-layout 'rhand 'lhand)) (rhand :omn (filter-tie (make-omn :pitch (setf n (sorting (rnd-repeat 100 '(g6 gs6 a6 bb6 b6 c7 cs7 d7 eb7 e7 f7 fs7)) :algorithm 'min/max :n '<)) :length (gen-repeat (length n) (append (gen-repeat 100 '(t)) (list '-e))))) :channel 1 :sound 'gm :program 0) (lhand :omn (filter-tie (make-omn :pitch (setf n (sorting (rnd-repeat 100 '(g1 gs1 a1 bb1 b1 c2 cs2 d2 eb2 e2 f2 fs2)) :algorithm 'min/max :n '>)) :length (gen-repeat (length n) (append (gen-repeat 100 '(t)) (list '-e))))) :channel 2)) (def-score example-score (:key-signature 'atonal :time-signature '(4 4) :tempo 120 :layout (piano-solo-layout 'rhand 'lhand)) (rhand :omn (filter-tie (make-omn :pitch (setf n (sorting (rnd-repeat 100 '(g6 gs6 a6 bb6 b6 c7 cs7)) :algorithm 'min/max :n '<)) :length (gen-repeat (length n) (append (gen-repeat 100 '(t)) (list '-e))))) :channel 1 :sound 'gm :program 0) (lhand :omn (filter-tie (make-omn :pitch (setf n (sorting (rnd-repeat 100 '(c2 cs2 d2 eb2 e2 f2 fs2)) :algorithm 'min/max :n '>)) :length (gen-repeat (length n) (append (gen-repeat 100 '(t)) (list '-e))))) :channel 2))
  10. 2 points
    torstenanders

    sorting algorithms

    Simply slightly edit the algorithms below by inserting some additional output. Below I simply took one of the algorithms you linked and added a single print statement. If instead you want to collect all the results, then just accumulate them in some variable with a scope surrounding your algorithm function. (defun bubble-sort/naive (sequence) (let ((end (length sequence))) (labels ((compare-and-swap (index modified) ;; print intermediate results (print sequence) (if (= index (1- end)) (if modified (compare-and-swap 0 nil) (values)) (let ((index+1 (1+ index))) (if (> (elt sequence index) (elt sequence index+1)) (let ((x (elt sequence index))) (setf (elt sequence index) (elt sequence index+1) (elt sequence index+1) x) (compare-and-swap index+1 t)) (compare-and-swap index+1 modified)))))) (unless (< end 2) (compare-and-swap 0 nil)) sequence))) (bubble-sort/naive '(3 1 9 5 3 6 4 2 3 7)) Best, Torsten
  11. 1 point
    opmo

    Opusmodus 1.2.23354

    View File Opusmodus 1.2.23354 New: All-Combinatorial Hexachords GEN-AC-HEXACHRD AC-HEXACHORD-COMPLEMENT-FORM-SET HEXACHORD-COMPLEMENT ________________________________ The function GEN-AC-HEXACHRD generate a hexachord (H1) set and its complement (H2) set form a given name (all-combinatorial hexachords) by randomising the order and applying an inversion into the the H1 set first. The result is a sequence with two hexachords, H1 and H2 or an aggregate (twelve-tone row). The AC in the function name stand for 'All-Combinatorial Hexachords'. All-Combinatorial Hexachords names and there pitch class prime form sets: A = (0 1 2 3 4 5) B = (0 2 3 4 5 7) C = (0 2 4 5 7 9) D = (0 1 2 6 7 8) E = (0 1 4 5 8 9) F = (0 2 4 6 8 10) All-Combinatorial Hexachords in Forte notation: (pcs-prime-form '((0 1 2 3 4 5) (0 2 3 4 5 7) (0 2 4 5 7 9) (0 1 2 6 7 8) (0 1 4 5 8 9) (0 2 4 6 8 10) ) :forte) => (6-1 6-8 6-32 6-7 6-20 6-35) Example: In the first example we use A set (0 1 2 3 4 5): (gen-ac-hexachord 'a) => ((6 4 3 1 5 2) (7 9 10 0 8 11)) Here the result is a twelve-tone row (aggregate): (gen-ac-hexachord 'b :aggregate t) => (11 7 2 9 10 0 4 8 1 6 5 3) In the example below the hexachords are generated from set C and with start 0: (gen-ac-hexachord 'c :start 0) => ((0 2 5 4 9 7) (3 1 10 11 6 8)) (gen-ac-hexachord 'd :aggregate t :start 7) => (7 11 5 1 0 6 8 4 10 2 3 9) (gen-ac-hexachord 'e) => ((0 9 8 1 5 4) (3 6 7 2 10 11)) (gen-ac-hexachord 'f :seed 456) => ((9 1 7 5 11 3) (4 0 6 8 2 10)) ________________________________ The function AC-HEXACHORD-COMPLEMENT-FORM-SET returns all form sets with all combinations of the complement hexachord (H2) set. Example: (setf ac-hex '((0 4 5 11 6 10) (7 3 1 2 9 8))) (ac-hexachord-complement-form-set ac-hex) => ((9 1 2 8 3 7) (3 7 8 2 9 1) (8 7 2 3 1 9) (2 1 8 9 7 3) (7 3 2 8 1 9) (1 9 8 2 7 3) (8 9 2 1 3 7) (2 3 8 7 9 1)) Here we reverse the hexachords order: (ac-hexachord-complement-form-set (reverse ac-hex)) => ((10 6 4 5 0 11) (4 0 10 11 6 5) (0 4 11 5 6 10) (6 10 5 11 0 4) (0 4 6 5 10 11) (6 10 0 11 4 5) (10 6 11 5 4 0) (4 0 5 11 10 6)) In the next example we generate the all-combinatorial hexachords with GEN-AC-HEXACHORD function: (setf hexachords (gen-ac-hexachord 'd :seed 965) => ((11 5 3 10 9 4) (6 0 2 7 8 1)) (ac-hexachord-complement-form-set hexachords) => ((8 2 0 7 6 1) (2 8 6 1 0 7) (1 6 7 0 2 8) (7 0 1 6 8 2) (6 0 2 7 8 1) (0 6 8 1 2 7) (1 8 7 2 0 6) (7 2 1 8 6 0)) To get the form set names we set the keyword :form-names to T: (ac-hexachord-complement-form-set (gen-ac-hexachord 'c :seed 965) :form-names t) => (p6 ri3 i9 r0) (rnd-octaves '(c2 c6) (rnd-order (get-form-set (gen-ac-hexachord 'c :seed 965) '(p6 ri3 i9 r0) :segment '(3 3) :type :pitch))) => ((gs3 c5 f5) (eb4 bb2 cs5) (d4 b4 g2) (e3 fs2 a2) (cs3 eb5 bb4) (f4 c4 gs2) (e5 fs3 a4) (g2 d3 b3) (f2 cs5 gs4) (eb5 bb3 c3) (d4 b4 fs3) (e5 a3 g5) (bb2 c4 eb5) (f3 cs4 gs4) (a3 e4 g2) (b2 d4 fs4)) ________________________________ This function collect complement pitch classes of a given hexachord. The combination of the hexachord and of the result will constitute the makeup of an aggregate (twelve-tone row). Example: (hexachord-complement '(0 1 2 6 7 8)) => (5 4 3 11 10 9) (hexachord-complement '(0 1 2 6 7 8) :pitch) => (f4 e4 eb4 b4 bb4 a4) ________________________________ Small changes to the documentation structure.Function name changes: 12tone-analysis -> twelve-tone-analysis 12tonep -> twelve-tonep 12tone-forms -> twelve-tone-matrix get-12tone -> twelve-tone-filter rnd-12tone-form -> rnd-form-set get-12tone-form -> get-form-set Transpose added to PCS-INVERT function: (pcs-invert (pcs '9-7) 0) => (0 11 10 9 8 7 5 4 2) (pcs-invert '((6 7 9 11 0 2 3) (1 3 6 9 0 11 4 7)) 0) => ((6 5 3 1 0 10 9) (11 9 6 3 0 1 8 5)) (pcs-invert '((6 7 9 11 0 2 3) (1 3 6 9 0 11 4 7)) 5) => ((11 10 8 6 5 3 2) (4 2 11 8 5 6 1 10)) (pcs-invert '((6 7 9 11 0 2 3) (1 3 6 9 0 11 4 7)) '(5 8)) => ((11 10 8 6 5 3 2) (7 5 2 11 8 9 4 1)) LENGTH-TEMPO-MAP function name changed to LENGTH-TO-TEMPO Fix to TIME-POINT-SYSTEM That's all for now, best wishes, JP Submitter opmo Submitted 05/10/2018 Category Opusmodus Latest Release
  12. 1 point
    Stephane Boussuge

    Opusmodus 1.2.23291

    Thank you very much, the spectra option in tonality map is exactly what i'm looking for. Wonderful tool !!! Thanks a lot S.
  13. 1 point
    opmo

    mapping <gen-sort> by <tonality-map>

    You can use the :span :pitch option if the master is the pitch: Example: (make-omn :pitch (tonality-map '(messiaen-mode5 :map step :root 'c4) sort-seq) :length '(t) :span :pitch) (make-omn :pitch (loop for i in sort-seq collect (nth i sieve)) :length '(t) :span :pitch)
  14. 1 point
    I like how the function tonality-map allows specifying some input harmony (called tonality) and raw music, where the "raw" music is then quasi-quantised into the given harmony. However, I would like to control in which octaves specific tones are allowed to occur. tonality-map allows specifying an underlying harmony that ranges over multiple octaves, but it seems that internally only octave-less pitch classes are used, and any tone in the harmony can occur in any octave in the result. By contrast, in the spectral tradition of music thinking, you change the underlying spectrum if you scramble in which octaves pitches occur. For example, if you have a spectrum or chord that approximates the overtone series, then that spectrum sounds rather consonant, regardless how far up in the overtone series you allow tones to be included. However, if you then randomly octave-transpose the pitches of this spectrum/chord, then it can become much more dissonant, without changing any pitch classes. To be more specific here is a dummy example with simple traditional chords where tones are distributed across octaves in a certain way. (tonality-map ;; underlying harmony or spectra '((c4g4e5b5d6) (g3d4b5f5a4)) ;; input music '((h c4f5 cs4fs5) (d4g5 cs4gs5) (eb4as5 f4a5) (e4gs5 c4gs5)) ;; harmonic rhythm :time '(w w w_w)) => ((h c4e5 c4g5) (h a3d5 g3d5) (h e4b5 e4b5) (h e4g5 c4g5)) As you can see, the tone G in the first tonality occurs only in octave 4, but in the result, in the second chord of the first bar (still following the first tonality) we have a g5 instead. Now, you might feel that the g5 does not musically do any harm, but in the second tonality, there is an A only in octave 6, while in the function output in the related third chord the A occurs three octaves lower in octave 3, where it greatly increases the dissonance degree of this chord/scale. So, is there a way to restrict the octaves of tones in the result to be restricted to the octaves of these tones in the respective tonalities? Alternatively, is there another function that complements tonality-map, where I can force some "raw" music to follow some underlying harmony with a given harmonic rhythm, and where the octaves of the resulting pitches can be restricted? Thank you! Best, Torsten
  15. 1 point
    AM

    mapping integer?

    i coded a function now, that maps all integers to all TONALITIES, like i want it... SORTING OLIVIER's MODI and going crazy 🙂 ;;; SUB (defun multiple-expand-tonality (&key startpitch octaves tonality) (remove-duplicates ;remove is for "cutting" if there are too much pitches (OMN loops last octave!) (loop repeat octaves with pitch = startpitch with cnt = 0 when (= cnt (length tonality)) do (setq cnt 0) append (expand-tonality (list pitch (nth cnt tonality))) do (incf cnt) do (setq pitch (car (pitch-transpose 12 (list pitch))))))) ;;; MAIN (defun integer-to-tonality (seq tonality &key (startpitch 'c4)) (progn (if (not (pitchp (car tonality))) (setf tonality (multiple-expand-tonality :startpitch startpitch :octaves 8 :tonality tonality)) tonality) (loop for i in seq collect (nth i tonality)))) ;;;;;;;;;;;;; (setf seq (flatten (gen-sort (rnd-order (gen-integer 24) :seed 49) :type 'selection))) (def-score example-score (:key-signature 'atonal :time-signature '(4 4) :tempo 90 :layout (piano-solo-layout 'rhand 'lhand)) (rhand :omn (make-omn :pitch (integer-to-tonality seq '(messiaen-mode4 messiaen-mode5 messiaen-mode6) :startpitch 'c4) :length (gen-repeat (length seq) 't))) (lhand :omn (make-omn :pitch (integer-to-tonality (x+b seq 3) ; transp integer-seq '(messiaen-mode3 messiaen-mode1 messiaen-mode2) :startpitch 'c2) :length (gen-repeat (length seq) 't))))
  16. 1 point
    AM

    mapping integer?

    in LISP (loop for i in '(0 1 2 3 4 2 1 5 3 1) collect (nth i (expand-tonality '(c4 messiaen-mode5))))
  17. 1 point
    opmo

    sorting algorithms

    The step default is NIL - whole process.
  18. 1 point
    lviklund

    sorting algorithms

    Very nice! Thank you for this AM. I hope it will make it into OM. I think it should be part of this glorious tool. /Lasse
  19. 1 point
    AM

    bubble-sort

    for a musical research project where i work with the sorting processes of different sorting algorithms (bubble-sort, heap-sort ...), i have to program such algorithms myself. the ide is that not only the end result of the algorithm is visible but also the constant changes (the mechansim). here the first: bubble-sort. very simple and inelegant programmed - but the thing i need to have :-) bubble-sort: https://en.wikipedia.org/wiki/Bubble_sort have a look to different sorting algorithms: greetings andré ;;; bubble-sort -> with all GEN's to see the process of sorting ;;; end-test "until (equal (sort-asc alist) list)" very uncommon (and strange), ;;; but most simple-stupid test to check the end, only okay for this kind of idea ("watching the process not the endresult") (defun bubble-sort (seq) (let ((alist)) (progn (setf alist (cond ((pitchp (car seq)) (pitch-to-midi seq)) ((lengthp (car seq)) (omn :length seq)) (t seq))) (setf alist (loop until (equal (sort-asc alist) list) with list = alist append (loop for i from 0 to (- (length list) 2) for j from 1 to (- (length list) 1) when (> (nth i list) (nth j list)) collect (setf list (position-swap (list j i) list)) else do (setf list list)))) (cond ((pitchp (car seq)) (midi-to-pitch alist)) (t alist))))) (bubble-sort (rnd-order '(c5 e4 g3 b7))) (bubble-sort (rnd-order '(t s e q h w))) (bubble-sort '(1 6 334 2 6 4 111))
  20. 1 point
    AM

    sorting algorithms

    hm, but isn't it replacing (rnd), and not sorting? would like to code exactly something like this this: 15 Sorting Algorithms in 6 Minutes ...to SHOW the process of sorting algorithms....
  21. 1 point
    opmo

    DADA Quartet

    Algorithmic avant garde jazz improvisation for tenor saxophone, piano, bass and drums. I thought it is time to add something new to our 'Made in Opusmodus' forum. 0.00 0.00 Play / Pause Samples: VSL Ensemble Pro with Vienna Instruments Pro. If you like to study the score, here it is: DADA Quartet.opmo
  22. 1 point
    Deb76

    DADA Quartet

    Dear Janusz, Here is a first result from a series of pitches based on "Mi Myxolydien" (a mix with the notes of Amazing Grace version Judy Collins and Third Stone from the Sun by Jimi Hendrix) insert in Def-Library. I recorded the IAC tracks in Ableton Live in the arrangement window and since I do not have an interesting jazz saxophone, I split the tracks and the piano so I could get some changes to the timbres. Besides the bass, the piano and the drums, I used three sessions of Softube modular synthesizer, Modular, including one with the Buchla 259e module (the somewhat space-like sound and which sometimes emphasizes the piano) and two instruments of the Korg Gadget suite for Mac, the Arp Odyssey emulation and the Wave Station emulation in a synthetic brass sound). Didier
  23. 1 point
    AM

    length-to-decimal / length-to-sec

    two functions i needed for working with POLYTEMPO-NETWORK http://philippekocher.ch/#109 http://polytempo.zhdk.ch greetings andré (defun length-to-decimal (alist &key (sum nil)) (let ((list (loop for i in (omn :length alist) collect (float (* i 4))))) (if (equal sum t) (sum list) list))) ;;; result: q = 1 / h. = 3 ...etc... (length-to-decimal '(h. h. 3q 5e 3h)) => (3.0 3.0 0.33333334 0.1 0.6666667) (length-to-decimal '(h. h. 3q 5e 3h) :sum t) => 7.1 (defun length-to-sec (alist tempo &key (sum nil)) (let ((list (loop for i in (omn :length alist) collect (* (/ 60 tempo) (float (* i 4)))))) (if (equal sum t) (sum list) list))) (length-to-sec '(h. h. 3q 5e 3h) 60) => (3.0 3.0 0.33333334 0.1 0.6666667) (length-to-sec '(h. h. 3q 5e 3h) 51) => (3.5294118 3.5294118 0.3921569 0.11764707 0.7843138) (length-to-sec '(h. h. 3q 5e 3h) 51 :sum t) => 8.3529415
  24. 1 point
    opmo

    length-to-decimal / length-to-sec

    I used this function for conversion of 4 instrument each with in its own tempo to one 'global' tempo. Examples: (length-tempo-map 72 36 '1/4) => 1/2 (length-tempo-map 72 36 'w) => 2 (length-tempo-map 72 88 '(1/8 1/4 -1/4)) => (9/88 9/44 -9/44) (length-tempo-map 72 '(120 36) '((1/8 1/4 -1/4) (1/16 1/8 -1/4 1/1))) => ((3/40 3/20 -3/20) (1/8 1/4 -1/2 2)) (length-tempo-map 72 '(36 96 72) '((1/20 1/20 1/20 1/20 1/20) (1/16 1/16 1/16 1/16 1/16 1/16 1/16 1/16) (1/8 1/8 1/8 1/8) (1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4)) :meter '(1 1 1)) => ((1/10 1/10 1/10 1/10 1/10) (1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8) (1/4 1/4 3/32 3/32) (3/16 3/16 3/16 1/4 1/4 1/4 1/4 1/2)) (length-tempo-map 72 36 '((e c4 e4 g4 h_e c5) (q c4 = = - - =) (q cs5 = - - = =))) => ((q c4 e4 g4 w_q c5) (h c4 = = - - =) (h cs5 = - - = =)) (length-tempo-map 72 '(36 96 72) '((e c4 e4 g4 h_e c5) (q c4 = = - - =) (q cs5 = - - = =)) :meter '(1 1 1)) => ((q c4 e4 g4 w_q c5) (e. c4 = = - -q =) (q cs5 = -h - = =))
  25. 1 point
    opmo

    Live coding midi-clock

    We will add the SYNC in version 2.
×