User Extensions Source Code
Here you can share your functions source code
199 topics in this forum
-
short question to GEN-SORT.... the original/start-sequence is not shown with GEN-SORT? i think it should... you see it when using 'min-max... so, i think the AXIOM must be shown greetings andré
-
- 1 reply
- 1.2k views
-
-
i coded it to analyze a pitchfield ;;; a function witch filters/shows you all pitch-combinations by INTERVAL-SIZE ;;; from 1 to 11 ("octave-independent") ;;; for example you are interested to see all FIFTH-combinations in a SIEVE ;;; or to LIST all resulting/ordered intervals (defun equal/or (n alist) (car (loop for i in alist when (equal i n) collect 't))) ;;; FUNCTION (defun find-intervals* (pitch-seq &key (intervals 'all) (chord nil) (reduced-interval nil)) (let ((combs (combination 2 pitch-seq)) (ints) (int) (all-comb-pitches-intervals)) (progn (setf ints (loop for i in combs do (set…
- 2 replies
- 1.6k views
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; rnd-walk in a pitchfield - with interval-control ;;; ;;; this is a little function which does an rnd-walk in a special way ;;; the function is checking all possible interval-pairs first inside the pitchfield ;;; so that is on one hand all the time "inside" the pitchfield/sieve, but also only ;;; uses the :POSSIBLE-INTERVALS, so you could control the "interval-color" of the walk ;;; in an non-chromatic-pitchfield/sieve ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun enlarge-intervals (possible-intervals &key (octaves 2)) (let …
-
- 0 replies
- 1.2k views
-
-
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 (sp…
-
- 0 replies
- 1.4k views
-
-
a very simple, but useful little function... (defun gen-puls* (n tuplet period &key (stacc nil)) (gen-length (loop repeat n with period = (if (equal stacc t) (list 1 (neg! (1- period))) period) collect period) tuplet)) ;;; option: stacc or ord (gen-puls* 10 1/32 13) => (13/32 13/32 13/32 13/32 13/32 13/32 13/32 13/32 13/32 13/32) (gen-puls* 10 1/32 13 :stacc t) => (1/32 -3/8 1/32 -3/8 1/32 -3/8 1/32 -3/8 1/32 -3/8 1/32 -3/8 1/32 -3/8 1/32 -3/8 1/32 -3/8 1/32 -3/8) (gen-puls* 10 1/28 9) => (9/28 9/28 9/28 9/28 9/28 9/28 9/28 9/28 9/…
-
- 0 replies
- 1.2k views
-
-
greetings andré p.s. it's the PITCH-version of "shift-length-proportions", i've worked with these things a long time ago... in COMMON MUSIC 🙂 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; a function which transforms a pattern (each pitch linearly and independent) to another pattern ;;;; by interval "STEP" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; SUBFUNCTION (defun compare (start end &key (step 1)) (list (loop for i in start for j in end when (/= i j) collect (if (> i 0) (if (< i j…
-
- 0 replies
- 854 views
-
-
shift-length-proportions a bit like gen-morph for LENGTHS. every item of a length-list will change linear till the endpattern is reached. ;;; subfunction (defun compare (start end &key (step 1/32)) (list (loop for i in start for j in end when (/= i j) collect (if (> i 0) (if (< i j) (+ i step) (- i step)) (if (> i j) (- i step) (+ i step))) else collect i) end)) ;;; mainfunction (defun shift-length-proporti…
- 1 reply
- 1.4k views
-
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 (equa…
-
- 1 reply
- 2.3k views
-
-
i didn't find a OM-library-solution for this kind of thing, so i coded it... if you want to REPLACE the articulation of some specific pitches. perhaps all 'd4 sould be PONTE... you could use this. it was necessary to code it like that, because otherwise you get in trouble with the empty parameter-slots... should work fine greetings andré ;;; SUBFUNCTIONS (defun eliminate-nil (alist) (loop for i in alist when (not (null i)) collect i)) (defun complete-event-slots (omn-list) (let ((omn-art (omn :articulation (single-events (flatten omn-list))))) (single-events (omn-replace :articulation (flatten …
-
- 0 replies
- 1.3k views
-
-
hi all does anybody already coded a FUNCTION to replace string-pitches by natural or artificial harmonics? is the specific notehead in OM (for the artificials)? would/could be very practical... perhaps if you have fast phrases in a large ambitus... the function - if it would be very well coded - could search for the nearest/closest fingering... greetings andré
-
- 2 replies
- 1.5k views
-
-
Hello all, I am very new to OMN. I would like to start learning by exploring the topic of randomizing parameters within a given framework. Mainly pitches and durations for now. For example, make variations of an 11-pitch-class set, but give emphasis only to some of the pitches (repeat more often) while also slightly vary the basic main rhythmic pattern. Which collection of examples should I start looking? Thanks in advance, Ioannis
- 3 replies
- 1.7k views
-
hi all is there a possibility to SAVE my output - the OMN-lists - (rnd-generated structures) in a seperate file? that by EVALUATION the OMN-lists will be written in a sepeart/new-generated file? ...so that i have not to re-import it via MIDI (makes a lot of strange rhythms) thanks for help andré
- 5 replies
- 2k views
-
question (from a non-programmer): is there a possibility (a way) to evaluate and/or start-to-play with a delay (of x-seconds) in opusmodus/lisp? would be interesting in the context of using POLYTEMPO NETWORK http://polytempo.zhdk.ch (virtual conductor) and LIVE-evaluation/play of an algorithm (and playing it live by an e-player) on/with a specific (delay-)time. could be something like: "do evaluate algorithm" "do play it in 21.543 seconds" any ideas or solutions? thanx for help andré
- 2 replies
- 1.5k views
-
Here's a small function from my toolbox i use very often for adding articulation on already generated OMN material. Also useful for adding legato slurs. Link to video example: ;;; ============================================= ;;; ARTICULATION-MAP-OMN ;;; AJOUTE DES ARTICULATIONS SUR DES LISTES OMN ;;; BASÉES SUR DU PATTERN MATCHING. ;;; ============================================= (defun articulation-map-omn (map omn &key (otherwise '-)) (do-verbose ("articulation-map-omn") (let ((plist (disassemble-omn omn))) (setf (getf plist :articulation) (pattern-map map (getf plist :length) :otherwise oth…
-
- 0 replies
- 1.5k views
-
-
(defun merge-voices** (seq &key insert bar/beat) (car (last (let ((bar) (beat) (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 time-sign (if (listp (car time-sign)) (loop for i in time-sign when (> (caddr i) 1) append (loop …
- 5 replies
- 1.9k views
-
Sometimes you want to remove rests in an OMN expression without changing the actual rhythm, but instead lengthening the notes followed by a rest. The following function does that. (merge-rests-with-preceeding-note '(e g6 f stacc -e e ab5 mp ten e c4 mf ten)) => (1/4 g6 f stacc e ab5 mp ten e c4 mf ten) The definition is below. Best, Torsten (defun merge-rests-with-preceeding-note (sequence) "Remove all rests in sequence without changing the actual rhythm: extends the length of each note followed by that rest value, so that the overall duration remains as before. Args: - sequence: OMN expression, can be nested. Example…
- 6 replies
- 2k views
-
Dear Janusz, Would it be possible to add a symbol like :opusmodus to the variable *features*? I am writing a cross-platform library, and for Opusmodus-specific features it would be good to be able check for that platform. Currently, I am instead checking for Clozure CL and then assume Opusmodus as shown below, but it would be better to have some check specifically for Opusmodus. (cond #+clozure ; opusmodus ((om:omn-formp x) <do some fancy processing>) ...) Best, Torsten
-
- 2 replies
- 1.4k views
-
-
In case someone is interested, I just put some of my libraries online. Fenv is a library of highly flexible envelopes for algorithmic composition. The software represents envelopes as numerical functions, called fenvs. It provides a rich set of functions to generate, combine and transform these envelopes. You can find the code at https://github.com/tanders/fenv, together with some information how to install and use. Best, Torsten
-
- 1 reply
- 1.4k views
-
-
;;; SPLITS CHORDS INTO APP/ACC ;;; SUB -> could be replaced by an original-OPMPO-function (defun omn-component-replace (omn-sequence replace-component) (make-omn :length (if (lengthp (car replace-component)) (append replace-component) (omn :length omn-sequence)) :pitch (if (or (pitchp (car replace-component)) (chordp (car replace-component))) (append replace-component) (omn :pitch omn-sequence)) :velocity (if (velocityp (car replace-component)) (append replace-component) (omn :velocity omn-sequence)) …
-
- 2 replies
- 1.5k views
-
-
here is a function that can be used for "post-..." of an OMN score... you could INSERT a sequence by BAR/BEAT (a slightly modified variant of OVERWRITE), so you can place your insert exactly! greetings andré ;;; INSERTING (defun get-resolution2 (be) (cond ((member (cadr be) '(3 6 12 24 48)) 1/24) ((member (cadr be) '(1 2 4 8 16 32)) 1/16) ((member (cadr be) '(5 10 20 40)) 1/20) ((member (cadr be) '(7 14 28 56 1)) 1/28))) (defun insert (seq &key insert bar/beat) (car (last (let ((bar) (beat) (resolution) (distance)) (progn (setf bar (loop …
-
- 0 replies
- 1.4k views
-
-
i think, it works like that :-) now, you could OVERWRITE you original OMN sequentially with inserts... (it's very useful for "post-production" of your generated score!). i have changed the input-format (bar/beat), and it also works with changing time-signatures... i know, janusz or the opmp-programmers could code it smarter, but my concept/code seems to work... so take it and optimize it!!! greetings andré p.s. when wil be approx. the release of vers 2 of OPMO? ;;; OVERWRITING (defun get-resolution2 (be) (cond ((member (cadr be) '(3 6 12 24 48)) 1/24) ((member (cadr be) '(1 2 4 8 16 32)) 1/16)…
-
- 2 replies
- 1.5k views
-
-
;;; gets the position => bar and beat where the value is ;;; => could be used in combination with "inserting-on-bar/beat*", ;;; if you are looking for a specific value to sprout a sequqnce ;;; FUNCTION (defun get-position (seq value &key (get 'all)) (let ((beat) (bar (car (loop for i in seq for bar = 1 then (incf bar) append (loop for j in (single-events i) when (pattern-matchp j (list value)) collect bar))))) (progn (setf beat (loop for k in (loop for i in (single-events (nth (1- bar) seq)) when (not (pattern-m…
-
- 2 replies
- 1.4k views
-
-
here is a first version => replaces a PITCH by a sequence - overwriting the "old seq" - not very easy to CODE/understand how to do it :-) take a look an perhaps you have some more/better/extending ideas... a better way to solve the problems? greetings andré ;;; -------------------------------------------------------------------------------------------- ;;; FUNCTIONS ;;; -------------------------------------------------------------------------------------------- (defun get-resolution (seq pattern) (let ((val)) (progn (setq val (loop for i in (single-events seq) when (pattern-matchp i pattern) collect (d…
-
- 1 reply
- 1.1k views
-
-
take it as a sketch... you can see the input/output greetings andré p.s. could be nice, if we combine it with a/the/my overwrite-function p.s.s an overwrite-function could be very very smart for work... think: for example: you have coded some music but you would overwrite the last two quaternotes of bar 5 in the violin.... !? ;;; ------------------------------------------------------------------------ ;;; INSERTING ON BAR/BEAT ;;; ------------------------------------------------------------------------ (defun inserting-on-bar/beat (insert &key time-sign bar beat) (let ((extra-rest (* -1 (/ (- (car beat) 1) (cadr beat)))) …
-
- 0 replies
- 1.1k views
-
-
https://en.wikipedia.org/wiki/Collatz_conjecture ;;experiment with COLLATZ-conjecture ;;https://en.wikipedia.org/wiki/Collatz_conjecture (defun collatz (start-value number-of-value) (loop repeat number-of-value with value = start-value when (evenp value) do (setq value (/ value 2)) else do (setq value (+ (* 3 value) 1)) collect value)) (list-plot (collatz 15 20) :zero-based t :point-radius 2 :join-points t) ;;;;;;;;;;;; ;;same function like fibonacci-transition but now with COLLATZ. ;;don't know if that makes sense - just a bit code :-) (defun transition-with-collatz (number-of-values start-val value-a value-b) (let (…
-
- 2 replies
- 1.6k views
-