Function Examples
Functions, arguments, values and results
296 topics in this forum
-
Dear All, Here is a proto-function idea... If Janusz or someone are interested in transform it in a core function, I think it could be interesting... Sometimes I like to take a motive or chorale texture and use it to make a kind of accompaniment or texture ala Reich. I created my way to do it, but it could be perfected in a better function and integrated in the core system. Here is the idea: ;; Motive (setf mat '(h c4 q. d4 e e4 -q w c4 h d4 q e4 -q)) ;; small value (setf fig-value '(e)) The "proto-function". What I could not achieve was how to make it respect the rests in the motive, but it works for generating the texture, respecting the pitch and length boundar…
- 6 replies
- 161 views
-
Hello, I found a function that is missing documentation: 2d-matrix->linearized-upper-trangular. Would you mind explaining this briefly? I hope to see the documentation added to the next update. Thanks!
-
- 0 replies
- 58 views
-
-
As hobbyist I am trying to learn how Jazz works and then explore what I have learned using OM for composition. For the composers and musicians among you following might seem trivial, so this post is probably only relevant for beginners like me (except for the question at the end of the post) But for me it's all new and exploring and discovering new concepts is fascinating. OM helps me a lot as learning tool to conceptualize and reuse in a principled, reproducible manner. In Jazz for piano comping, the use of rootless shell-voicings is common as far as I have learned. I have learned in a text book (Jeremy Siskind, Jazz Band Pianist), that typically for chord comping the …
-
- 1 reply
- 109 views
- 1 follower
-
-
Hi All, I am taking my first steps into Opus Modus, and it is a big change from using Open Music. I'm trying not to miss the visual environment, which has always worked better for my brain, but there are definitely growing pains along the way. I am trying to complete a fairly simple task, but I just cannot figure out which functions allow me to do so. I want to complete the following; Create a list B of length n and fill that list with elements randomly selected from list A. If list A contains ((1 2) (3 4) (5 6) (7 8) (9 0)) And list B is length 2; We should be able to generate list B that contains two selections of those tuples now in their own list Ex; A = ((3 4) (9…
- 4 replies
- 182 views
- 3 followers
-
I just want to share a AHA-moment and nothing more than my admiration for OM... The function closest-path is documented to voice-lead chords, which already in my view is a great use-case. But do you know that it also helps to get a cohesive monophonic line from otherwise pretty scattered pitch collection as its often the result of a stochastic generation processes ? Most of you will know this already, having a musician background and it might feel trivial (the mere name voice-leading already indicates it). So I am writing this more to share my surprise and learning for those coming rather from „outside“. I was so nudged by the docu which covers chords, so that I did n…
- 3 replies
- 199 views
- 2 followers
-
As far as I have read OMs excellent documentation, there's no function which helps to prepare a binary-list for driving a do-timeline to play/pause solo-instruments with occasional multiplay, where a couple of constraints like probability and max multplay can be defined and one of many possible solutions is returned. I tried with help of chat-gpt to code to do this. Although tests look plausible I believe this is not a well coded function (robustness, edge cases, seed handling, etc). Any thoughts ? ;;; ;;; n solo-instruments play in a band for l periods ;;; the ratio of multiplay is defined by r ;;; max-n instruments can play together ;;; ;;; Function which supports de…
- 6 replies
- 254 views
- 3 followers
-
Dear Friends, With the audio tools in windows can we make some breakbeats, like chopping audio files, like beat slicing and starting in different parts of the audio file, like the video below (serato sample plugin), and also sync accurately with midi parts in Opusmodus ? All the best ! Julio SOME HISTORY Here are some breakbeats (amen sample) If possible, would be great to includ a sample of the amen beat inside the documentation with an example of breakbeat. This function can also serve to launch samples of any nature for electroacoustic or mixed music.
- 11 replies
- 460 views
- 2 followers
-
Followup on post: https://opusmodus.com/forums/topic/3989-om-lydian-chromatic-concept-of-tonal-organization-george-russell/ According to LCCOTO chords which are derived from a parent scale have a nice property as they all lean on the same lydian parent-scale- tonic, hence may feel similar in harmonic environment. This may be used for various compositional purposes. Example: A G7 -> Cmaj7 cadence is in LCCOTO basically a movement of F-lydian-parent-scale-tonic to C-lydian-parent-scale-tonic. Moving clockwise on circle of fifths with regards to parent scales tonic. G7 is a chord on mode 2 in f-lydian. Cmaj7 is chord on mode 1 in c-lydian. According to LCCOTO it should…
- 2 replies
- 254 views
- 2 followers
-
Followup on post: https://opusmodus.com/forums/topic/3989-om-lydian-chromatic-concept-of-tonal-organization-george-russell/ Here's a first attempt (I am a LISP beginner) for a function which finds the parent scale for a list of chords. ;;; --------------------------------------------------------------------------- ;;; ;;; Find a Lydian Parent Scale for a Melody over a given chord list ;;; ;;; (Lydian Chromatic Scale Concept, George Russell) ;;; ;;; The returned list fulfills the condition that all chord pitches ;;; are included in the scales. ;;; ;;; By default only the 12 lydian scales are queried. ;;; One can supply additional scales according to Russells con…
- 4 replies
- 373 views
- 2 followers
-
Hi, Is there a complete list of chords already included in OM? I would like to write, for example, am7b5/maj7 (a c eb g#), but it doesn't work. Thank you for your help.
-
- 2 replies
- 127 views
- 2 followers
-
-
Followup on post: https://opusmodus.com/forums/topic/3989-om-lydian-chromatic-concept-of-tonal-organization-george-russell/ I am trying to use the LCCOTO-concept here in a simple piece as a means to modulate tension release. Pitch ranges from a C lydian chromatic scale are chosen by lead instrument according to a tendency curve: LCC2.mp3 ;; -------- ;; ;; LCC2 ;; ;; -------- ;; ;; Idea of composition: ;; Define pitch C as Parent Scale Tonic, it's the center of tonal gravity following the LCCOTO of George Russell. ;; C Lydian Chromatic scale tonic is our only scale in this modal piece. ;; Tension and release is created by ;; - by modulating pitches according to their…
-
- 0 replies
- 206 views
- 2 followers
-
-
Hi, is there a function similar to gen-retrograde? In my example, I have 6 blocks. I would like to obtain the order 6 → 5 → 4 → 3 → 2 → 1, without ever reversing the inside of the blocks. In other words: replay the pitches starting from the beginning of each block 6 → 5 → 4 → 3 → 2 → 1. (setf pit '(e4 e4 e4 e4 e4 e4 e4 e4 e4 fs4 fs4 fs4 e4 e4 e4 fs4 fs4 fs4 e4 e4 e4 fs4 fs4 fs4 g4 g4 g4 e4 e4 e4 fs4 fs4 fs4 g4 g4 g4 e4 e4 e4 fs4 fs4 fs4 g4 g4 g4 a4 a4 a4 e4 e4 e4 fs4 fs4 fs4 g4 g4 g4 a4 a4 a4 e4 e4 e4 fs4 fs4 fs4 g4 g4 g4 a4 a4 a4 b4 b4 b4 e4 e4 e4 fs4 fs4 fs4 g4 g4 g4 a4 a4 a4 b4 b4 b4 e4 e4 e4 fs4 fs4 fs4 g4 g4 g4 a4 a4 a4 b4 b4 b4 c5 c5 c5 e4 e4 e4 fs4 fs4 fs4 g4 g4…
- 2 replies
- 158 views
- 1 follower
-
Does anybody have an idea, how to rewrite the loop construction below with OM functions? (setf beethoven-ode '(q e4 e4 f4 g4 g4 f4 e4 d4 c4 c4 d4 e4 q. e4 e d4 h d4)) (loop for j in (gen-transition 0 0.1 8 1) collect (quantum beethoven-ode :fraction j :seed 123)) Thanks for help. Achim
- 2 replies
- 215 views
- 2 followers
-
Hi, Could someone explain to me why the 4th chord uses a drop? (setf vl (diatonic-chord '(:c I6add6 bviio I6add6 bviio) :inv '(0 0 1 2))) I'd like to achieve this result with diatonic-chord (c4e4g4a4 d4f4gs4b4 e4g4a4c5 f4gs4b4d4 g4a4c5e5 ab4b4d5f5 a4c5e5g5 b4d5f5ab5) Thank you for your help. David
-
- 2 replies
- 233 views
- 2 followers
-
-
Hello, I'd like to find all permutations / orderings of pitch classes across 2 octaves without repeating pitch classes. So given c4 d4 e4 for example, I'd like permutations that would include like c4 d3 e4 and d4 e3 c5 but not include repeating pitch classes like c4 c3 for example. How would I find that? Thanks for any info!
- 7 replies
- 522 views
- 3 followers
-
I’ve been spending a lot of time reworking my sound sets over the past year - and having acquired several new VIs (mainly VSL) during this time, I now need to find more consistent ways of mapping articulations to key switches so that results when working across different VIs are as expected. My sound sets all use omn articulations linked to key switches and cc controller changes in the format: leg (:key c0 :key c1 :key c2 cc20 65) - and so on. This is typically how I have all the VSL instruments set up to trigger in Synchron Player. This approach works well even when there may be five or six levels (dimensions in Synchron Player) of key switches. I don’t have any probl…
- 6 replies
- 501 views
- 3 followers
-
Hi all, I created the following material (preview with cmd-2) and would like to extend the longest voice to fit a complete measure (e.g. 4/4) by adding rests and adjust all the other to the same length by adding rests as well. Any ideas how to achieve this? (setf beethoven-ode '(q e4 e4 f4 g4 g4 f4 e4 d4 c4 c4 d4 e4 q. e4 e d4 h d4)) (setf trans (loop for j in (gen-transition 0 0.1 8 1) collect (quantum ode-mat :fraction j :quantize '(1 2 4 5))))Thanks for your help. Achim
-
- 3 replies
- 715 views
- 2 followers
-
-
Hello all, is there a function in Opusmodus similar to this one? Best, Achim (defun x-dx (ls) " Returns the list of the intervals between the consecutive values of a list <ls>. <ls> can also be a list of lists. Examples: (x-dx '(0 340 450 600 500 123)) => (340 110 150 -100 -377) (x-dx '((0 340 450 600 500 123) (30 200 350 500 450 200 600))) => ((340 110 150 -100 -377) (170 150 150 -50 -250 400))" (labels ((x-dx-fun (lst) (loop for i in lst for j in (cdr lst) collect (- j i)))) (if (numberp (first ls)) (x-dx-fun ls) (mapcar #'x-dx-fun ls))))
-
- 2 replies
- 525 views
- 2 followers
-
-
Hi, Is there a function in Opusmodus which collects all consecutive same pitches into one duration? '(s c4 c4 c4 c4) => '(q c4)
-
- 2 replies
- 402 views
- 2 followers
-
-
Hello all, is there an OM version of a function similar to this? Thanks for a hint. Achim (setf pitches '(c4 d4 e4 f4 g4 a4 b4)) (let ((lp (- (length pitches) 1))) (loop for i from 0 to lp collect (loop for j from i to (min lp (+ i (rndn 0 2))) collect (nth j pitches))))
- 4 replies
- 305 views
- 2 followers
-
Hello all, please can somebody explain to me what vector-map is actually doing (mathematically) when my random numbers are mapped? For me its obvious with the sorted list, but despite of seeing some similarities between the half-sine and the mapped random numbers I don't understand completely the procedure. Thanks a lot for help. Achim ;; This is just to make the function completely symmetrical :-) (defun half-sine-complete (res amp freq) "Adds the first value of the second half of the sine to half-sine" (let ((hsine (half-sine (- res 1) amp :freq freq))) (append hsine (list (first hsine))))) ;; resolution of half-sine-complete (24) = number of pitches (list-plot …
- 4 replies
- 447 views
- 3 followers
-
Dear all, I would like to program an idea from Tom Johnson's “Other Harmony” in Opusmodus, Adjacent Intervals: All chords have d4 as their lowest note and c5 as their highest note. The four intervals between these two notes are 4 3 2 1 (semitones), and these are permuted to create these 24 chords: Is there a possibility in Opusmodus? My programming skills are very limited. How is it possible to start all number combinations (the intervals) from, for example, d4? (setf it1 (permute '(4 3 2 1))) ;; How to get this programmed? (setf p1 (interval-map 'd4 (find-bar '( 1) it1 )) p2 (interval-map 'd4 (find-bar '( 2) it1 )) p3 (interval-map 'd4 (find-bar '( 3) i…
- 3 replies
- 508 views
-
Hello all, is there a function which reduces the ambitus of intervals in a given row of pitches? Thanks for a hint. Achim
-
- 3 replies
- 380 views
- 2 followers
-
-
Here’s a small function I needed because I’m working with "binary counting patterns". All patterns must always have the same length (a fixed bit length determined by the largest value). (defun dec-to-bin-rhythm (ilist) (let ((span (find-max (mapcar 'length (decimal-to-binary ilist))))) (loop for i in (binary-rhythm span ilist 1 :type 1) collect (loop for x in i when (< x 0) append (gen-repeat (abs x) 0) else collect x)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; to ensure the pattern is always the same…
-
- 0 replies
- 279 views
- 1 follower
-
-
Fixed intervals: each generation extracts a predefined interval-sequence. Within the simulation loop—which runs and visualizes multiple generations—users can choose whether to display intervals or absolute pitches. With every generation (or evaluation), the initial binary sequence is modified. This dynamic updating makes the specific behavior of each rule more apparent, allowing for clearer comparisons between different cellular automaton rules. (progn ;; set rule number ;(setf rule 12) (setf rule (random 257)) ;; set n simulations (setf sims 5) (loop repeat sims do (progn (setf intervals (pitch-to-interval (rnd-air :group :symmetric :…
-
- 2 replies
- 373 views
- 2 followers
-