Jump to content

Function Examples

Functions, arguments, values and results

  1. Started by JulioHerrlein,

    Dear All, Is there a function where you can specify the creation parameters of the melodic patterns devised by Slonimsky on the Thesaurus ? Is there a function where you can specify: 1) The division of the octave (Tritone, Ditone, Sesquitone) ? 2) The pattern way (Infra, ultra, interpolation, and their combinations) ? Thanks for the help ! Best, Julio

  2. Started by JulioHerrlein,

    Dear Friends, This is the example in the docs for the distribute-stream function. (setf sym '(c4 cs4 d4 eb4 e4 f4 fs4 g4 gs4 a4 bb4 c5 cs5 d5 eb5 e5)) (setf v1 '(1/8 1/8 -1/8 2/8 -1/8 5/8)) (setf v2 '(1/8 1/8 1/8 -1/8 2/8 1/8)) (setf va '(-2/8 1/8 1/8 -5/8 1/8)) (setf vc '(-1/8 3/8 3/8 1/8 1/8)) (setf inst (distribute-stream sym (list v1 v2 va vc))) (setf in1 (make-omn :length v1 :pitch (1~ inst))) (setf in2 (make-omn :length v2 :pitch (2~ inst))) (setf in3 (make-omn :length va :pitch (3~ inst))) (setf in4 (make-omn :length vc :pitch (4~ inst))) (list in1 in2 in3 in4) The result shows that the chromatic pitch sequence is distributed in …

  3. Started by vpolajnar,

    Dear Opusmodus masters! I Have a chord: And I was wondering if i could arpeggiate this chord depending on subdivisions? For example (e s 3q): Or for example (e s 3q 5q): I don't know if Opusmodus is build for this kind of stuff, but i always have to calculate if 2nd note of quintuplet comes before or earlier of 2nd note of triplet. For any response I'd be very thankful! Best wishes, Vili

  4. Started by JulioHerrlein,

    Dear Friends, I´m searching for a function to make rhythmic displacement of lists and sublists at once. It´s not like rotating, it´s more like displacing all the rhythms by a fixed amount, like transforming this: (-e he. d4 mf e cs4 hs eb4) into this (he. d4 mf e cs4 hs eb4 -e) This means displace all the phrase one 8th note earlier in time. Thank you all ! Best ! Julio

  5. Started by o_e,

    Is it possible to remove rest(s) with dictum? Thanks! Edit: Why this does not work? (dictum '(:apply (length-rest-remove x)) '(w c5 ped -e))

  6. Started by born,

    Hi, attached is a function I wrote for a piece. Does anybody have an idea how to extend this with a seed functionality. I have tried a few things but so far without any real success ... The other thing: It can take quite a while until a possible solution ist found. Does anybody have an idea to improve the calculation speed? Thanks and best, Achim fill-space.opmo

  7. Dear friends, There is a function to make the 12-tone matrix (twelve-tone-matrix '(3 11 10 2 1 0 6 4 7 5 9 8)) I 0 8 7 11 10 9 3 1 4 2 6 5 0 3 11 10 2 1 0 6 4 7 5 9 8 4 7 3 2 6 5 4 10 8 11 9 1 0 5 8 4 3 7 6 5 11 9 0 10 2 1 1 4 0 11 3 2 1 7 5 8 6 10 9 2 5 1 0 4 3 2 8 6 9 7 11 10 P 3 6 2 1 5 4 3 9 7 10 8 0 11 R 9 0 8 7 11 10 9 3 1 4 2 6 5 11 2 10 9 1 0 11 5 3 6 4 8 7 8 11 7 6 10 9 8 2 0 3 1 5 4 10 1 9 8 0 11 10 4 2 5 3 7 6 6 …

  8. Is there a way to remove or replace intervals from a melody? I am looking for a function like chord-interval-replace but for a melody instead of chords.

  9. Dear Friends In my Doctoral Dissertation, I converted every FORTE number in a modulo 12 Rhythm via time-point-system. There is a complete catalog included (see the link below). It's in portuguese. After Janusz adjusted the Forte numbers to have the inversion, using "a" and "b" to differentiate the prime forms from the inversions, it was easy to convert using codes like this: (setf ch0 (time-point-system (pcs '5-11b :pitch)'s :start 0)) (setf ch1 (time-point-system (pcs '6-33 :pitch)'s :start 1)) (setf ch2 (time-point-system (pcs '7-11b :pitch)'s :start 2)) (setf ch3 (time-point-system (pcs '3-11b :pitch)'s :start 3)) (setf ch4 (time-…

  10. Started by o_e,

    Hi, (setf test '((q a4 mf e a4 p e gs4 f e4 mp g4 p) (q a4 e e gs4 e4 d4))) (setf one '(1 3)) (dictum '(:remove :event :bar 1 :event one) test) This gives an error, is there a way to use variables for keywords? Thanks and Happy Easter everybody 🙂 Edit: Just checked another function (randomly choosen). Here a variable for a keyword works fine. My guess is that it has to do with the quotation mark inside the dictum, is there a way around this? (setf test-2 '((q a4 mf e a4 p e gs4 f e4 mp g4 p) (q a4 e e gs4 e4 d4) (e e4 g4 e4 g4 q a4))) (setf sec '(0 2)) (pitch-transpose '(…

  11. Started by o_e,

    Hi, (setf test-flatten (flatten '((q a4 -e gs4 e4 -) (q a4 e - e4 d4) (-e g4 e4 - q a4) (-h.) (-q e a4 gs4 - g4)))) (setf por (length-rest-position test-flatten)) ==>(1 4 7 10 13 15 16 19) (setf sr (position-filter por test-flatten)) ==>(-e - - -) ;should be this: ; (-e - - - - -h. -q -e) ;or do I miss something? Thanks for assistance!

  12. Started by JulioHerrlein,

    Dear All, Is there a function to align generated materials to fit in a same space, for example aligning / spanning / trimming 3 voices to fit in a space of, 4 3/4 measures. I know that there are some/many functions related to it, but there are some specific trim-to-time-signature function ? Best, Julio

  13. I want to trim every full-duration measure so that it always first starts with a quarter note and fills the rest of the measure with corresponding rests. For example, is it's possible to consider an omn sequence like the one below and trim the durations so that every (firtst) note in a measure is a quarter note followed by a quarter note rest (in 1/4) or a quarter note followed by an eight-note rest (in 3/8)? Thank you! ((e. e3) (e. e3) (q g3) (e. d3) (q a3))

  14. Does anyone know if there's a function that outputs a number of beats from every measure in an omn sequence, given the denominator? For example with the eighth-note denominator, ((-e a3f4d5 q f4d5a5) (q a3e4c5 q e4c5a5) (-e a3g4e5 h g4e5a5)) would output (3, 4, 5). Thank you!

  15. Started by born,

    Does anybody know how to merge lengths with same pitches? (e c4 c4 e. c4 q c4 s c4 e eb4 e. eb4 h eb4 e. eb4 q eb4) => (h. c4 wq eb4) Thanks for help, Achim

  16. Started by o_e,

    Hi, Does dechord only work for triads (as described in the docs)? (dechord '(h c4e4g4b4 d4f4a4c4)) ;default :pitch 'root =>(h b4 a4) thanks!

    • 0 replies
    • 460 views
  17. Is something like this implemented in OM or has anybody written a function for it? Input: N = 3 Output: 1 1 1 1 2 3 Input: N = 5 Output: 1 1 1 1 1 1 1 1 2 1 1 3 1 2 2 1 4 2 3 5 see: https://www.geeksforgeeks.org/find-all-combinations-that-adds-upto-given-number-2/ Best, Achim

  18. Started by NagyMusic,

    I'm trying to figure out how to span (attach) slurs individually to each measure in a pitch sequence. When I use :articulation key in make-omn, a single slur is spanned from the beginning until the end of the sequence. Here's a short code excerpt in case someone has a suggestion. Perhaps I need to apply vector-map to :articulation? (make-omn :length '(e) :pitch (vector-map (pitch-melodize chords) vector-chords) :velocity '(p) :articulation '(leg) :span :pitch) Thank you!

  19. Started by NagyMusic,

    I wondered if someone would be willing to help me with a snippet of code. I'm trying to generate a series of 100 sublist 2 digit-pairs. The first of those digit-pairs randomly (or according to a predefined vector) alternates between 1 and 2 only: '((1 #) (2 #) (2 #) (1 #) (2 #) (1 #) (1 #) etc). The second of those digit-pairs unfolds numbers from 1 to 100 between every consecutive sub-list pair: '((# 1) (# 2) (# 3) (# 4) (# 5) etc). The result would be something like this: '((1 1) (2 2) (2 3) (1 4) (2 5) (1 6) (1 7) ... (2 100)) Thank you!

  20. Started by NagyMusic,

    I'm working on a piano piece that features two streams of different material in each hand. I want to swap selected measures (in my case, same measures) from right to left hand (e.g., 2nd m in r.h. with 2nd m in l.h., 5th m in r.h with 5th in l.h., etc; or at random, of course). I wondered if there's a function that would accomplish that? Thank you! Zvony

  21. Started by AM,

    dear all here is a setup for playing midi-files/scores in polytempi / follow the instructions and have fun! just ask if you have some questions... greetings andré - personally i will use it for exact sample/e-player perfomance with my pieces which are working with "Technology-Assisted Conducting" http://polytempo.zhdk.ch ... in future i will do it all directly from OPMO or lisp - "live score generating" + polytempo-conducting + e-player) - i have already done this with my piece MODULAR FORM but not all controlled by LISP/OPMO, so next step is doing it all in OPMO/LISP greetings andré https://en.wikipedia.org/wiki/Polytempo/ ;;; POLYTEMPO-PLAY ;;; with a MAX-patc…

  22. Started by AM,

    for my current project i have to CONVERT/MAP pitches/lengths/velocity or MIDI into a binary sequence. so i coded this simple FUNCTION... feel free to use/adapt.... greetings andré (defun fill-to-x-bit (listseq &key (bitlength 7)) (loop for i in listseq when (< (length i) bitlength) collect (append (gen-repeat (- bitlength (length i)) 0) i) else collect i)) ;;;; CONVERT PITCH/LENGTH or VELOCITY TO BINARY INFORMATION (defun convert-to-binary (alist &key (parameter 'pitch) (length-resolution 127) (velocity-resolution 127) (pitch-resolution 127) (event nil) (bitlength 7)) (let ((pitch) (length) (velocity) …

  23. Started by AM,

    here some functions (that i'm using currently). perhaps anyone/OPMO would include/optimze them.. take the ideas... greetings andré 1) rnd-order/sort-omn => picks omn-seqs/bars in rnd-order and sorting it (a mix-up and sort-process for OMN) (defun rnd-order/sort-omn (omnlist &key (type nil) (sort 'a) (step nil)) (let* ((int-seq (gen-integer 0 (1-(length omnlist)))) (sorted-int (gen-sort (rnd-order int-seq) :type type :sort sort :step step))) (loop for i in (flatten sorted-int) collect (nth i omnlist)))) (rnd-order/sort-omn '((w c4 mf) (h d4 ppp ten e4 ten) (q g4 leg a4 leg b4 leg) (e c5 d5 e5 f5 g5))) => ((…

    • 1 reply
    • 699 views
  24. Started by mmitch,

    Hello - first time posting here. I realize this may be trivial but I am having a tough time figuring this out. How does one make a tie between two notes when one of the notes is part of a chord and one is not? I've searched the forum with no luck and also looked at filter-tie, which doesn't seem to do the trick.. here's an example (from an old score I made in Sibelius): I did manage to successfully use "merge-voices" to realize the above, just can't get that low Gb to show up. Thanks in advance for any help! best, -Matt

  25. Started by NagyMusic,

    I'm trying to combine a series of counterpoint dictums into a single dictum list. I tried several things, but can't seem to get it work. Is there a function similar to assemble-seq that could be applied here? Thank you! (setf dictum-1a '(((1 2 3) :methods ( (r ft) (t-12 ft) (dl1 t-12 pr1 ten)))) ) (setf dictum-1b '(((1 2 3) :methods ( (r ft) (t-12 ft) (dl1 t-12 pr2 ten)))) ) (setf dictum-1b '(((1 2 3) :methods ( …


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