Function Examples
Functions, arguments, values and results
270 topics in this forum
-
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
- 124 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
- 68 views
-
-
Greetings: This function appears in the documentation. However, it does not appear in OM to be a compiled function. Has this been removed? With thanks.
- 3 replies
- 96 views
- 1 follower
-
Dear Team, I noticed that the omn-to-time-signature, when used with length-only material is not returning the same rhythms. The rhythms are missing the ties when used with lengths only. With pitch + length materials looks to be ok. I used to think that this function would return the same rhythms, but just adjusted to a new sequence of time-signatures. Best, Julio (setf rh-1 '(-dd h c7 p eb6 mp p - c7 q e6 - h_e g6 e mf bb5 mp -h.. q bb6 p -h. q. d6 e c4 -h.. q bb3 mf e g6 mp h_e e6 -h e g5 h a6 -e = h bb4 e6 p q bb6 mp e6 e g3 g6 p q. g3 e bb3 bb6 mp q g6 pp e c7 mp eb4 p)) (omn-to-time-signature rh-1 '(2 4)) res…
- 2 replies
- 117 views
- 1 follower
-
Hi all, I tried to answer the question in the title with Opusmodus GPT (see attached file). (setf lenmap1 '(q q q q q q q q q q q q q q q q)) (setf vec (half-sine 50 1)) (setf vec-lenmap1 (vector-map lenmap1 vec)) Can anybody explain, why I get only 50 quarters instead of 16 respectively how vector-map really works mathematically? Thanks and greetings, Achim vector-halfsine.md
-
- 3 replies
- 131 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
- 94 views
- 1 follower
-
-
Hi, could someone help me? I have a problem with the length-augmentation function! this result is ok! (length-diminution 2 '(q e e e e)) I changed my rhythm, it's ok! (length-diminution 2 '(e q e e e)) first rhythm cell is ok in the code! second rhythm cell is not good in the code I get a bad rhythm result in my code and I don't understand why. (setf Gra3/8 (omn-to-measure (make-omn :pitch (omn :pitch (omn-to-measure (loop for x in tetrn collect (filter-repeat 1 (rnd-order x :type :pitch :seed 3))) '(1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/…
-
- 2 replies
- 212 views
- 2 followers
-
-
I've been having a long session with Opusmodus ChatGPT. My aim has been to make a process driven score with a group of functions, from which would randomly be selected one to produce patterns for each section. I have two versions of gen-euclidean-omn, one getting argument values from outside lists and one inside let-form, and one version of polygon-rhythm. Things have been developing quite complicated, even ChatGPT haven't found a solution. In the resulting omn '-markings have been expressed with quote-word, which doesn't produce any score. The last hint from ChatGPT was to clean the result with replace-quote function, which doesn't work either. In score example you see t…
- 16 replies
- 777 views
- 1 follower
-
Hello , I try to write a function based on tonal expansion from Schillinger system of musical composition , with little success , do you have any idea how to write it for Opusmodus , i attached several example of expansion E0 E1 ...... E5 from the book Thank you Patrick Scale Tonal Expansion .pdf
- 4 replies
- 243 views
- 1 follower
-
Hi, I don't understand why I have a difference between my output (diatonic-chord '(:f Imaj7 ii7) :inv '(0 0)) =>(f4a4c5e5 g4bb4d5f4) and my snippet which displays a different voicing with f on basse of the second chord. Thank you for your help.
- 9 replies
- 309 views
- 1 follower
-
It would be very useful in replace map an option to automatically replace-map all over octaves , i mean (Replace-map "(( c4 e4) (d4 f4 ) (e4 g4 ) ....... (b4 d5) (rnd-sample 12 '( c4 d4 e4 f4 g4 a4 b4 )) would map all the pitches to all octaves from the mapping origin and to the mapping destinations , instead of writing all of them by hand . Thanks Patrick
-
- 2 replies
- 203 views
- 1 follower
-
-
Hello i am looking for a function which generate chords third by third from a scale pitch list For example : ( chord maker '3 '(c4 d4 ds4 f4 fs4 g4 gs4 a4 as4)) which would give as result ===>. ( c4ds4fs4 d4f4g4 ds4fs4gs4 f4g4a4 fs4gs4as4 g4a4c5 etc......) ( chord maker '4 '(c4 d4 ds4 f4 fs4 g4 gs4 a4 as4)) which would give as result ===>. ( c4ds4fs4gs4 d4f4g4a4 ds4fs4gs4as4 f4g4a4c5 fs4gs4as4d5 g4a4c5ds5 etc......) Thank you Patrick Mimran
-
- 2 replies
- 184 views
-
-
how may i assign for example (12 1) to all bars of the composition instead of only bar one ? Or from bar 1 to bar x (counterpoint patterns '(((8 2 3 5) :harmony major) ((4 2 2 6) :harmony major) ((1 8 7 *) :harmony major) ((1 2 * 8) :harmony major) ((1 2 * 8) :harmony major) ((1 1 * 1) :harmony major)) :global-methods '((fl) (cl) (hn) (vc)) :global-polyphony '((1 p) (2 o) (10 o) (11 o) (12 1) (24 o) (36 o )(0 o)) :iterate t :index 'v1-) Thank you Patrick
-
- 7 replies
- 333 views
- 2 followers
-
-
Hello i would like to divide a series of lengths into bar measure signature like 4/4 or 6/8 etc... But i would like to cut the overlapping lengths over the bar measure if any . I tested omn-to-measure but it doesn't cut oeverlap lengths over the measure Thank you Patrick
- 2 replies
- 139 views
- 1 follower
-
Hi, would it be possible to get the same result as harmonic-progression with the diatonic-chord function? thanks for your help (setf a (harmonic-progression '(1 6 2 5 3 6 2 5 1) scale :base 1 :size 3 :step '((2 2)))) (setf cad1 (diatonic-chord '(:c I vi ii V III vi ii v I)))
-
- 2 replies
- 183 views
- 1 follower
-
-
Here is a small question for the gurus of Opusmodus. I am developing sketch materials for some piano music (a solo work and also a work for three pianos). I am generating material as 'rh and 'lh using the piano-solo-layout. What I am trying to figure out is how to make the layout three staves and to place the music by register into the three staves, so that the pianist can work out the fingering and hand-crossing more easily and effectively during the sketching and feedback process. Can anyone point me in a good direction? With thanks!
- 5 replies
- 646 views
- 2 followers
-
In earlier versions of OM there was a function called random*. This seems to be gone. Does anybody remember what it did? Thanks for a hint. Achim
-
- 5 replies
- 304 views
- 2 followers
-
-
Hi, I can't get this function to work with an error message (setf 000504b "~/Opusmodus/Media/MIDI/Bach/Chorals/000504b_.mid") (midi-to-omn 000504b :instrument 1)
-
- 12 replies
- 791 views
- 2 followers
-
-
Salut, J'aimerais utiliser la fonction omn-to-time-signature directement dans mon code Gr, si quelqu'un peut m'aider. Merci ! ;;;découpe de barre (setf time-signatures (gen-repeat 2 '((2 4 1) (3 4 1)(2 4 1)(2 4 1)(2 4 1))) ;;;11/4 bar trop long (setf Gr (butlast (omn-à-mesurer (make-omn :pitch (omn :pitch (omn-à-mesurer (boucle pour x dans tétra collecter (filtre-répéter 1 (rnd-order x :type :pitch :seed 5))) '(1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4))) :length (omn :length (omn-à-mesurer …
-
- 6 replies
- 397 views
- 2 followers
-
-
Hi, Is it possible to write a function which gives the following result: ((1)(1 2 2)(1 2 2 3 3 3)(1 2 2 3 3 3 4 4 4 4)(1 2 2 3 3 3 4 4 4 4 5 5 5 5 5))etc. Thanks for any suggestions!
- 2 replies
- 310 views
-
Hello! I've been coding in python for two weeks for work and I'm now having trouble figuring out what I'm doing wrong in my lisp loops. Cursor.ai isn't helping debug my lisp at all. I'm trying to loops through scales such as (setf a-pitches (loop for note in scalea collect (list note (+ note 4)))) And it's not evaluating. I was hoping to do this in OpusModus with a little help from cursor for lisp but that's not yielding good results. There's probably an OM function I'm not thinking of. Here's the whole set of functional code. Any advice is appreciated. ;;;---------------------------------------------…
- 2 replies
- 279 views
-
Hello, I'm trying generate midi to play Amplesound guitars where each midi event is on a channel per string basis. 1st string is midi channel 1, 2nd string midi channel 2. I tried doing it the way I pasted below, but the midi ends up being 6 instruments rather than 1 instrument with notes on 6 channels. So that doesn't work. Is there a way to have articulations for notes, translate into a midi channel? Or any other ideas? (setf 1-string '(-h e4)) (setf 2-string '(-eq q c4 eq c4)) (setf 3-string '(-q h g3 q g3)) (setf 4-string '(-e qh e3 e e3)) (setf 5-string '(q. c3 f e c3 p h c3 f)) (setf 6-string '(-w))…
-
- 9 replies
- 498 views
- 2 followers
-
-
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
- 240 views
-
ChatGPT made this function. It works if you change :forte to :pitches. But the results will also be :pitches type. Is there any way to find a Forte name for a set consisting of numbers or pitches? Pcs-analysis of course, but it has to be used one set at a time. (defun find-pitch-classes-with-interval (interval-value interval-class cardinality) (let* ((pitch-sets (pcs-cardinal cardinality :forte)) ; Retrieves sets in Forte notation (matching-sets (remove-if-not (lambda (set) (let ((vector (interval-vector set))) (and (>= (nth interval-class vector) interval-value)))) pitch-sets))) match…
- 8 replies
- 713 views
- 2 followers
-
There are 10 functions that have a key parameter :assoc. None of the documentation is particularly clear on what it is or what it does. Most of the functions just list that it is an integer and that it defaults to 12. The only other description that is sometimes added is "row size," but that description is also attached to the :mod key parameter for a number of the functions. I ran the following code to generate a report of how :assoc impacts the row-variants function when run on ordered intervals under various levels of transposition: (pprint-expression (loop for x from 1 upto 11 collect (list (concatenate 'string "Set: (0 " (write-…
-
- 2 replies
- 295 views
- 2 followers
-