Function Examples
Functions, arguments, values and results
312 topics in this forum
-
Hi, Is there an OpusModus function (I'll bet there is) that can create lists (chords, etc) created from items selected from lists of varying lengths? Something like this: Source lists (3 lists): ( '(c4 d4 e4) '(f4 g4 a4 b4) '(cs4 ds4 fs4 gs4 as4) ) Output, successive items from each list: (list '(c4 f4 cs4) '(d4 g4 ds4) '(e4 a4 fs4) '(c4 b4 gs4) '(d4 f4 as4) '(e4 g4 cs4) ...) I'm having a great time learning LISP and OM (I come from Python/Java background mostly). I looked through the gen- functions, but nothing seemed to match. I was going to try to write a LISP function, but I figure there was already something in OM, as it seems geared towards these…
- 3 replies
- 2.4k views
-
Dear all, Is it possible to split a given list of lengths (or omn) into sublists (bars) according to a given sequence of time signatures? That would be very useful for all sorts of operations. e.g., imposing a meter on unmetered music generated by whatever algorithm; metric shift where some note or rest is added at the beginning of a rhythm, but the metric structure is kept the same and all notes/rests move "to the right" as necessary etc. Here is an example of what such a function could do. ;; the hypothetic function gen-bar expects a list of time signature forms (or bar durations as ratios) and a (flat) list of lengths or OMN. It re…
-
- 3 replies
- 1.9k views
-
-
Dear all, The rough outline of a melody can be described by a melodic contour, which sets the rough curve formed by the pitches of a melody without fixing the detail of all melodic intervals and pitches. Opusmodus allows controlling the melodic contour, e.g., with the function axis-plot in its Schillinger Inference function set. However, the documentation is a bit confusing as it seems to suggest that such functionality is offered only by its sibling axis-sub-plot. The function axis-sub-plot is documented to add more complexity to the result by dynamically displacing the underlying axis. However, that seems to be the case only for the second elemen…
-
- 1 reply
- 1.6k views
-
-
Hello! I'm very interested in the Euclidean Generator but not sure how to use it. I see a video mentioned by Stephane here: http://composersforum.ning.com/forum/topics/new-video-tutorial-epic-euclidean-percussion-generator-with But I could not find it in the link: http://algorithmicmusiccomposer.blogspot.fr/ Is this video still available? I would love to see it. Thanks! Tom
- 2 replies
- 2.1k views
-
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
- 8.7k views
-
Hi, here's a simple example of my use of BINARY-RHYTHM function inspired by the Janusz's doc examples for generating a full movement of a chamber symphonie. The BINARY-RHYTHM function use FIBONACCI stuff and variant optional keyword: (init-seed 839201883) (setf fib1 (fibonacci 4 64)) (setf fib2 (fibonacci 21 81)) (setf fib3 (fibonacci 14 74)) (setf fib4 (fibonacci 32 92)) (setf fib5 (fibonacci 1 61)) (setf rhstruct (rnd-sample 8 '(4 8 16 32 64))) (setf bval '(h h q q e e s s s e s e q e h q h h)) (setf len1 (binary-rhythm rhstruct fib1 bval :type 2 :variant '?)) …
-
- 0 replies
- 1.8k views
-
-
Hi Stephane Based on your example i tried to apply a transposition list based on your functions but with an exotic scale Ex ;; degree selection (setf degr '(1 4 2 5 1 6 4 2 5)) ;; remove 1 from each degree for use as transposition ;; inside tonality for diatonic transposition (setf trsp (mapcar (lambda(x) (- x 1)) degr)) ;;; some material (setf arps1 (gen-repeat (length degr) '((s c4 e4 g4 c5 e5 g5 c6 g5 e5 c5 g4 e4)))) ;; apply diatonic transposition (inside tonality) (setf arps.map (tonality-map '(hyojo :root c4) (pitch-transpose …
- 3 replies
- 2.1k views
-
Hi, I am looking for some functions that support chord progressions. For example, I would like to get the chords in the popular "I-IV-V" sequence in C Major scale. Is there built-in support for such standard progressions in the keys of common scales? Regards, Rangarajan
- 7 replies
- 4.8k views
-
Hello! Is there a way to do a simple conversion from integer (representing scale degree) to pitch (via a Tonality)? map-to-tonality assumes that the integer input is a chromatic pitch class. Thank you! Elliot
- 4 replies
- 2.7k views
-
Here is a function that converts hertz to midi: (defun hertz-to-midi (frequency) "Gets the corresponding MIDI value from a Hertz frequency" (round ;; https://en.wikipedia.org/wiki/MIDI_Tuning_Standard#Frequency_values ;; d = 69 + 12*log2(f/440Hz) (+ 69 (* 12 (log (/ frequency 440) 2))))) This allows two more useful functions to be made: (defun hertz-to-integer (frequency) "Gets the corresponding pitch integer value from a Hertz frequency" (let ((*standard-output* (make-broadcast-stream))) ; Override function prints (midi-to-integer (hertz-to-midi frequency)))) (defun hertz-to-pitch (frequency) …
-
- 3 replies
- 3k views
-
-
Hi, I want an effect like when bells ringing or two mechanical metronomes are started together- the are together (rhythmical unison) than getting out of phase than coming together again.. There are many pieces who make use of such a technique: Ligetis Piece for 100 Metronomes, Phase Music by Steve Reich, many Conlon Nancarrow Pieces.. How can these little ongoing displacements be programmed in OM? thanks, ole
-
- 4 replies
- 2.7k views
-
-
PITCH-ROTATE (flatten-sublist (gen-loop 12 (pitch-rotate (rnd-sample 12 (gen-integer -6 6)) '((d4fs4a4 a4e5c5a4))) :seed 245)) => ((d3fs3a3 e4c4a3a4) (d5fs5a5 a4a5e6c6) (e4c4a3a4 fs3a3d4) (a3d4fs4 a3a4e5c5) (e4c4a3a4 fs3a3d4) (e4c4a3a4 fs3a3d4) (d5fs5a5 a4a5e6c6) (c5a4a5e6 d5fs5a5) (d3fs3a3 e4c4a3a4) (a4e5c5a4 fs4a4d5) (a3a4e5c5 d4fs4a4) (e4c4a3a4 fs3a3d4)) GEN-CHORD2 (gen-chord2 12 '(4 3) '(c4 cs4 e4 eb4 b4 fs4 gs4 a4 bb4 d4 f4 g4) :offset '(2 3 -2) …
-
- 0 replies
- 2.6k views
-