Function Examples
Functions, arguments, values and results
312 topics in this forum
-
Dear friends, I'm still learning. This is a simple thing. How can I put inside a function the name of a variable, like the example below. I want to do this: (gen-binary-row 12 '(0 2 5 7 8 11)) >> (1 0 1 0 0 1 0 1 1 0 0 1) But in this way: (setf binrow '(0 2 5 7 8 11)) (gen-binary-row 12 '(binrow)) What am I missing ? Thanks for help. Best, Julio
- 6 replies
- 2.7k views
-
Hi Everybody I found a great app to upload and share your music here is the address you can test it it is much better and classy than Soundcloud https://octave.is/pmimran/privatealbum/patrick%40mimran.com/em2XkPshTa Patrick Mimran
-
- 0 replies
- 1.2k views
-
-
Stephane Boussuge wrote on 23 October > your edit-omn function is definitively super-mega useful !! I updated my function edit-omn. Remember that this function is for turning relatively simple functions processing some OMN parameter sequence (e.g., pitch or length lists) quasi automatically into much more expressive functions processing arbitrary OMN expressions, including nested expressions, and automatically supporting typical Opusmodus arguments like section and flat. I now added support for creating functions with 'dynamic' arguments, i.e. arguments where different values are used for processing different sublists of OMN expressions. Fo…
- 2 replies
- 1.9k views
-
Hello, I'm aware of pcs-analysis (which prints data), but I'm looking for a way to collect lists of Forte-style interval vectors into a data structure in order to query them for similarity and difference. Something like: (get-interval-vector '3-1) -> (2 1 0 0 0 0) Is there an easy way to do this? thanks, Michael
- 2 replies
- 2k views
-
Here is a rather simple function that might be useful for others as well. The function rotate-omn rotates a sequence by the given number of positions, much like gen-rotate. However, you can specify which parameter you want to rotate, whether you want to rotate the flattened sequence or subsequences separately, or only certain subsequences. (setf melody '((-h q c4) (q. f4 e g4 q a4) (h. g4))) (rotate-omn :right melody) ; => ((-h q g4) (q. c4 e f4 q g4) (h. a4)) (rotate-omn :left melody :parameter :length) ; => ((q c4 q. f4 e g4) (q a4 h g4 tie) (q g4 -h)) (rotate-omn 2 melody :section '(1) :flat nil) ; => ((-h q c4) (q. g4 e a4 q f4) (h. g4)…
-
- 0 replies
- 1.7k views
-
-
I sometimes like to turn certain notes into rests. The built-in function length-rest-series is great for that, but it only works with lengths, not full OMN expressions. So, I generalised that function. I can do now, e.g., the following. (setf melody '((s eb6 < leg f5 < leg c5 < leg f5 < leg) (e e6 f - -q))) (note-rest-series '(1 1) melody :swallow T :section '(0)) ; => ((-s - c5 < leg f5 < leg) (e e6 f - -q)) Note that in contrast to the original function length-rest-series, the new function note-rest-series does not only support OMN expressions, but also extra arguments like swallow and section. The defi…
-
- 6 replies
- 2.5k views
-
-
Dear all, I just released a library that makes Rick Taube's Pattern Streams from Common Music (version 2) usable in Opusmodus. If you are interested then follow the link below. https://github.com/tanders/cm-patterns Best, Torsten
-
- 2 replies
- 2.7k views
-
-
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.5k views
-
-
Dear Friends, Is there some function that deals with finding the shortest path between, for example, a trichord "a" to a trichord "b" ? In general, how to find the shortest path from a collection of notes (i.e. a chord) "a" to a collection of notes "b" (both in the same cardinality) ? Thanks in advance ! Best ! Julio
- 5 replies
- 2.4k 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
- 6.3k views
-
In the following line of code, what is the difference between vector and float? (vector-to-velocity 0.1 0.9 (pitch-to-velocity 'pppp 'ffff '(c1 d1 e1 f1 g1 a1 b1 c2 d2 e2 f2) :type :float)) The function name is 'vector-to-velocity' but in pitch-to-velocity the type is set to :float (instead of :vector). Looks like they are synonyms. Thanks in advance, Wim Dijkgraaf added 2 minutes later I guess this is the answer: Vectors are one-dimensional arrays, therefore a subtype of array. Wim :-) added 7 minutes later Code above being equal to: (pitch-to-velocity 'pppp 'ffff '(c1 d1 …
-
- 0 replies
- 1.5k views
-
-
Hi, how can I do to emulate this wonderful Fibonacci function in Symbolic Composer, great to create "background" patterns. 'cause the Fibonacci in OM handle just numbers, and not musical events. In scom, it was something like that: note1, note2, note2 + note1... Alain
- 5 replies
- 2.6k views
-
Hi, is there any function in OPMOD implementing self-similar algorithm, like those used by Tom Johnson in his great book "Self-Similar Melodies" ? http://repmus.ircam.fr/_media/mamux/saisons/saison06-2006-2007/johnson-2006-10-14.pdf http://www.algorithmiccomposer.com/2011/06/tom-johnsons-self-similar-melodies.html I'm sure they are hidden in the menus... :-) but where ? Alain
- 2 replies
- 2.1k views
-
Hi everybody, I'm working on different automatic composition projects, involving a lot of random use. Is it possible to "freeze" a complete score, instead of fixing a seed for each "random generator" (rnd-order function) ? I'd like to be in a "push button" situation, listening to a lot of versions and saving only the ones really working. I can do that by saving the score as a pdf and exporting a midifile for each instance, but it would be wonderful to just save the opmo files for further processing. Thanks for your help and suggestions. Alain
- 5 replies
- 2.4k views
-
For generating a harmonic rhythm, I needed to merge notes that are tied. If extracting only the length values with omn directly, then all ties are lost. (omn :length '((h c4 pizz q arco+tie) (q h tie) (h.))) => ((1/2 1/4) (1/4 1/2) (3/4)) So, I wrote myself a function that merges the lengths of tied notes. (lengths-with-merged-ties '((h c4 pizz q arco+tie) (q h tie) (h.))) => (1/2 1/2 5/4) The definition is below. Best, Torsten (defun lengths-with-merged-ties (sequence) "Returns a flat list of lengths that preserves the lengths in sequence including their tied notes. Ex…
- 3 replies
- 2.2k views
-
Here's some few examples of use of the recently updated tonality-system. (complete opmo score attached to this post.) ;; Utility function useful for using ;; bass note of chords/scales as root ;; in tonality-series. (defun get-lowest-chord-tone (chords) (do-verbose ("get-lowest-chord-tone") (integer-to-pitch (mapcar 'find-min (pitch-to-integer chords))) )) #| ;;; USAGE (setf chords '(d4f4a4 ab3d4eb4g4 f4eb3c5)) (get-lowest-chord-tone chords) |# It is better now to see the tonality as kind of PCS (pitch Class Set). If you would express them in pitch, it is easier to work on C base. Something interesting if the fact tonality ca…
-
- 0 replies
- 1.6k views
-
-
Sometimes we generate some flow of pitch and lengths that we assemble later into OMN material, It can be tiedous to add manually the articulations particularly the "leg" omn instruction, and it can sometimes be useful to have a technique for automated implementation of part of these task, who it will be always possible to edit more precisely thereafter. Below a possible technique based on the recognition and association of patterns of lengths values with articulation instructions. At first, we define a stream of lengths for our phrase: (setf len '(1/8 1/8 1/16 1/16 -1/16 1/8 1/8 1/8 1/8)) and we generate with the help of the function …
- 7 replies
- 3.9k views
-
Hi, Here is a short example of OMN deconstruction/reconstruction technique useful when you want to do functions for working directly with omn. ;; Example of function application based on binary-list. (flatten (do-section '(0 1 0) '(chord-interval-add '(4) x) (mclist '(c4 d4 e4)))) ;;; Function example to search for '1/4 length and process the corresponding ;;; pitch for add Major 3rd interval when '1/4 is found. ;;; It is also a good example of deconstruction/reconstruction of OMN ;;; inside a function (defun add-3rd-quarter (omn) (let ((plist (disassemble-omn omn))) (setf (getf plist :pitch) (flatten (d…
- 5 replies
- 2.5k views
-
Below is a function for creating durational accents on the beginning of bars. Many musical styles pay careful attention to how their rhythmic language expresses accents. Certain rhythmic events are perceived as stronger emphasised than others. Such accents do not need to be forced by a performer, e.g., by a dynamic accent. Instead, music theorists identified various musical factors that express accents. Durational accents (expressed by inter-onset intervals) are particularly effective. They are caused by relatively long durations following one or more shorter durations. The function definition is below. Here are two demo calls, showing multiple solutions. …
- 2 replies
- 4k views
- 1 follower
-
Below is a function that might be interesting for others as well. When I starting writing this function it was much more complicated, but it got more simple by and by 🙂 A formatted version as an RTF file of the documentation is attached, below is a plain text version. For completeness I also attached the documentation of the function circle-repeat, used by the function below. Unfortunately, the file names are destroyed by the software of this forum, sorry. Best, Torsten alternate-omns ids omns Arguments and Values ids a list of integers, indicating the position of OMN expressions in omns. omns a li…
-
- 2 replies
- 2.3k views
-
-
Hi, here's a short piece i've made while playing with GEN-DYNAMIC-CONTROLLER function. SB. Dynamics2.opmo Dynamics2gm.opmo
-
- 0 replies
- 1.5k views
-
-
Hi, I want something rather simple, a sort of sieve, how can I achive that? Lets say I have a melody like (q c4 e d4 e e4 q. f4 e g4 q a4 b4) and I want to mute every other note, so the result would be: (q c4 -e e4 -q. e g4 -q b4) or every third note like: (q c4 e d4 -e q. f4 e g4 q a4 -q) and it would be great to have an offset.. thanks! ole
- 8 replies
- 3.3k views
-
Hi, i've made an example of song generator/constructor for one of my Opusmodus student. I share it here if it could be useful to somebody. SB. SongConstructExample.opmo
-
- 0 replies
- 1.7k views
-
-
Hi, I'am looking for a method to pick more and more elements from a list (that are more or less equally distributed): (1/4 -1/4 1/4 -3/8 1/4 -1/4 1/4 -3/8) (1 0 1 0 1 0 1 0 ) 1.pass--> (-1/4 -1/4 -1/4 -3/8 1/4 -1/4 -1/4 -3/8) (0 0 0 0 1 0 0 0 ) 2.pass--> (-1/4 -1/4 1/4 -3/8 -1/4 -1/4 1/4 -3/8) (0 0 1 0 0 0 1 0 ) 3.pass--> (1/4 -1/4 -1/4 -3/8 1/4 -1/4 1/4 -3/8) (1 0 0 0 1 0 1 0 ) 4.--> see orginal list thanks for any hints best ole
- 5 replies
- 2.5k views
-
Hi, here's some example of pitch generation. Naturally, Opusmodus have infinite possibilities and it is just few example of possible way of pitch generation. ;;; SOME (FEW) IDEAS FOR PITCH GENERATION ;;; SB. 09/2016 ;; FROM VECTORS (setf vect1 (gen-white-noise 32 :seed 33)) (setf p1 (vector-to-pitch '(a3 a5) vect1)) ;; SMOOTHED VECTOR (setf vect2 (vector-smooth 0.02 vect1)) (setf p2 (vector-to-pitch '(a3 a5) vect2)) ;; without direct repetition (setf p2b (filter-repeat 1 p2)) ; see also gen-accumulate and other vectors (pink-noise, brownian etc..). ;;; ====================================== ;; RANDOM-CHOICES (setf p3 (rnd-sample '(4 3 7 8 4 5) (list (…
-
- 2 replies
- 2.3k views
-