Jump to content

Function Examples

Functions, arguments, values and results

  1. 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 …

  2. 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
    • 2k views
  3. Started by torstenanders,

    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. …

  4. Started by torstenanders,

    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…

  5. Hi, here's a short piece i've made while playing with GEN-DYNAMIC-CONTROLLER function. SB. Dynamics2.opmo Dynamics2gm.opmo

  6. Started by o_e,

    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
    • 2.6k views
  7. 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

  8. Started by o_e,

    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
    • 2k views
  9. 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
    • 1.8k views
  10. 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…

  11. 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…

  12. 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.4k views
  13. 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

  14. Started by torstenanders,

    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.4k views
  15. 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 '?)) …

  16. 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 …

  17. Started by Rangarajan,

    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

  18. Started by ecole,

    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

  19. 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
    • 2.5k views
  20. Started by o_e,

    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

  21. 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.4k views

Copyright © 2014-2025 Opusmodus™ Ltd. All rights reserved.
Product features, specifications, system requirements and availability are subject to change without notice.
Opusmodus, the Opusmodus logo, and other Opusmodus trademarks are either registered trademarks or trademarks of Opusmodus Ltd.
All other trademarks contained herein are the property of their respective owners.

Powered by Invision Community

Important Information

Terms of Use Privacy Policy