Jump to content
View in the app

A better way to browse. Learn more.

Opusmodus

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Function Examples

Functions, arguments, values and results

  1. How to use a user defined function, defined in my def-unfold-set "my-mehods" (in-package :Opusmodus), in the counterpoint function? Example (setf test-pattern '(e c4 d4 e4 f4 g4 a4 b4 c5)) (unfold ' my-mehods '(amb-c6b6) test-pattern) ;; works perfectly, shifting up pitches However how do I use this function amb-c6b6 in the counterpoint function? #|1|# ((2 - 6 5) :methods ( amb-c6b6 - (r t-12) t-12)) ;;error, how to unfold amb-c6b6? Thanks for any idea!

  2. Started by eboats,

    Hello, If I have a list like ( (c4) (cs4d4) (f4) (e4fs4) ), I'd like to modify just the chord sublists so that it shows the root and all inversions of the chord. If I do (chord-inversion 1 '((c4) (cs4d4) (f4) (e4fs4)) :series t :root t ) , I get (((c4) c4) ((cs4d4) d4cs5) ((f4) f4) ((e4fs4) fs4e5)) but I'd want the chord-inversion function to ignore the single note sublists ( e.g. (c4) ) since they aren't chords. So, how would I get a result similar to the below? ( (c4) (cs4d4 d4cs5) (f4) (e4fs4 fs4e5) ) Also, is there a way to identify which sublists have a chord versus just a single note? …

  3. Started by david,

    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…

  4. Started by RST,

    Greetings: I present two code fragments: (setf val 256) (setf mat1 (sieve-tree 8 2 5 :rnd-order NIL)) (setf stream (make-omn :length mat1 :pitch '(c4))) (setf out (omn-to-measure stream '(4/4))) This evaluates to: (q c4 mf c4 3h 3q_3q 3h q_3q 3h 3h 3q_7q 7h. 7h. q_3q 3h_3h 3q_3q 3h 7h. 7h. 7q_3q e 3e_5q 5w_7q 7h 7h 7h q_3q 3h_3h 3q_7w 7h._7h. 7w_3q 3h 3h 3q_7q 7h. 7h. 7h. 7h. 7q_e. s. s s s._7w 7h._7h. 7h. 7q_7h 7h 7h 7q_5q 5h. 5q 3e 3e 3q 3q) Here is the OMN stream (stream): When written to the variable "out" using omn-to-measure the result is the following: Here is another code frag…

  5. Greetings all: Is there such a function for removing a bar, or a contiguous number of bars from an OMN sequence? I have been working with "dictum" but I have not been successful in achieving my goal. In this case I have a piece with 24 measures and I would like to remove bars 16 and 17 and rewrite the sequence with these omitted. Thanks for any tips on this. I found this way to do it: (setf piano-omn-d-e (compile-score '((piano :start 1 :end 15) (piano :start 18 :end 24)))) But, I wonder if this is the only, or "best" appro…

  6. Started by eboats,

    What function would I use if I have a list of ascending pitches and I want to generate a sequence that would gradually work its way up from lowest to highest pitch ( or vice versa), with some control over volatility and how quickly the seq goes from low to highest? So far I've found the brownian motion sample function with a "drift" arg for doing something like this. Are there other functions for doing this kind of thing? What I have in mind is something like the first 13 bars of Varese's Density 21.5, where there's a gradual upward trajectory in pitch, culminating in bar 13. https://petruccilibrary.ca/files/imglnks/caimg/c/c0/IMSLP405195-PMLP…

  7. I have been studying and working with Stephane's very helpful TRIO project at the website. If you do not know it, I highly recommend it. There are some very useful methods in his discussion. The first material above is the rhythm of a test of counterpoint :sequence as INPUT to the function. It is (3w = = ) (q q q q) The OUTPUT, the second line, changes the notation. My general question is, why is there this change? My observations suggest that with more complex rhythmic material (9:8 for example) the resulting output can become a little less assured in the translation from input OMN lengths to the notated output from the c…

  8. Started by eboats,

    Hello, I have a generated seq of pitches and would like to remove repeated pitches and also prevent a seq like b5 f5 b5 ( where the pitch following f5 returns to the pitch before f5 in this case ). I'm not sure if filter-repeat is what I need or some other function? If I do (filter-repeat 1 '(b5 b5 f5 b5 f5 a5 gs5 a5 fs5 bb5)) , the result is (b5 f5 b5 f5 a5 gs5 a5 fs5 bb5) but what I want is (b5 f5 a5 gs5 fs5 bb5) There is a :seq arg but haven't had luck with that ( and don't understand what it does).

  9. Hello, I am Tamas and kind of new in Opusmodus, but learning pretty quickly. It is probably in easy case but I'm stuck at the moment: I ha a rising c major scale, and then I always want to swap only 2 pitches at a time from the scale. At the next evaluation I want to repeat the same process but already with the previously processed new scale. Is there any way to automate this process because I only came up with this idea which is I am sure the most beginner solution 🙂 (setf scale '(c3 d3 e3 f3 g3 a3 b3)) (setf first (position-swap (rnd-sample 2 '(0 1 2 3 4 5 6) :norep t) scale)) (setf second (position-swap (rnd-sample 2 '(0 1 2 3 4 5 6) :norep t) …

  10. Started by eboats,

    Hello, I'd like to create a palindrome where I start with ((s -) (e -) (3e = = -e)) and have the output be ((s -) (e -) (3e = = -e) (e -) (s -)) . But the gen-palindrome function doesn't quite do this. Is there a general lisp way of doing this?

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

  12. Started by eboats,

    How do I generate all rhythm permutations for a bar given a time signature and a list of Omn lengths and number of notes per bar? Am thinking similar to args and output for the rhythm-series function but for all permutations?

  13. Started by eboats,

    I'd like to convert a .wav of birdsong into OMN or Midi if possible and wondering if there's anything in Opusmodus that could help with that? I was looking at the OpusModus "Speaking Piano" example on Youtube and have been experimenting with using the SPEAR library in combination with OM spectral function and my birdsong audio, in a similar way as the "Speaking Piano". But I think I'm more interested in a tool that could transcribe birdsong to a monophonic Flute line in OMN or Midi for example ( rather than dense sequences of chords ).

  14. Hi, It's likely I'm not fully understanding the integer-to-pitch function in this case, so any help is much appreciated. I have an arbitrary integer sequence with no repeated elements: (setf test-seq '(13 80 61 81 74 72 46 64 31 47 77 22 19 69 7 2 26 71 33 73 59 55 3 39 62 5 65 44 38 49 14 4 52 53 66 57 29 21 6 78 35 10 41 88 76 9 28 8 15 17 43 25 58 42 12 67 70 20 82 87 63 18 56 16 30 34 86 50 27 84 24 45 51 40 75 85 37 36 23 32 60 68 83 11 54 79 48 1)) ; all the notes on the piano ; I can see that the elements are unique: (equalp (length test-seq) (length (remove-duplicates test-seq))) t ; Here's what I'm failing to unders…

  15. Started by eboats,

    I'd like to get a random sequence of a set of pitches but want to exclude certain intervals like 7 and 4 from appearing in the resulting sequence. I don't see an interval exclude property for rnd-sample. What would be a way to do this? (setf seq (rnd-sample 16 '(c4 d4 f4 fs4 g4 a4 b4 ds5) :norep t))

  16. Started by JulioHerrlein,

    Dear All, just a little help, please ! Here´s a list of scales... ((fs4 gs4 a4 b4 cs5 eb5 e5) (db5 eb5 f5 g5 ab5 bb5 c6) (cs5 eb5 e5 fs5 gs5 bb5 b5) (bb4 c5 d5 e5 f5 g5 a5) (d4 e4 f4 g4 a4 b4 c5) (gb4 ab4 bb4 c5 db5 eb5 f5) (g4 a4 b4 cs5 d5 e5 fs5) (f4 g4 a4 b4 c5 d5 e5) (c5 d5 e5 fs5 g5 a5 b5) (cb5 db5 eb5 f5 gb5 ab5 bb5) (g4 a4 b4 cs5 d5 e5 fs5) (f4 g4 a4 b4 c5 d5 e5) (a4 b4 c5 d5 e5 fs5 g5) (c5 d5 e5 fs5 g5 a5 b5) (cs5 eb5 e5 fs5 gs5 bb5 b5) (e4 fs4 g4 a4 b4 cs5 d5) (gb4 ab4 bb4 c5 db5 eb5 f5) (db5 eb5 f5 g5 ab5 bb5 c6) (bb4 c5 d5 e5 f5 g5 a5) (eb4 f4 fs4 gs4 bb4 c5 cs5) (c5 d5 e5 fs5 g5 a5 b5) (a4 b4 c5 d5 e5 fs5 g5) (db5 eb5 f5 g5 …

  17. Started by david,

    Hi, in my example I only use one mode is it possible to use multiple modes, exemple Dorian II, mixolydian-v and Ionian I ?? (setf patterns (pitch-transpose 6 (make-omn :pitch (rnd-order (expand-chord-name (library 'modes 'mixolydian-v nil :random 1) :type :pitch)) :length (gen-repeat 1 ry12) )))

  18. Started by JulioHerrlein,

    Dear All, I don´t know what happens in Mac, but in Windows, sometimes the code color highligth is changing. I have to press enter to get the code colors again... Maybe a bug ?

  19. Started by born,

    Lets say I have 2 measures of music. I want to make random variations of the rhythms (not the pitches) The result should fit in the initial 2 measures. What is the function called for this. I cannot remember ... Thanks for help, Achim

  20. Started by marqrdt,

    OMers, I wrote this function and use it in my composition work. Please feel free to steal use it. It returns the "polarity" of a sequence, defined as the ratio of consecutive uneven and even interval classes (IC) in a sequence. I use this as a way of testing if a generated sequence contains a balanced mix of even or uneven ICs. (defun polarity (in-seq) (when (equal (length in-seq) 0) return 0 ) (let((accum 0) (int-pairs (interval-class in-seq))) (mapcar (lambda (x) (when (evenp x) (incf accum) )) int-pairs) (/ (* accum 1.0) (- (length in-seq) 1)) ) ) Some examples: ;; The polarity of a chromatic scale…

  21. Dear All, One interesting conversion would be the one for transforming the get-time-signature result to length-span time signature format. This would be useful to rephrase rhythmically one rhythm with another´s rhythm time-signature structure. For example: ; Take this rhythm (setf ritmos (gen-repeat 4 (gen-length '((1 2 1 2 1 1) (1 1 1 1 1 2 1) (1 -3 1 -3 2 -2 4) (-3 1 -1 1 1 1)) '(16)))) Here is the bar structure for this (get-time-signature ritmos) This is the output ((2 4 2) (4 4 1) (2 4 3) (4 4 1) (2 4 3) (4 4 1) (2 4 3) (4 4 1) (2 4 1)) If I want to use this result …

  22. I am trying to get a random series of lengths from the list (4/14 5/14 6/14) to span over a certain time, in this case 4 bars. (length-span '4 (rnd-sample 40 '(4/14 5/14 6/14))) The result keeps including tied sixteenth notes, although I want to limit the score and rhythm to two eighth septuplets per bar (with ties). I also tried to include quantize as a second grid which didn't help to "clean" the result. Am I making a mistake here or is this some kind of bug?

  23. Started by Stephane Boussuge,

    I've shared a video here on CHORD-DICTUM function and you will find here the code from the video. Enjoy ! The Score: ;;;-------------------------------------------------------- ;;; SCORE 186 ;;; VARIATIONS POUR PIANO ;;; Etude de la fonction "chord-dictum" ;;; S.BOUSSUGE ;;; WIEN - 27.01.2024 ;;;-------------------------------------------------------- ;;; LEARN OPUSMODUS: WWW.COMPOSERWORKSHOP.COM ;;;-------------------------------------------------------- ;;; To view the score press the Cmd-Option-1 keys. ;;;-------------------------------------------------------- ;;; UTILITY ;;; REA-MARK (defun rea-mark (omn-exp) "Add rehearsal marks…

  24. Started by strumm,

    In this simple example from the documentation. The first chord is divided into 5, but why are the pitches for the 2nd through 5th chord division seemingly random? The dictum states a rule for dividing the chord rhythmically, but has no rules for altering pitches? (setf mat1 '((h a2b2e3f3gs3 mf) (h a2b2e3f3gs3 p) (q bb4c5gs5a5b5 mp q bb4c5gs5a5b5 p))) (chord-dictum '((:len h :chd 5 :div 5) (:len q :chd 5 :div 4)) mat1)

  25. Started by rcadiz,

    Hi everyone, I am having a hard time trying to add appoggiaturas to selected length values on an omn sequence. Let's say I want to search for all whole durations and add an appoggiatura before this event. I have been trying these kind of solutions using dictum (setf mat '(w c4 stacc)) (dictum '( (:and w :apply (app e f4)) ) mat) (dictum '( (:and w :apply '(app e f4)) ) mat) (dictum '( (:and w :apply ((app e f4) w)) ) mat) (dictum '( (:and w :apply (app e f4 w)) ) mat) All of these fail. I get some error saying the sequenced-event :type nil :phrase (nil nil) is not of type ?event when ac…


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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.