Jump to content

Function Examples

Functions, arguments, values and results

  1. There are 10 functions that have a key parameter :assoc. None of the documentation is particularly clear on what it is or what it does. Most of the functions just list that it is an integer and that it defaults to 12. The only other description that is sometimes added is "row size," but that description is also attached to the :mod key parameter for a number of the functions. I ran the following code to generate a report of how :assoc impacts the row-variants function when run on ordered intervals under various levels of transposition: (pprint-expression (loop for x from 1 upto 11 collect (list (concatenate 'string "Set: (0 " (write-…

  2. Started by david,

    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 …

  3. Hello, I have a lisp function called convert-chord-symbols-to-notes which works but is outputting backslashes. The function for D#/Eb is as follows (defun convert-chord-symbol-to-notes (chord-symbol) (cond ;; D# / Eb chords ((or (equal chord-symbol 'd#sus2) (equal chord-symbol 'ebsus2)) '(d#4 f4 a#4)) ((or (equal chord-symbol 'd#maj) (equal chord-symbol 'ebmaj)) '(d#4 g4 a#4)) ((or (equal chord-symbol 'd#m) (equal chord-symbol 'ebm)) '(d#4 f#4 a#4)) ((or (equal chord-symbol 'd#7) (equal chord-symbol 'eb7)) '(d#4 g4 a#4 c#5)) ((or (equal chord-symbol 'd#m7) (equal chord-symbol 'ebm7)) '(d#4 f#4 a#4 c#5)) ((or (equal ch…

  4. Started by david,

    Hi, is there the opposite of butlast ?

  5. Started by acrawnsley,

    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…

  6. Started by david,

    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…

  7. Started by RST,

    Greetings all, I am wondering if anyone has worked on the problem of rubato for playback performance.

    • 0 replies
    • 171 views
  8. 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!

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

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

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

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

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

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

  15. 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).

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

  17. 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?

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

  19. 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?

  20. 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 ).

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

  22. 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))

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

  24. 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) )))

  25. 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 ?


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