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

3 pointssomething new... greetings andré ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; BROWNIAN BRIDGE > could be use as a rndprocess from A to B (integers or pitches) ;;; if you have a look to example with ":allgen t", you will see the process with all generations, how it works ;;; or take a look to: ;;; https://de.wikipedia.org/wiki/WienerProzess#/media/File:BrownscheBewegung.png ;;; https://de.wikipedia.org/wiki/Brownsche_Brücke ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; SUB (defun pick (a b &key (span 5)) (let ((rnd1 (car (rndnumber 1 (+ a span) ( a span)))) (rnd2 (car (rndnumber 1 (+ b span) ( b span)))) (n)) (progn (setf n (car (rndnumber 1 rnd1 rnd2))) (if (or (= n a) (= n b)) (+ (rndpick '(1 1)) n) n)))) ;;; MAIN ;;; MAIN (defun genbrownianbridge (n startend &key (allgen nil) (output 'integer) (span 5)) (let ((seq)) (progn (setf seq (append (list startend) (loop repeat n with liste = startend do (setf liste (filterrepeat 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 allgen t) seq (car (last seq)))) (if (equal output 'pitch) (integertopitch seq) seq)))) ;;; EXAMPLES ;; SPAN influence > span 2 (listplot (genbrownianbridge 5 '(50 23) :span 2 :allgen t) :zerobased t :pointradius 3 :joinpoints t) ;; SPAN influence > span 10 (listplot (genbrownianbridge 5 '(50 23) :span 20 :allgen t) :zerobased t :pointradius 3 :joinpoints t) ;;; SPAN default (5) (listplot (genbrownianbridge 5 '(50 23) :allgen t) :zerobased t :pointradius 3 :joinpoints t) (listplot (genbrownianbridge 5 '(50 23)) :zerobased t :pointradius 3 :joinpoints t) (genbrownianbridge 5 '(50 23) :allgen t :output 'pitch) (genbrownianbridge 5 '(50 23) :output 'pitch) some soundexamples ;;; EXAMPLE with ALL GENS / seperated by rests (defscore brownianbridge (:title "score title" :keysignature 'atonal :timesignature '(4 4) :tempo 72) (instrument :omn (makeomn :pitch (setf n (genbrownianbridge 5 '(30 10) :allgen 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 'acousticgrandpiano)) ;;; EXAMPLE with LAST GEN > rndevaluations => rndways from a to b (defscore brownianbridge (:title "score title" :keysignature 'atonal :timesignature '(4 4) :tempo 72) (instrument :omn (makeomn :pitch (genbrownianbridge (car (rndnumber 1 2 7)) '(30 10) :output 'pitch) :length '(t) :span :pitch) :channel 1 :sound 'gm :program 'acousticgrandpiano)) two examples with different SPAN on MESSIEAN's mode5 mapped with <tonalitymap> ;;; on MESSIAENS mode5  > 8 cycles + SPAN 10 => bigger intervals/steps (defscore brownianbridge (:title "score title" :keysignature 'atonal :timesignature '(4 4) :tempo 90) (instrument :omn (makeomn :pitch (setf n (tonalitymap '(messiaenmode5 :map step :root 'fs3) (integertopitch (genbrownianbridge 8 '(10 27) :span 10 :allgen t)))) :length (loop for i in n append (list '1/4 (loop repeat (length i) append '(t)))) :span :pitch) :channel 1 :sound 'gm :program 'acousticgrandpiano)) ;;; on MESSIAENS mode5  > 8 cycles + SPAN 3 => smaller intervals/steps (defscore brownianbridge (:title "score title" :keysignature 'atonal :timesignature '(4 4) :tempo 90) (instrument :omn (makeomn :pitch (setf n (tonalitymap '(messiaenmode5 :map step :root 'fs3) (integertopitch (genbrownianbridge 8 '(10 27) :span 3 :allgen t)))) :length (loop for i in n append (list '1/4 (loop repeat (length i) append '(t)))) :span :pitch) :channel 1 :sound 'gm :program 'acousticgrandpiano))

3 pointsi 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

