Function Examples
Functions, arguments, values and results
271 topics in this forum
-
I understand that the first argument value in the ambitus-chord function represents the outer-interval size measured by an integer or a list of integers. What does the second value in the size argument list affect when processing two [or more] chords, as illustrated in the example below? Is the second value affecting the second chord in the first list or both chords in the second list? Thank you! (ambitus-chord '(14 6) '((eb4c6 c4fs4 b4) (c4b4 b3eb5b3)))
-
- 1 reply
- 2.4k views
-
-
Hi, When I constrain the ambitus range to be smaller than an octave, I do not understand exactly on which axis the pitches are inverted, when I use :type :invert it is clear, but what does the default transpose type? Thanks! (setf range '((q c4 cs4 d4 ds4 e4 f4 fs4 g4 gs4 a4 bb4 b4 c5))) (setf amb2 (ambitus '(c4 a4) range )) (merge-voices range amb2)
-
- 1 reply
- 849 views
- 1 follower
-
-
Dear all, The rough outline of a melody can be described by a melodic contour, which sets the rough curve formed by the pitches of a melody without fixing the detail of all melodic intervals and pitches. Opusmodus allows controlling the melodic contour, e.g., with the function axis-plot in its Schillinger Inference function set. However, the documentation is a bit confusing as it seems to suggest that such functionality is offered only by its sibling axis-sub-plot. The function axis-sub-plot is documented to add more complexity to the result by dynamically displacing the underlying axis. However, that seems to be the case only for the second elemen…
-
- 1 reply
- 1.4k views
-
-
What is the main difference between pitch-repeat2 and pitch-repeat3 functions? I'm testing various examples and notice that the first two parameters in pitch-repeat2 are low and high integers; in pitch-repeat3 there's only one parameter, count, which can be expressed as a single digit or a list. When the count is represented as a list, it produces a similar output of randomized high and low counts, similar to pitch-repeat2. Any other comparison observations or differences between these two functions? Thank you!
-
- 1 reply
- 522 views
- 2 followers
-
-
Maybe I missed it, but is there a function that removes ties, opposite to filter-tie? Thanks!
- 1 reply
- 803 views
- 1 follower
-
Hi, is there a function for distributing one voice successively into a defined number of voices as described in my attachment? Best, Achim
-
- 1 reply
- 903 views
- 1 follower
-
-
Dear all, I released a collection of personal Opusmodus Tools at https://github.com/tanders/tot, together with installation instructions etc. Best, Torsten
-
- 1 reply
- 1.3k views
-
-
The documentation on the interval-expansion-series function states that a count list argument refers to a number of intervals to process. Would someone be willing to explain what number of intervals and in what way? I understand that this function also has built-in randomness, resulting in a different output each time. In the example below, does the count list '(1 2 3) mean that only one interval is expanded the first time, then two intervals the second time, etc.? Or does it imply that only the first three intervals from the interval source list will be expanded? (interval-expansion-series 10 '(1 -1 2 -2) '(1 2 3) '(-6 -5 3 4) :max-interval 6) …
- 1 reply
- 1.1k views
- 1 follower
-
Hi, I'am having hard times to understand what is pitch-transpose doing, please have a look, thanks! (pitch-transpose -12 '((fs1) (f1) (g-1g1bb2e6gs6a6bb6) (gs-1bb1bb2e6gs6a6bb6) (bb-1cs2bb2a3e6gs6a6bb6cs7))) ;==> ((fs1) (f1) (g1 g1bb1e5gs5a5bb5) (gs1 bb0bb1e5gs5a5bb5) (bb0 cs1bb1a2e5gs5a5bb5cs6)) ; x? x? x? (pitch-transpose 12 '((fs1) (f1) (g-1g1bb2e6gs6a6bb6) (gs-1bb1bb2e6gs6a6bb6) (bb-1cs2bb2a3e6gs6a6bb6cs7))) ;==> ((fs2) (f2) (g1 g2bb3e7gs7a7bb7) (gs1 bb2bb3e7gs7a7bb7) (bb0 cs3bb3a4e7gs7a7bb7cs7)) ; …
-
- 1 reply
- 824 views
- 1 follower
-
-
I'm trying to combine a series of counterpoint dictums into a single dictum list. I tried several things, but can't seem to get it work. Is there a function similar to assemble-seq that could be applied here? Thank you! (setf dictum-1a '(((1 2 3) :methods ( (r ft) (t-12 ft) (dl1 t-12 pr1 ten)))) ) (setf dictum-1b '(((1 2 3) :methods ( (r ft) (t-12 ft) (dl1 t-12 pr2 ten)))) ) (setf dictum-1b '(((1 2 3) :methods ( …
-
- 1 reply
- 753 views
- 1 follower
-
-
I know how to create a set of pitches that moves from a to b in a linear or exponential curve. Now, how can I get such a movement but not with a line of single pitches, but with transposed sets of pitches? For example: Create movement from a4 to d4 but only with variants of (g4 a4), thus transposing the major second upwards movement until reaching (d4 e4).
- 1 reply
- 409 views
-
I am trying to create a rnd-sample process with a tightening range of material. For example: (rnd-sample 50 (gen-integer 50 60) ) -> it should start with sampling from the full range between 50 and 60, but tightening the range until at the last sample only chosing from material between 54 and 56 Maybe I could somehow map the sampled material to 2 vectors, a rising linear function and a falling one? Or get the range between 2 functions? I am kind of lost here, sorry if the answer is obvious 👀
- 1 reply
- 444 views
-
Hi, it says in the doc of vector-to-velocity that the default is float values, but when I evaluate (setf vel (vector-to-velocity 0.1 0.9 (gen-integer 1 16))) =>(pppp pppp ppp pp pp p mp mp mf mf f ff ff fff ffff ffff) I get symbols, when I use (setf vel (vector-to-velocity 0.1 0.9 (gen-integer 1 16):type :float)) =>(0.1 0.15 0.21 0.26 0.31 0.37 0.42 0.47 0.53 0.58 0.63 0.69 0.74 0.79 0.85 0.9) everything is fine, just want to mention it. best ole
-
- 1 reply
- 804 views
- 1 follower
-
-
here some functions (that i'm using currently). perhaps anyone/OPMO would include/optimze them.. take the ideas... greetings andré 1) rnd-order/sort-omn => picks omn-seqs/bars in rnd-order and sorting it (a mix-up and sort-process for OMN) (defun rnd-order/sort-omn (omnlist &key (type nil) (sort 'a) (step nil)) (let* ((int-seq (gen-integer 0 (1-(length omnlist)))) (sorted-int (gen-sort (rnd-order int-seq) :type type :sort sort :step step))) (loop for i in (flatten sorted-int) collect (nth i omnlist)))) (rnd-order/sort-omn '((w c4 mf) (h d4 ppp ten e4 ten) (q g4 leg a4 leg b4 leg) (e c5 d5 e5 f5 g5))) => ((…
- 1 reply
- 716 views
-
Dear Friends, I´m trying to make a function to get the complementary diatonic set for a diatonic chord. For example, if you relate the key of C major (C D E F G A B) with the chord Cmaj7 (C E G B), the complementary set is (D F A). Elliott Carter did this a lot in his Harmony Book, making all kinds of complementarities. This works for comparing stuff. Is there something easier in the system ? For comparing a sequence of chords in relation to a sequence of tonalities for getting the difference ? (defun compare-list-pairs (list-pairs) (loop for (list1 list2) in list-pairs collect (set-difference list1 list2 :test 'equal)))…
- 1 reply
- 255 views
-
Dear Friends, When working in my patches in Pure Data, one of the things I implemented back then was a function similar to Lenght-Weight. I'm searching for something like this example. 1) Take a duration sequence, for example '(s e s) used as span in OMN way, i.e., aligning the materials with the longer list of pitches. 2) Take any pitch sequence, like for example '(c4 d4 e4 f4 g4 a4 b4 a4 g4 f4 e4 d4), gen-repeat 10 times This example could result in a ascending and descending scale with the constant rhythmic pattern (s e s). I'm thinking in a function that could put some rests in this pattern, according to …
- 1 reply
- 1.6k views
-
here is a short program (based on JOHNSON's writing... pascal-code found in www and modified) to generate TOM JOHNSON's series of numbers for "pascal's triangle ...". maybe interesting to play with the MODULO like JOHNSON did (mod 7)... try it! greetings andré ;;; SUB (defun pascal-next-row (a &key (johnson-modulo nil)) (loop :for q :in a :and p = 0 :then q :as s = (if (null johnson-modulo) (list (+ p q)) (list (mod (+ p q) johnson-modulo))) :nconc s :into a :finally (rplacd s (list 1)) (return a))) ;;; MAIN (defun pascal-tria…
- 1 reply
- 995 views
- 1 follower
-
Is there a function like group-list in PWGL: SYSTEM GROUP-LST (LIST GROUP-LENS): groups list into subsequnces, where group-lens indicates the length of each sublist. group-lens can be a number or a list of numbers. If list is not exhausted by group-lens, the last value of group-lens will be used as a constant until list has been exhausted. (group-lst lis '(1 2 3 4 5 6 7 8 9 10) '(2 3 5)) ; => ((1 2) (3 4 5) (6 7 8 9 10)) (group-lst lis '(1 2 3 4 5 6 7 8 9 10) '(2 3 4)) ; => ((1 2) (3 4 5) (6 7 8 9) (10))
-
- 1 reply
- 1.6k views
-
-
I'm working on a piano piece that features two streams of different material in each hand. I want to swap selected measures (in my case, same measures) from right to left hand (e.g., 2nd m in r.h. with 2nd m in l.h., 5th m in r.h with 5th in l.h., etc; or at random, of course). I wondered if there's a function that would accomplish that? Thank you! Zvony
-
- 1 reply
- 585 views
- 2 followers
-
-
-
I've imported a midi file with a simple/sparse melody and am wondering what my function options are for adding density/embellishment that replaces some of the rests? If I use the density or pitch-ornament/pitch-figurate functions, they add material around each note but they preserve the rests. Is there another option that would replace some of the rests with generated material? Or would the right approach be to generate material separately and insert it into the positions where the rests are? The imported omn looks like : (e cs6 fff -he e c6 mf -q. e fs5 fff -q. e d6 mf - -q. e g6 -he e ds6 -h. - e fs5 -q e d6 -q. e as4 -q -h -e fs6)
-
- 0 replies
- 102 views
- 1 follower
-
-
With the following functions, you can run a background process (e.g., a loop function that constantly reloads data, for example from a text file) and do other things in parallel, such as modifying functions, etc. This is helpful when working with LISP/Opusmodus to process data in real time. I’ve tested this for a few days now, and it seems to run well and stable — at least as stable as the background process functions are free of bugs. Starting the process: Give the process a name and "add" your function (Here’s an example I made) -> process name “mididateien-generieren”, and my function within it is called “gen_1.midi” (mp:process-run-function "mididateien-generieren…
-
- 0 replies
- 78 views
-
-
The following function generates symmetrical structures based on sequences of tones, which can evolve over multiple generations, resulting in nested symmetries. Here are a few examples mapped to pitches, integers, and rhythms. (defun gen-symmetrical-structure (&key row gen) (let* ((seq1 (filter-repeat 1 (loop repeat gen for i in (rnd-sample '(3 5 7 11) :norep t) append (progn (setf r1 (filter-first 11 row)) (setf r2 (filter-last 11 row)) (setf n i) …
-
- 0 replies
- 206 views
- 1 follower
-
-
Sometime ago, I was searching for a function that would be the exact opposite function of length-legato. Lenght-legato turns this: onto this: I wanted exactly the reverse: Changing this: to this: In the ocasion, Andre Meier came with this code below: Janusz, do you think a good idea to include a function like this in the library ? Or there is also something similar that I dont know ? I still need it in a easy way... Best, Julio (defun length-staccato (n alist) (let ((newlengths) (new-omn (omn-merge-ties (flatten al…
-
- 0 replies
- 1.7k views
-
-
I'm studying the pitch-segment-variant and noticing when the :segment argument includes a list, it doesn't seem to generate but the number of segments represented by the first digit in the list. (setf bach (attribute-series '(leg 8) '((s g2 d3 b3 a3 b3 d3 b3 d3) (g2 d3 b3 a3 b3 d3 b3 d3)))) (pitch-segment-variant bach :size '((20) (30) (40) (100)) :segment '(1 2) :position '? :variant '? :transpose '((0) (6)) :initial t) => ((s g2 leg d3 leg b3 leg a3 leg b3 leg d3 leg b3 leg d3) (s a3 leg b3 leg) (s g2 leg d3 leg b3 leg a3 leg b3 leg d3 leg b3 leg d3) (s f4 leg f4 leg)) However, when the :segment argument call…
-
- 0 replies
- 428 views
- 1 follower
-