Function Examples
Functions, arguments, values and results
265 topics in this forum
-
In my Dissertation, I worked a way to convert every chord and set in a modulo 12 rhythm, so the entire catalog of FORTE are converted to rhythms, following the steps of Babitt: As a hardcore serialist, Babbitt was interested in converting 12-tone rows to rhythms, in a kind of 12-tone rhythm theory. Below, Wuorinen show one example of a typical Babbitt idea: For the sake of explaining my idea of function, it's important to have in mind that for Babbitt, the order of the row is very important and lead to different results in the pitch to rhythm conversion. Take a look in the example below: …
- 40 replies
- 12.9k views
-
Dear All, I found a very interesting way to use the span function to my purposes of controlling the harmonic rhythm of my composition. But I need some help. Here is one example: I set pitch lists for each voice of my quartet. Here is an example of how the material is organized for each voice. Each voice for each chord is broken in 16 repeated notes and another 16 notes with some custom made melodic material. The example below corresponds to TWO chords of the harmony. PITCH MATERIAL LISTS The first 16 notes are repeating and the next 16 notes are melodic figures of the same harmony. This is done for all t…
- 29 replies
- 21k views
- 2 followers
-
Hi, I'm a beginner, can anyone help me? I'm trying to figure out how to transpose the whole list. currently i have transposition individually to each measure in a pitch sequence (setf theme-tr (pitch-transpose '(0 5 -2 3 8 1 6 -1 4 9 2 7) (gen-repeat 12 '((e f5 g5 a5 s gb5 f5 e e5 f5 g5 s e5 eb5) (e d5 e5 f5 s d5 db5 e c5 d5 e5 s c5 b4) (e bb4 c5 d5 s b4 bb4 e a4 bb4 c5 s a4 ab4) (e g4 a4 bb4 s g4 gb4 e f4 g4 a4 -e)))))
- 28 replies
- 1.9k views
- 2 followers
-
Dear all, I updated my library tot (https://github.com/tanders/tot) in various ways. In particular, there are many new functions available. You can now read the documentation online at https://tanders.github.io/tot/. However, remember that you can directly evaluate the many examples in the documentation when (after installing the library) you drag the library folder into your Opusmodus project navigator and open the documentation within Opusmodus. If you are interested in the details of how the library developed, you can see a changelog at https://github.com/tanders/tot/commits/master . NOTE: When you install/upgrade this library, make su…
- 26 replies
- 5.4k views
- 3 followers
-
Dear Opusmodus developers and users, Apologies, this post is rather long, but it actually consists of two posts, a general user questions, and then a feature request or question how we could implement some feature together. Opusmodus provides nce tools for expressing and processing harmonic information. I would like to use that to "quantise" some given OMN expressing into a harmonic progression. More specifically, I have a harmonic progression (for now created by hand) and as a starting point a random melody. The melody should use pitches of the harmonic progression. Below is a first attempt at this. (setf simple-cadence '((c4 maj) (f4 m) (f4 m) (g4 maj) (c4 maj))) (…
- 26 replies
- 7.1k views
-
I'm not an expert in Neo-Riemannian Theory at all but as a consequence of my Common Lisp study and writing of some functions to do Diatonic Neigbour Tones and Leading Tones, I bumped into this and it's kind of what I'm trying to accomplish musically. Does Opusmodus have functions for this (implicitly or explicitly) or does anyone know of a Common Lisp library that is already specialized in Neo-Riemannian transformation? Basically the ability to do P R and L motions using elegant functions and calculating the shortest modulation (shortest Tonnetz steps) from any triad to any other triad. One of the many explanations on youtube:
- 24 replies
- 11.3k views
-
Parsimonious Voice Leading (again): attempts to provide an algorithm In a previous post I deleted, I was trying to find a good way to ensure the minimal parsimonious Voice-Leading (VL) between a sequence of chords. In this post I will try to explain my second attempt. Let's take a look at a sequence of chords, spreaded out almost in a random way, with no VL (setf chordstovl2 '(b3eb5g3 cs6e7gs3 b4f5g6 f7e5c2 d4f7e4 gs7e2a8) Let's specify and evaluate a variable for the number of voices used: (setf voices 3) Let's try to think the best way to connect this pitches with minimal movement. I will apply the following expression to ensure a be…
- 23 replies
- 5.1k views
-
Dear Friends, I'm working with pcs now. A lot of pcs have inverted forms. For example: Pcs 3-11 correspond to the minor triad (037) and also the major triad (047) since both have the same interval vector. But when I evaluate the expression below, I get only the prime form (037) and not the IF (047). Is it possible to retrieve also the inverted form, like the example below ? (setf pcset (pcs '3-11)) >> (0 4 7) ??? Thanks a lot
- 21 replies
- 4.2k views
-
Dear All, Is there a function where you can specify the creation parameters of the melodic patterns devised by Slonimsky on the Thesaurus ? Is there a function where you can specify: 1) The division of the octave (Tritone, Ditone, Sesquitone) ? 2) The pattern way (Infra, ultra, interpolation, and their combinations) ? Thanks for the help ! Best, Julio
- 20 replies
- 4.3k views
- 2 followers
-
I'm doing some work (analytically) with Messiaen's finite permutations of sequences (Livre d'Orgue, Catalogue d'Oiseaux etc) - and want to be able to develop more functions in OM to generate versions of the various options that Messiaen sets out in his later writings and that have been also been analysed in a number of academic writings by others. The messiaen-permutation function in OM is really simple to use, but the documentation is pretty minimal and I cannot figure out what specific permutation this function uses? It does not appear to be either of the two standard 'fan' permutations (open or closed) and it only appears to generate one type of permutation…
- 18 replies
- 1.1k views
- 3 followers
-
Dear Janusz and friends, I´m back to the subject of permutations. The expression below brings all the permutations for a diatonic scale (or any other set you might want to do). (setf diat-permute (permute '(1 2 3 4 5 6 7))) (substitute-map '(c4 d4 e4 f4 g4 a4 b4) '(1 2 3 4 5 6 7) diat-permute) But the list is too long and redundant (I got also a stack overflow when trying to make a snippet out of it (but this is another problem...) The question I´d like to ask is for a function for filtering the rotational variations of a set, to exclude a large number of unnecessary permutations. For Example: (1 3 4 2) is rotationally the …
- 17 replies
- 917 views
- 3 followers
-
dear all here is a setup for playing midi-files/scores in polytempi / follow the instructions and have fun! just ask if you have some questions... greetings andrĂ© - personally i will use it for exact sample/e-player perfomance with my pieces which are working with "Technology-Assisted Conducting" http://polytempo.zhdk.ch ... in future i will do it all directly from OPMO or lisp - "live score generating" + polytempo-conducting + e-player) - i have already done this with my piece MODULAR FORM but not all controlled by LISP/OPMO, so next step is doing it all in OPMO/LISP greetings andrĂ© https://en.wikipedia.org/wiki/Polytempo/ ;;; POLYTEMPO-PLAY ;;; with a MAX-patc…
- 17 replies
- 10.3k views
- 1 follower
-
hello, I'm looking for a way in the last bar (9) to go to 2/4 despite my 4/4 rhythm, is this possible? (setf name '(#|1|# (s f5 g5 a5 c6 f5 g5 a5 c6) #|2|# (s f5 g5 a5 c6 f5 g5 a5 c6) #|3|# (s f5 g5 a5 c6 f5 g5 a5 c6) #|4|# (s f5 g5 a5 c6 f5 g5 a5 c6) #|5|# (s fs5 gs5 bb5 cs6 fs5 gs5 bb5 cs6) #|6|# (s fs5 gs5 bb5 cs6 fs5 gs5 bb5 cs6) #|7|# (s fs5 gs5 bb5 cs6 fs5 gs5 bb5 cs6) #|8|# (s fs5 gs5 bb5 cs6 fs5 gs5 bb5 cs6) #|9|# (s f5 g5 a5 c6 f5 g5 a5 c6) #|10|# (s f5 g5 a5 c6 f5 g5 a5 c6) #|11|# (s f5 g5 a5 c6 f5 g5 a5 c6) #|12|# (s f5 g5 a5 c6 f5…
-
- 17 replies
- 658 views
- 1 follower
-
-
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
- 632 views
- 1 follower
-
Hello, Friends I´m exploring this interesting counterpoint function. When I write the parameter for the keyword :harmony note for note everything works fine, but when I substitute the chords of the :harmony keyword with the content of the variable setf harmony 2 it won´t work, giving the following error: > Error: (harmony2) is not a tonality or a chord. > While executing: %make-tonality, in process Listener-1(7). > Type cmd-. to abort, cmd-\ for a list of available restarts. > Type :? for other options. I´d like to use the :harmony keyword in a way that I can process the chords in other place (by MIDI Entry or genera…
- 14 replies
- 3.7k views
- 2 followers
-
Hi, I have a list (setf exo '((e c4 e4 g4 a4)(e4 g4 bb4 c5)(f4 a4 c5 d5)(fs4 a4 c5 eb5)(g4 a4 c5 e5)( -h)(e a4 g4 e4 c4)( c5 bb4 g4 e4)( d5 c5 a4 f4)(eb5 c5 a4 fs4)(e5 c5 a4 g4)( -h))) with the find-bar function I want this new result (find-bar '(1 8 3 10 5) exo) Is it possible to get this result with a seed? (setf loopbars (omn-to-measure (loop for bar in exo collect (list (filter-repeat 1 (rnd-order (first (gen-divide 4 bar)) :type :pitch :seed 8)) (filter-repeat 1 (rnd-order (second (gen-divide 4 bar)) :type :pitch :seed 8)))) 4/4)) Than…
-
- 14 replies
- 592 views
- 1 follower
-
-
Hello, I am working on a 12-bar sequence based on the harmonic grid of Charlie Parker's "Blues for Alice." I have a list of pitches in sixteenth notes that correspond to the chords of the piece: (setf alice-chord4 '((s fs4 g4 b4 d5)(s bb4 b4 d5 fs5)(s cs5 d5 fs5 a5)(s f5 fs5 a5 cs6);GM7 (s f4 fs4 a4 c5) (s ab4 a4 c5 e5)(s bb4 b4 eb5 fs5)(s d5 eb5 fs5 a5);F#m7b5/B7 (s eb5 e5 g5 b5) (s fs4 g4 b4 d5) (s gs4 a4 cs5 e5)(s c5 cs5 e5 g5);Em7/A7 (s cs5 d5 f5 a5)(s e5 f5 a5 c6)(s fs5 g5 b5 d6)(s bb4 b4 d5 f5);Dm7/G7 (s b4 c5 e5 g5)(s eb5 e5 g5 bb5)(s fs4 g4 bb4 d5)(s a4 bb4 d5 fs5);C7 (s b4 c5 eb5 g5)(s d5 eb5 g5 bb5)(s e5 f5 a5 c6)(s ab5 a5 c6 eb6);Cm7/F7 …
- 13 replies
- 821 views
- 2 followers
-
Dear Friends, What is the exact opposite function of length-legato ? Lenght-legato turns this: onto this: I want exactly the reverse: Changing this: to this: Thanks for help ! Best ! Julio
- 13 replies
- 3.3k views
-
I'm interested in having a complete list of the more high-level algorithms that Opusmodus supports out-of-the-box. This is what I found going through the integrated help documentation: Lindmayer systems Cellular automata Working with pitch class sets Euclidean Algorithm Tonality mapping Mandelbrot sets Rubin (Rubin functions) Twelve-tone row (including All-interval twelve-tone row and Twelve Tone Forms) Klangreihen technique Trobes (composer Joseph Hauer ) The Time Point System (Babbit) Infinity Series (NørgĂĄrd) Messiaen Permutation Stravinsky Ro…
- 12 replies
- 4.7k 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
- 1.1k views
- 3 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
- 699 views
- 2 followers
-
-
I'd like to know why I can't seem to process this list of chords using the pitch-variation function. Thank you! (setf chords '((h a2a3c4 c4a3a3) (h d4f3g2 f4g3d4) (h e4c4a3 c3a3e4) (h d3a3f4 w f4d4a3) (h e2e3g3 g3e4e4) (h a3f4e4 f2e3a3) (h e4g3b3 b3e3g2) (h a2d3fs2 w fs2a2e2) (h a2e3c4 c4a3e4) (h e4g3b3 b3e3g2) (h f2e3a3 a3f4e4) (h e4e4g3 w g3e3e2) (h d3a3f4 f4d4a3) (h e4c4a3 c3a3e4) (h b2a3d4 d4b3a3) (h a3a3c4 w c4a3a2))) (pitch-variation 0 1 7 chords :type '? :seed 23)
- 11 replies
- 1.2k views
- 2 followers
-
Dear All, I'm trying to find a loop for making substitutions in a list, for changing the ranges of a list of pitches. SOME PITCHES (AND WHAT TO CHANGE) (setf pitches '(c4 d4 e4 c4 eb4 f4 c4 eb4 eb5)) (setf i '(c4 eb4)) This will take out the range of the notes, i.e., c4 db5 will became c db (defun convert-pitch (pitches) (loop for i in pitches when (pitchp i) collect (compress (butlast (explode i))) else collect i)) Setting a variable for pitches without range indication (pitnorng) and a new range list (setf pitnorng (convert-pitch pitches)) (setf rangelist '(4 5 3 6 4)) Function t…
- 11 replies
- 2.7k views
-
Hi, Please have merci with me, but I'am not able to build a library (permanent). I've tried to follow the docs, so I first use def-library: (def-library test (:section testing bla1 '(a b c) bla2 '(e f g) )) This seems to work, testing with: (library 'test 'testing 'bla2) ==>(e f g) Next step in my understanding would be: (create-library 'test 'testing 'bla :file "test" ) that gives an error: ==>Error: Incorrect keyword arguments in ("test") What am I missing, surely something very silly that I overlooked,…
- 11 replies
- 1.6k views
- 1 follower
-
So I was saying I'm have a problem with this code. After reading documentation several times, I admit I don't understand how to do it with my code. ;;;variation rythmique Gamme majeure 4/4 (setf mat '((e f5 g5 a5 s gb5 f5 e e5 f5 g5 s e5 eb5) (e d5 e5 f5 s d5 db5 e c5 d5 e5 s c5 b4) (e bb4 c5 d5 s b4 bb4 e a4 bb4 c5 s a4 ab4) (e g4 a4 bb4 s g4 gb4 e f4 g4 a4 -e))) (loop for i in '(0 5 -2 3 8 1 6 -1 4 9 2 7) append (pitch-transpose i (loop for bar in mat collect (list (filter-repeat 1 (rnd-order (first (gen-divide 5 bar)) :type :pitch)…
- 11 replies
- 904 views
- 1 follower