2 points
tonalitymap: controlling in which octave tones occur
Stephane Boussuge and one other reacted to opmo for a post in a topic
I will make some changes to the TONALITYMAP which will allow us to use scales lager then an octave. 
2 points
mapping integer?
JulioHerrlein and one other reacted to opmo for a post in a topic
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. 
2 points
mapping integer?
AM and one other reacted to Stephane Boussuge for a post in a topic
With vectormap function, you can map anything: (vectormap (expandtonality '(c4 messiaenmode5)) '(0 1 2 3 4 2 1 5 3 1)) SB. 
2 points
Opusmodus 1.2.23267
lviklund and one other reacted to opmo for a post in a topic
View File Opusmodus 1.2.23267 New function: GENSORT, thanks to Andre Meier and Torsten Anders. I have extended the functionality and made it more into a Opusmodus function. The function GENSORT sorts a sequence with a given type function and returns all the generations of the sorting process. Examples: (setf seq (rndorder (geninteger 11) :seed 49)) => (5 11 4 1 2 0 7 10 9 8 3 6) (gensort 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 LISTPLOT function. (setf values (rndnumber 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: (listplot (flatten (gensort values)) :zerobased t :pointradius 1 :joinpoints t) Descending: (listplot (flatten (gensort values :sort '>)) :zerobased t :pointradius 1 :joinpoints t) Each sort generation (ascending or descending) selected at random: (listplot (flatten (gensort values :sort '? :seed 1345)) :zerobased t :pointradius 1 :joinpoints t) Five step process: (listplot (flatten (gensort values :step 5)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values :sort '> :step 5)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values :sort '? :step 5 :seed 1345)) :zerobased t :pointradius 1 :joinpoints t) Examples with type selection: (listplot (flatten (gensort values :type 'selection)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values :type 'selection :sort '>)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values :type 'selection :sort '? :seed 1345)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values :type 'selection :step 5)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values :type 'selection :sort '> :step 5)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values :type 'selection :sort '? :step 5 :seed 1345)) :zerobased t :pointradius 1 :joinpoints t) Examples with type insertion: (listplot (flatten (gensort values :type 'insertion)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values :type 'insertion :sort '>)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values :type 'insertion :sort '? :seed 1345)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values :type 'insertion :step 5)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values :type 'insertion :sort '> :step 5)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values :type 'insertion :sort '? :step 5 :seed 1345)) :zerobased t :pointradius 1 :joinpoints t) Examples with type minmax: (setf values2 (rndnumber 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) (listplot (flatten (gensort values2 :type 'minmax)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values2 :type 'minmax :sort '>)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values2 :type 'minmax :sort '? :seed 1345)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values2 :type 'minmax :step 5)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values2 :type 'minmax :sort '> :step 5)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values2 :type 'minmax :sort '? :step 5 :seed 1345)) :zerobased t :pointradius 1 :joinpoints 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. (listplot (flatten (gensort values2 :type 'divide)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values2 :type 'divide :sort '>)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values2 :type 'divide :sort '? :seed 1345)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values2 :type 'divide :step 5)) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values2 :type 'divide :sort '> :division '((2 3 5) (6 13))) :zerobased t :pointradius 1 :joinpoints t) (listplot (flatten (gensort values2 :type 'divide :sort '? :division '((3 6) (6 9) (2 4 6) (11 13)) :zerobased t :pointradius 1 :joinpoints t) The next few examples are with pitches and lengths values: (gensort (rndair :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)) (gensort (rndair :type :pitch) :type 'divide) (gensort '(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)) (gensort '(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: (makeomn :pitch (setf n (gensort (vectortopitch'(c4 bb5) (genwhitenoise 24)) :type 'minmax :step 5)) :length (genrepeat (length n) (append (genrepeat 24 '(t)) (list 'e))) ) (makeomn :pitch (setf n (gensort (vectortopitch '(c4 bb5) (genwhitenoise 24)) :type 'divide :sort '? :step 5 :division '((2 3 4) (3 4)))) :length (genrepeat (length n) (append (genrepeat 24 '(t)) (list 'e))) ) To explore the expressions and to see scores using the GENSORT 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 
2 pointsA random sort '?  RNDPICK from ascending and descending result of a sequence. Ascending: (listplot (flatten (sorting (rndnumber 20 1 10 :seed 2346) :type 'selection :sort '<)) :zerobased t :pointradius 1 :joinpoints t) Descending: (listplot (flatten (sorting (rndnumber 20 1 10 :seed 2346) :type 'selection :sort '>)) :zerobased t :pointradius 1 :joinpoints t) At random: (listplot (flatten (sorting (rndnumber 20 1 10 :seed 2346) :type 'selection :sort '?)) :zerobased t :pointradius 1 :joinpoints t) In 5 steps: (listplot (flatten (sorting (rndnumber 20 1 10 :seed 2346) :type 'selection :sort '? :step 5)) :zerobased t :pointradius 1 :joinpoints t) The default sort is ascending.

2 points
sorting algorithms
lviklund and one other reacted to opmo for a post in a topic
Will add the MINMAX as well to the SORTING function. 
2 points
sorting algorithms
Stephane Boussuge and one other reacted to AM for a post in a topic
MIN/MAXSORT a new function: min/max > 1. maxpitch, 2. minpitch, 3.rest of the seq .... starting next gen.... have a look at the listplot. minmaxsort.opmo functions.opmo ;;; ordinary examples (makeomn :pitch (setf n (sorting (vectortopitch'(g4 eb5) (genwhitenoise 40)) :algorithm 'min/max)) :length (genrepeat (length n) (append (genrepeat 40 '(t)) (list 'e)))) (makeomn :pitch (setf n (sorting (vectortopitch'(g4 eb5) (genwhitenoise 40)) :algorithm 'min/max :n '>)) :length (genrepeat (length n) (append (genrepeat 40 '(t)) (list 'e)))) (makeomn :pitch (setf n (sorting (vectortopitch'(c4 bb5) (genwhitenoise 40)) :algorithm 'min/max)) :length (genrepeat (length n) (append (genrepeat 40 '(t)) (list 'e)))) (makeomn :pitch (setf n (sorting (vectortopitch'(c4 bb5) (genwhitenoise 40)) :algorithm 'min/max :n '>)) :length (genrepeat (length n) (append (genrepeat 40 '(t)) (list 'e)))) (makeomn :pitch (setf n (sorting (rndorder '(g4 gs4 a4 bb4 b4 c5 cs5 d5 eb5 e5 f5 fs5)) :algorithm 'min/max)) :length (genrepeat (length n) (append (genrepeat 12 '(t)) (list 'e)))) (makeomn :pitch (setf n (sorting (rndorder '(g4 gs4 a4 bb4 b4 c5 cs5 d5 eb5 e5 f5 fs5)) :algorithm 'min/max :n '>)) :length (genrepeat (length n) (append (genrepeat 12 '(t)) (list 'e)))) ;;; combined with filtertie > ties all pitch repetitions!! (filtertie (makeomn :pitch (setf n (sorting (vectortopitch'(c4 bb5) (genwhitenoise 40)) :algorithm 'min/max)) :length (genrepeat (length n) (append (genrepeat 40 '(t)) (list 'e))))) (filtertie (makeomn :pitch (setf n (sorting (vectortopitch'(c4 bb5) (genwhitenoise 40)) :algorithm 'min/max :n '>)) :length (genrepeat (length n) (append (genrepeat 40 '(t)) (list 'e))))) ;;; THREE SCORES with min/max (defscore examplescore (:keysignature 'atonal :timesignature '(4 4) :tempo 120 :layout (pianosololayout 'rhand 'lhand)) (rhand :omn (makeomn :pitch (setf n (sorting (rndorder '(g6 gs6 a6 bb6 b6 c7 cs7 d7 eb7 e7 f7 fs7)) :algorithm 'min/max :n '<)) :length (genrepeat (length n) (append (genrepeat 12 '(t)) (list 'e)))) :channel 1 :sound 'gm :program 0) (lhand :omn (makeomn :pitch (setf n (sorting (rndorder '(g1 gs1 a1 bb1 b1 c2 cs2 d2 eb2 e2 f2 fs2)) :algorithm 'min/max :n '>)) :length (genrepeat (length n) (append (genrepeat 12 '(t)) (list 'e)))) :channel 2)) (defscore examplescore (:keysignature 'atonal :timesignature '(4 4) :tempo 120 :layout (pianosololayout 'rhand 'lhand)) (rhand :omn (filtertie (makeomn :pitch (setf n (sorting (rndrepeat 100 '(g6 gs6 a6 bb6 b6 c7 cs7 d7 eb7 e7 f7 fs7)) :algorithm 'min/max :n '<)) :length (genrepeat (length n) (append (genrepeat 100 '(t)) (list 'e))))) :channel 1 :sound 'gm :program 0) (lhand :omn (filtertie (makeomn :pitch (setf n (sorting (rndrepeat 100 '(g1 gs1 a1 bb1 b1 c2 cs2 d2 eb2 e2 f2 fs2)) :algorithm 'min/max :n '>)) :length (genrepeat (length n) (append (genrepeat 100 '(t)) (list 'e))))) :channel 2)) (defscore examplescore (:keysignature 'atonal :timesignature '(4 4) :tempo 120 :layout (pianosololayout 'rhand 'lhand)) (rhand :omn (filtertie (makeomn :pitch (setf n (sorting (rndrepeat 100 '(g6 gs6 a6 bb6 b6 c7 cs7)) :algorithm 'min/max :n '<)) :length (genrepeat (length n) (append (genrepeat 100 '(t)) (list 'e))))) :channel 1 :sound 'gm :program 0) (lhand :omn (filtertie (makeomn :pitch (setf n (sorting (rndrepeat 100 '(c2 cs2 d2 eb2 e2 f2 fs2)) :algorithm 'min/max :n '>)) :length (genrepeat (length n) (append (genrepeat 100 '(t)) (list 'e))))) :channel 2)) 
2 points
sorting algorithms
loopyc and one other reacted to torstenanders for a post in a topic
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 bubblesort/naive (sequence) (let ((end (length sequence))) (labels ((compareandswap (index modified) ;; print intermediate results (print sequence) (if (= index (1 end)) (if modified (compareandswap 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) (compareandswap index+1 t)) (compareandswap index+1 modified)))))) (unless (< end 2) (compareandswap 0 nil)) sequence))) (bubblesort/naive '(3 1 9 5 3 6 4 2 3 7)) Best, Torsten 
1 pointView File Opusmodus 1.2.23354 New: AllCombinatorial Hexachords GENACHEXACHRD ACHEXACHORDCOMPLEMENTFORMSET HEXACHORDCOMPLEMENT ________________________________ The function GENACHEXACHRD generate a hexachord (H1) set and its complement (H2) set form a given name (allcombinatorial 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 (twelvetone row). The AC in the function name stand for 'AllCombinatorial Hexachords'. AllCombinatorial 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) AllCombinatorial Hexachords in Forte notation: (pcsprimeform '((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) => (61 68 632 67 620 635) Example: In the first example we use A set (0 1 2 3 4 5): (genachexachord 'a) => ((6 4 3 1 5 2) (7 9 10 0 8 11)) Here the result is a twelvetone row (aggregate): (genachexachord '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: (genachexachord 'c :start 0) => ((0 2 5 4 9 7) (3 1 10 11 6 8)) (genachexachord 'd :aggregate t :start 7) => (7 11 5 1 0 6 8 4 10 2 3 9) (genachexachord 'e) => ((0 9 8 1 5 4) (3 6 7 2 10 11)) (genachexachord 'f :seed 456) => ((9 1 7 5 11 3) (4 0 6 8 2 10)) ________________________________ The function ACHEXACHORDCOMPLEMENTFORMSET returns all form sets with all combinations of the complement hexachord (H2) set. Example: (setf achex '((0 4 5 11 6 10) (7 3 1 2 9 8))) (achexachordcomplementformset achex) => ((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: (achexachordcomplementformset (reverse achex)) => ((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 allcombinatorial hexachords with GENACHEXACHORD function: (setf hexachords (genachexachord 'd :seed 965) => ((11 5 3 10 9 4) (6 0 2 7 8 1)) (achexachordcomplementformset 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 :formnames to T: (achexachordcomplementformset (genachexachord 'c :seed 965) :formnames t) => (p6 ri3 i9 r0) (rndoctaves '(c2 c6) (rndorder (getformset (genachexachord '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 (twelvetone row). Example: (hexachordcomplement '(0 1 2 6 7 8)) => (5 4 3 11 10 9) (hexachordcomplement '(0 1 2 6 7 8) :pitch) => (f4 e4 eb4 b4 bb4 a4) ________________________________ Small changes to the documentation structure.Function name changes: 12toneanalysis > twelvetoneanalysis 12tonep > twelvetonep 12toneforms > twelvetonematrix get12tone > twelvetonefilter rnd12toneform > rndformset get12toneform > getformset Transpose added to PCSINVERT function: (pcsinvert (pcs '97) 0) => (0 11 10 9 8 7 5 4 2) (pcsinvert '((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)) (pcsinvert '((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)) (pcsinvert '((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)) LENGTHTEMPOMAP function name changed to LENGTHTOTEMPO Fix to TIMEPOINTSYSTEM That's all for now, best wishes, JP Submitter opmo Submitted 05/10/2018 Category Opusmodus Latest Release

1 point
Opusmodus 1.2.23291
hujairi reacted to Stephane Boussuge for a post in a topic
Thank you very much, the spectra option in tonality map is exactly what i'm looking for. Wonderful tool !!! Thanks a lot S. 
1 pointYou can use the :span :pitch option if the master is the pitch: Example: (makeomn :pitch (tonalitymap '(messiaenmode5 :map step :root 'c4) sortseq) :length '(t) :span :pitch) (makeomn :pitch (loop for i in sortseq collect (nth i sieve)) :length '(t) :span :pitch)

1 point
tonalitymap: controlling in which octave tones occur
Stephane Boussuge reacted to torstenanders for a post in a topic
I like how the function tonalitymap allows specifying some input harmony (called tonality) and raw music, where the "raw" music is then quasiquantised into the given harmony. However, I would like to control in which octaves specific tones are allowed to occur. tonalitymap allows specifying an underlying harmony that ranges over multiple octaves, but it seems that internally only octaveless 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 octavetranspose 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. (tonalitymap ;; 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 tonalitymap, 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 
1 point
mapping integer?
JulioHerrlein reacted to AM for a post in a topic
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 multipleexpandtonality (&key startpitch octaves tonality) (removeduplicates ;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 (expandtonality (list pitch (nth cnt tonality))) do (incf cnt) do (setq pitch (car (pitchtranspose 12 (list pitch))))))) ;;; MAIN (defun integertotonality (seq tonality &key (startpitch 'c4)) (progn (if (not (pitchp (car tonality))) (setf tonality (multipleexpandtonality :startpitch startpitch :octaves 8 :tonality tonality)) tonality) (loop for i in seq collect (nth i tonality)))) ;;;;;;;;;;;;; (setf seq (flatten (gensort (rndorder (geninteger 24) :seed 49) :type 'selection))) (defscore examplescore (:keysignature 'atonal :timesignature '(4 4) :tempo 90 :layout (pianosololayout 'rhand 'lhand)) (rhand :omn (makeomn :pitch (integertotonality seq '(messiaenmode4 messiaenmode5 messiaenmode6) :startpitch 'c4) :length (genrepeat (length seq) 't))) (lhand :omn (makeomn :pitch (integertotonality (x+b seq 3) ; transp integerseq '(messiaenmode3 messiaenmode1 messiaenmode2) :startpitch 'c2) :length (genrepeat (length seq) 't)))) 
1 point
mapping integer?
JulioHerrlein reacted to AM for a post in a topic
in LISP (loop for i in '(0 1 2 3 4 2 1 5 3 1) collect (nth i (expandtonality '(c4 messiaenmode5)))) 
1 pointThe step default is NIL  whole process.

1 pointVery 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

1 pointfor a musical research project where i work with the sorting processes of different sorting algorithms (bubblesort, heapsort ...), 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: bubblesort. very simple and inelegant programmed  but the thing i need to have :) bubblesort: https://en.wikipedia.org/wiki/Bubble_sort have a look to different sorting algorithms: greetings andré ;;; bubblesort > with all GEN's to see the process of sorting ;;; endtest "until (equal (sortasc alist) list)" very uncommon (and strange), ;;; but most simplestupid test to check the end, only okay for this kind of idea ("watching the process not the endresult") (defun bubblesort (seq) (let ((alist)) (progn (setf alist (cond ((pitchp (car seq)) (pitchtomidi seq)) ((lengthp (car seq)) (omn :length seq)) (t seq))) (setf alist (loop until (equal (sortasc 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 (positionswap (list j i) list)) else do (setf list list)))) (cond ((pitchp (car seq)) (miditopitch alist)) (t alist))))) (bubblesort (rndorder '(c5 e4 g3 b7))) (bubblesort (rndorder '(t s e q h w))) (bubblesort '(1 6 334 2 6 4 111))

1 pointhm, 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....

1 pointAlgorithmic 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

1 pointDear 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 DefLibrary. 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 spacelike 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

1 pointtwo functions i needed for working with POLYTEMPONETWORK http://philippekocher.ch/#109 http://polytempo.zhdk.ch greetings andré (defun lengthtodecimal (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... (lengthtodecimal '(h. h. 3q 5e 3h)) => (3.0 3.0 0.33333334 0.1 0.6666667) (lengthtodecimal '(h. h. 3q 5e 3h) :sum t) => 7.1 (defun lengthtosec (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))) (lengthtosec '(h. h. 3q 5e 3h) 60) => (3.0 3.0 0.33333334 0.1 0.6666667) (lengthtosec '(h. h. 3q 5e 3h) 51) => (3.5294118 3.5294118 0.3921569 0.11764707 0.7843138) (lengthtosec '(h. h. 3q 5e 3h) 51 :sum t) => 8.3529415

1 pointI used this function for conversion of 4 instrument each with in its own tempo to one 'global' tempo. Examples: (lengthtempomap 72 36 '1/4) => 1/2 (lengthtempomap 72 36 'w) => 2 (lengthtempomap 72 88 '(1/8 1/4 1/4)) => (9/88 9/44 9/44) (lengthtempomap 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)) (lengthtempomap 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)) (lengthtempomap 72 36 '((e c4 e4 g4 h_e c5) (q c4 = =   =) (q cs5 =   = =))) => ((q c4 e4 g4 w_q c5) (h c4 = =   =) (h cs5 =   = =)) (lengthtempomap 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  = =))

1 pointWe will add the SYNC in version 2.