Function Examples
Functions, arguments, values and results
302 topics in this forum
-
Hello people, again struggling to find the name of the function which ranges all values in a list to a specific sum of the list. Any help?
- 9 replies
- 1.5k views
- 2 followers
-
Hello, This seems like a simple issue but I think there's some underlying lisp concept I'm missing. I'm trying to apply length-augmentation to a list rather than explicit lengths and getting an error. So to begin with I import a plainchant MIDI file: (setf source "/Users/tomtolleson/OpusModus/Scores/The Bifurcated Fruit of a Mirror/MIDI/dominabi.mid") I define the lengths from the source as "sourcelengths" (setf sourcelengths (midi-to-omn source :type :length)) This all works properly. Now, if I apply length-augmentation to a series of lengths explicitly (from the documentation): (length-augmentation 2 '(1/8…
- 3 replies
- 969 views
- 1 follower
-
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
- 727 views
-
Hi! If I have an omn sequence including pitches, lengths, and articulations is there any way to change events into rests? Some kind of procedure of "filtering out" (silencing) some notes in either a deterministic or random fashion. Thanks! Rodrigo
- 12 replies
- 2k views
- 3 followers
-
Hi! Is there a function like merge-voices that would work for omn sequences with articulations? If I merge two sequences with merge-voices containing articulations they are lost in the merging process.
-
- 3 replies
- 901 views
- 1 follower
-
-
(defun prob-mutation (alist blist &key (factor 1) (prob-list nil)) (loop for a in alist for b in blist for x in (if (null prob-list) (cumulative-sums (gen-repeat (length alist) (float (/ factor (length alist))))) prob-list) when (probp x) collect b else collect a)) ;;; with linear prob-incf (prob-mutation (gen-repeat 100 1) (gen-repeat 100 2)) => (1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 2 2 2 1 1 1 1 2 2 1 2 2 2 1 1 1 1 1 2 1 1 1 1 1 2 2 1 1 2 2 1 1 2 2 2 2 1 1 2 2 2 1 1 2 1 1 1 1 2 2 2 2 2 2 2 2 2 1 2 2 2 2 1 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2) ;;; with an external prob-list …
-
- 0 replies
- 646 views
-
-
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
- 653 views
-
Hello, I am trying to get a rhythm out of the following function: (quantize (length-adjust 8/4 (vector-to-length '1/24 4 1 v1b)) '(1 2 3 4 6)) (v1b is a predefined half-sine vector) Despite using quantization I keep getting results that include unplayable tuplets, such as single tuplet notes followed by e.g. an eigth note: How can I prevent this from happening and get a rationally quantized rhythm?
- 3 replies
- 949 views
- 1 follower
-
Hello , i am looking to find a way to assign random midi channel numbers with the possibility to set some repetition of midi channel number as an option EX : in turn midi channel 1 2 3 4 5 6 or 1 1 1 1 2 2 2 2 3 3 3 12 13 14 etc .... The midi channel are distributed for each pitch, beat or a measure or set of measures per voice Thanks Patrick
- 3 replies
- 850 views
- 1 follower
-
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
- 689 views
- 1 follower
-
-
Hey everyone, I want to create movement from f1 to c1 in a timeframe of 5 seconds. How can I generate random note values until 5 seconds are reached? Repetitions of notes should also be possible. Here's what I got so far: (make-omn :length (rnd-sample 6 '(s -s e q)) :pitch (midi-to-pitch '(65 64 63 62 61 60))) Thanks in advance, Veit
- 3 replies
- 946 views
- 1 follower
-
Dear All, I think there is a much needed basic function in Opusmodus: a function to perform diatonic transposition, like (pitch-transpose-to-set (1) '(c4 d4 e4) :set '(c4 major)) result: (d4 e4 f4) (pitch-transpose-to-set (2) '(c4 d4 e4) :set '(c4 major)) result: (e4 f4 g4) (pitch-transpose-to-set (1) '(c4 d4 e4) :set '(d4 major)) result: (cs4 e4 fs4) (pitch-transpose-to-set (2) '(c4 d4 e4) :set '(cs4 whole-tone) :round up) result: (cs4 ds4 f4) It could be also have the possibility of being octave independent in relation to the set, like (pitch-transpose-to-set (1) '(c2 d6 e5) :set '(c4 major) :octave-free t) result: (d2 e6…
-
- 2 replies
- 788 views
- 1 follower
-
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; subfunction (defun reset-integer-sequence (alist &key (offset 0) (flatten nil)) (let ((min (find-min (flatten alist)))) (progn (setf alist (cond ((listp (car alist)) (loop for j in alist collect (loop for i in j collect (+ (- i min) offset)))) (t (loop for i in alist collect (+ (- i min) offset))))) (if (equal flatten t) (flatten alist) alist)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;…
-
- 0 replies
- 663 views
-
-
Is there any possibility to force a brownian motion to be reflected within a lower and an upper (maybe even changing) limit? Thanks for suggestions. Achim
- 10 replies
- 1.8k views
- 2 followers
-
Hi all, is there a function/ method to merge several rhythms into one which is displaying all the onsets of these rhythms. Here the first two systems are merged into the third. Thanks for help. Achim
- 4 replies
- 1.2k views
- 2 followers
-
Dear All, Please, help ! ;;; Question How to use DICTUM to filter the use of omn-to-time-signature ? ;;; MAterial (setf vl1 '((-s) (e. gs4 s as4 h. e4 tie) (h e4 d4 tie) (q d4 e ds4 s fs4 hs b4 tie) (h b4 s gs4 g4 a4 qs c5 tie) (q c5 s as4 e a4 cs4 e. d4 d4 s) (w g4 tie) (q g4 h. d5) (e b4 s g4 h.s f4 tie) (q f4 s ds4 e4 f4 hs fs4) (s c5 e as4 ds5 e. cs5 fs4 s g4 q fs4 tie) (w fs4) (h. g4 e gs4 s a4 d5 tie) (w d5) (s b4 g4 a4 hs s gs4 e as4 s e4 tie) (s e4 e. d4 ds4 s fs4 h b4 tie) (h. b4 q gs4 tie) (h gs4 e g4 s a4 qs c5 tie) (h. c5 s as4 a4 cs4 d4 tie) (h d4 s e e g4 e. d5))) ;;; Filter works rigth in this example: pitch transposing only long …
-
- 0 replies
- 556 views
-
-
Does anybody have an idea, how to sample x equidistant values from an env like xy-plot? (xy-plot '((2 0) (3 1) (5 1) (7 2) (11 3) (13 5) (17 8) (19 13) (20 21)) :join-points t :point-radius 2 :style :axis :point-style :square) For example 10 values from this graph:
-
- 0 replies
- 579 views
- 1 follower
-
-
Does anybody have an idea, how to loop through a directory and writing the content of a textfile (like the one attached) without the semicolons into normal lists? Thanks for help. Achimch1-amp-envs.txt
-
- 4 replies
- 985 views
- 2 followers
-
-
Bildschirmaufnahme 2023-03-18 um 14.05.56.mov OPMO
- 5 replies
- 1.7k views
- 1 follower
-
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
- 549 views
-
-
Is there a shorter way to write this in OM? (loop for i from 1 to 9 collect (* 100 i))
- 8 replies
- 1.3k views
- 2 followers
-
Is there a function that returns all intervals from a chord? Thanks, Achim
- 6 replies
- 1.2k views
- 1 follower
-
Is there an Opusmodus function that counts the number of items in each sublist? '((c4 d4 e4) (f4 g4) (a4) (b4 c5)) => (3 2 1 2) Thanks!
- 5 replies
- 1.3k views
-
I have two brief examples taken from a piano piece. In the first one, I'd like to attach the piano pedal marking on every octave, hold it and reattach at the next octave. (setf ex1 '((-q a2a1 a2a1) (-q a3a2) (-wq q b2b1) (-wq q b2b1) (-q a2a1 - g3g2) (-q f3f2 a2a1) (q f3f2) (q f2f1) (-wq q f3f2) (-q g2g1) (-q g2g1 - g2g1) (-q f2f1 e3e2) (-q f2f1 d3d2) (-w q d3d2))) In the second, I'd like to attach the piano pedal on every octave - not single pitches - and hold it until the next octave appears, and reattach it again. (setf ex2 '((-q) (q g4 mp -) (q a4 mp - a4a3) (q cs4 mp - cs4cs3 -) (q f4 mp - f4f3) (q f4 mp - f4f3 -) (q e4 mp - …
-
- 1 reply
- 648 views
-
-
I just started working with Opusmodus 3 and noticed that preview score playback might work differently, at least on my end. Using the custom sound sets via Logic works when evaluating individual code snippets and def-score blocks. However, when evaluating ps blocks in the same context produces this error message: OM 8 > audition-musicxml-omn-snippet Error: OMN Parse Error: fail 1 (abort) Return to top loop level 0. Type :b for backtrace or :c <option number> to proceed. Type :bug-form "<subject>" for a bug report template or :? for other options. I attached the screenshots of Opusmodus Audition Preferences and a code excer…
- 5 replies
- 1.2k views
- 1 follower