Jump to content

loopyc

Members
  • Content count

    33
  • Joined

  • Last visited

  • Days Won

    3

Reputation Activity

  1. Thanks
    loopyc got a reaction from AM in vector-to-length (with pitch-figurate) - audition tape   
    Not much, but happy to share.
     
    Somedays, I just set up a live audio host and some interesting instruments and samples, and then 'browse' the Opusmodus documentation. In these sessions, I am combining a playful way to add to my knowledge while generating audio materials via audition and MIDI Export for my library to be used as later combinatory/compound materials. As the title suggests, these are just live experimentations with 'vector-to-length',  along with variations on a theme to the value of 'vector-smooth' (from min to max value over session period).
     
     
    ;; (setf vector (gen-white-noise 10000)) (setf v2l-1 (vector-to-length '1/128 -3 13 vector)) (setf v2l-s-1 (vector-to-length '1/128 -3 13 (vector-smooth 0.1 vector))) (setf chromatic-12 '(c2 cs2 d2 ds2 e2 f2 fs2 g2 gs2 a2 as2 b2)) (setf chromatic-16 '(c2 cs2 d2 ds2 e2 f2 fs2 g2 gs2 a2 as2 b2 c3 cs3 d3 ds3)) ;;----------------------------- (setf voice-1 (make-omn :length (length-weight v2l-s-1 :weight '(34 1)) :pitch (span v2l-s-1 chromatic-16) :velocity (messiaen-permutation '(ff f mf mp p)))) ;;-----------------------------  
    ...and with pitch-figurate and additional permutation:
     
    (setf voice-1 (make-omn :length (length-weight v2l-s-1 :weight '(67 1)) :pitch (span v2l-s-1 (pitch-figurate 6 chromatic-12 :interval (messiaen-permutation '(1 -1 2 -2 3 -3 4 -4 5 -5)))) :velocity (messiaen-permutation (messiaen-permutation '(ff f mf mp p)))))  
     The pitch list is for the sequential triggering 'sample slices' via New Sonic Arts 'Vice',  each slice corresponding to a specific pitch (thus the pitch-figurate serves to add controllable variation of slice triggering). The exercise is focused on rhythm, but in the context of untraditional/non-percussion materials ;-) hth
     
     
    ...
  2. Like
    loopyc got a reaction from Stephane Boussuge in vector-to-length (with pitch-figurate) - audition tape   
    Wow, thank you...that means a lot coming from you :)
     
    Even at my extremely novice level with Opusmodus, the possibilities of what I can accomplish towards my own goals (experimental electronics) are seemingly endless :)
     
    The combination of the online documentation and the continuing insights/inspiration derived from this forum and it's generous and talented contributors....is making this first leg of my learning Opusmodus an extremely exciting and rewarding period of education...and as I am able generate and collect these audio materials into a personal library, no doubt Opusmodus will allow me to develop unique approaches to electronic musiking which is my primary driving force ;-)
     
     
     
     
  3. Like
    loopyc got a reaction from Stephane Boussuge in vector-to-length (with pitch-figurate) - audition tape   
    Wow, thank you...that means a lot coming from you :)
     
    Even at my extremely novice level with Opusmodus, the possibilities of what I can accomplish towards my own goals (experimental electronics) are seemingly endless :)
     
    The combination of the online documentation and the continuing insights/inspiration derived from this forum and it's generous and talented contributors....is making this first leg of my learning Opusmodus an extremely exciting and rewarding period of education...and as I am able generate and collect these audio materials into a personal library, no doubt Opusmodus will allow me to develop unique approaches to electronic musiking which is my primary driving force ;-)
     
     
     
     
  4. Thanks
    loopyc got a reaction from opmo in Euclidean Rotations ('My Opus In The Modus Of Ghosts")   
    ;;; SET Variables (setf pitch-1 '(c2 cs2 d2 ds2 e2 f2 fs2 g2 gs2 a2 as2 b2 c3 cs3 d3 ds3 e3 f3 fs3 g3 gs3 a3 as3 b3)) (setf pitch-2 '(c2 cs2 d2 ds2 e2 f2 fs2 g2 gs2 a2 as2 b2 c3 cs3 d3 ds3 e3 f3 fs3 g3 gs3 a3 as3 b3 c4)) (setf reverse-p (nreverse pitch-2)) (setf rotation-p-1 (gen-rotate :left pitch-1 :type :seq)) (setf rotation-p-2 (gen-rotate :right reverse-p :type :seq)) (setf rotation-p-3 (gen-rotate :right pitch-1 :type :seq)) (setf rotation-p-4 (gen-rotate :left reverse-p :type :seq)) (setf rotation-combo-A (gen-repeat 17 (append rotation-p-1 rotation-p-3))) (setf rotation-combo-B (gen-repeat 16 (append rotation-p-2 rotation-p-4))) (setf bin-map-1 (binary-map (gen-binary-euclidean 1 8 5 7) 's)) (setf bin-map-2 (binary-map (gen-binary-euclidean 1 8 5 8) 's)) ;;----------------- (setf drum-rotation-1 (make-omn :pitch rotation-combo-A :length (span rotation-combo-A bin-map-1) :velocity '(ff mp = = = = = =))) (setf drum-rotation-2 (make-omn :pitch rotation-combo-B :length (span rotation-combo-B bin-map-2) :velocity '(ff mp = = = = = =))) ;;; SET Voices (setf Voice1 drum-rotation-1) (setf Voice2 drum-rotation-2) ;;;-------------------------- (def-score Euclidean-Rotations ( :key-signature 'chromatic :time-signature '(4 4) :composer "Loopy C" :copyright "Copyleft © 2017 Chris R Gibson" :tempo 106 :flexible-clef t :ignore-velocity t ) (inst1 :omn Voice1 :port 0 :channel 1 :sound 'Logic :program '1 :volume 90) (inst2 :omn Voice2 :port 0 :channel 2 :sound 'Logic :program '1 :volume 90) )  
    Really, REALLY basic code...but indulges my interests in shifting rhythm patterns.
     
    Pitch-lists are designed for the triggering of Spectrasonics 'Stylus RMX', the mixes then taking three stereo pairs and applying separate fx processing for final bounce in Logic 9.1.8.
     
    As I said, pure indulgence of a personal compulsion...shared here simply as example of the variety of Opusmodus application as applied to beat creation.
     
     
    ...
  5. Thanks
    loopyc reacted to AM in filter-omn-by-intervals   
    a sieve/filter-function - filters specific INTERVALS and replacing the others by rests.
    (don't work perfect, but as a sketch....)
     
     
    ;;; (defun equal/or (n alist) (car (loop for i in alist when (equal i n) collect 't))) ;;; FUNCTION (defun filter-omn-by-intervals (omn-seq intervals) (setf omn-seq (loop with omn-events = (single-events omn-seq) with i = 0 while (not (null (nth i omn-events))) when (equal/or (car (pitch-to-interval (append (omn :pitch (nth i omn-events)) (omn :pitch (nth (1+ i) omn-events))))) intervals) collect (list (nth i omn-events) (nth (1+ i) omn-events)) and do (incf i 2) else collect (neg! (car (omn :length (nth i omn-events)))) and do (incf i)))) ;;; EXAMPLE (setf basic-omn-seq (make-omn :pitch (vector-to-pitch '(c4 c6) (gen-white-noise 100 :type :logistic)) :length '(t) :span :pitch)) ;;; check out all these filter-tests (setf omn-seq (filter-omn-by-intervals basic-omn-seq '(1 2 3))) ;(setf omn-seq (filter-omn-by-intervals basic-omn-seq '(3 -3))) ;(setf omn-seq (filter-omn-by-intervals basic-omn-seq '(1 -1 5 -5 7 -7))) (def-score example (:title "example" :key-signature 'atonal :time-signature '(4 4) :tempo 90) (instrument1 :omn (flatten omn-seq) :channel 1 :sound 'gm-piano) (instrument2 :omn (flatten basic-omn-seq) :velocity 20 :channel 3 :sound 'gm-piano))  
     
    here is a more complex example
     
    (defvar library) (defvar abfolge) (defvar omn-seq) (defvar rhy) (defvar field) ;;;library + rhy -------------------------------------------------------------------------------- (setf rhy 44) ;;; LIBRARY MIRT RHY-PAAREN! (setf library (list '(eb5 5 p mute) '(e4 5 mf mute) '(gs4 3 f mute) '(g5 3 ppp mute) '(f6 2 p mute) '(cs4 1 f mute) '(d5 1 fff mute) '(b3 4 pppp mute) '(bb5 4 mp mute) '(a4 3 pp mute) '(fs3 (2 7) ppp mute) '(c6 (1 11) mp mute))) (setf library (loop for i in library collect (append (list (car i)) (if (listp (cadr i)) (gen-length (list (rnd-pick (cadr i))) rhy) (gen-length (list (cadr i)) rhy)) (filter-last 2 i)))) ;;; gen seq from library/abfolge--------------------------------------------------------------- (setf field '(eb5 e4 gs4 g5 f6 cs4 d5 b3 bb5 a4 fs3 c6)) (setf abfolge (pick-norepeat 500 field)) (setf omn-seq (loop for x in abfolge with y do (setf y (assoc x library)) append (append (reverse (filter-first 2 y)) (filter-last 2 y)))) (setf basic-omn-seq omn-seq) (setf omn-seq (filter-omn-by-intervals basic-omn-seq '(1 -1 11 -11 13 -13 4 -4 8 -8 16 -16 20 -20 28 -28 32 -32 7 -7 19 -19))) ;;;--------------------------------------------------------------------------------------------- (def-score example2 (:title "example2" :key-signature 'atonal :time-signature '(4 4) :tempo 90) (instrument :omn (flatten omn-seq) :channel 1 :sound 'gm-piano) (hidden-structure :omn (flatten basic-omn-seq) :channel 1 :velocity 0 :sound 'gm-piano)) ;;;--------------------------------------------------------------------------------------------- (omn-list-plot (flatten omn-seq) :join-points t)  
  6. Like
    loopyc got a reaction from Stephane Boussuge in vector-to-length (with pitch-figurate) - audition tape   
    Wow, thank you...that means a lot coming from you :)
     
    Even at my extremely novice level with Opusmodus, the possibilities of what I can accomplish towards my own goals (experimental electronics) are seemingly endless :)
     
    The combination of the online documentation and the continuing insights/inspiration derived from this forum and it's generous and talented contributors....is making this first leg of my learning Opusmodus an extremely exciting and rewarding period of education...and as I am able generate and collect these audio materials into a personal library, no doubt Opusmodus will allow me to develop unique approaches to electronic musiking which is my primary driving force ;-)
     
     
     
     
  7. Like
    loopyc reacted to opmo in vector-to-length (with pitch-figurate) - audition tape   
    Grand improvisation, cool indeed 😎
  8. Like
    loopyc got a reaction from opmo in Euclidean Rotations ('My Opus In The Modus Of Ghosts")   
    Eno/Byrne-esque 'Beat-Betas' as audition tape (i.e. 60 second continuous excerpts).
     
    Opusmodus generated MIDI...Mixed as "prototypes" in Logic 9.1.8,'auditioned' in iTunes 'live' to "Audio Hijack Pro".
  9. Like
    loopyc got a reaction from AM in vector-to-length (with pitch-figurate) - audition tape   
    Audition format (excerpts) of various personal application studies for Opusmodus.
     
    ..
     
    .
  10. Like
    loopyc got a reaction from AM in vector-to-length (with pitch-figurate) - audition tape   
    Audition format (excerpts) of various personal application studies for Opusmodus.
     
    ..
     
    .
  11. Like
    loopyc got a reaction from opmo in Euclidean Rotations ('My Opus In The Modus Of Ghosts")   
    Eno/Byrne-esque 'Beat-Betas' as audition tape (i.e. 60 second continuous excerpts).
     
    Opusmodus generated MIDI...Mixed as "prototypes" in Logic 9.1.8,'auditioned' in iTunes 'live' to "Audio Hijack Pro".
  12. Like
    loopyc got a reaction from opmo in Euclidean Rotations ('My Opus In The Modus Of Ghosts")   
    Eno/Byrne-esque 'Beat-Betas' as audition tape (i.e. 60 second continuous excerpts).
     
    Opusmodus generated MIDI...Mixed as "prototypes" in Logic 9.1.8,'auditioned' in iTunes 'live' to "Audio Hijack Pro".
  13. Like
    loopyc got a reaction from AM in vector-to-length (with pitch-figurate) - audition tape   
    Audition format (excerpts) of various personal application studies for Opusmodus.
     
    ..
     
    .
  14. Like
    loopyc got a reaction from AM in vector-to-length (with pitch-figurate) - audition tape   
    Audition format (excerpts) of various personal application studies for Opusmodus.
     
    ..
     
    .
  15. Thanks
    loopyc reacted to AM in rest-diminution/augmentation   
    i needed functions which shorten/enlarge only the RESTS of my complex/tupled-mixed texture - not precisely - so i coded it with diminution/augmentation+round (otherwise i would be in trouble by the crazy rests)...
    violà... use it or code it smarter for OMPO! greetings andré
     
    3 functions:
    rest-diminution
    rest-augmentation
    only-length-augmentation
     
     
    ;;; (defun rest-diminution (omnlist &key (factor 1) (round 1/4)) (length-rest-merge (flatten (loop for i in (single-events (length-rest-merge omnlist)) when (< (car (omn :length i)) 0) collect (length-rational-quantize (length-diminution factor i) :round round) else collect i)))) (rest-diminution '(-3q q e4 mp -w e e4 ff) :factor 3 :round 1/4) => (-q e4 mp -h e e4 ff) (rest-diminution '(-3q q e4 mp -w e e4 ff) :factor 3 :round 1/8) => (-e q e4 mp -q. e e4 ff) ;;; (defun rest-augmentation (omnlist &key (factor 1) (round 1/4)) (length-rest-merge (flatten (loop for i in (single-events (length-rest-merge omnlist)) when (< (car (omn :length i)) 0) collect (length-rational-quantize (length-augmentation factor i) :round round) else collect i)))) (rest-augmentation '(-3q q e4 mp -w e e4 ff) :factor 3 :round 1/4) => (-q e4 mp -d. e e4 ff) (rest-augmentation '(-3q q e4 mp -w e e4 ff) :factor 3 :round 1/8) => (-q e4 mp -d. e e4 ff) ;;; (defun only-length-augmentation (omnlist &key (factor 1) (round 1/4)) (length-rest-merge (flatten (loop for i in (single-events (length-rest-merge omnlist)) when (> (car (omn :length i)) 0) collect (length-rational-quantize (length-augmentation factor i) :round round) else collect i)))) (only-length-augmentation '(-3q q e4 mp -w e e4 ff) :factor 3 :round 1/8) => (-3q h. e4 mp -w q. e4 ff) (only-length-augmentation '(-3q q e4 mp -w e e4 ff) :factor 3 :round 1/4) => (-3q h. e4 mp -w q. e4 ff -e)  
     
     
  16. Like
    loopyc reacted to torstenanders in Composing various polyphonic textures concisely   
    I am interested in controlling musical textures, i.e., relations between polyphonic parts. I defined a bunch of functions that use the simple polyphonic music representation used also by my function preview-score that I presented shortly (see https://opusmodus.com/forums/topic/902-polyphonic-preview/#comment-2686). Apologies that this post is a bit longer. 
     
    Here is a particularly flexible function: map-parts transforms a polyphonic score. It is a variant of the standard Lisp function mapcar, where a function is applied to every part in a score, but each instrument/part can be given its own function arguments for the transformation. One argument is the respective part of the score. This argument is marked by an underscore (_) in the argument lists.
     
    In the following example, the function pitch-transpose is applied to a score with two very simple parts consisting of only a single note each. This function has two required arguments, a transposition interval (measured in semitones), and the pitch sequence or OMN to transpose. The transposition interval for the first part is 4 (major third upwards), and the underscore marks the position of the violin part to transpose, etc.
     
    Note that you can always see and hear the resulting score by wrapping preview-score around each example. Hopefully these examples sufficiently demonstrate my need to have some shortcut for preview-score :)
    (map-parts '(:vln ((h e4)) :vlc ((h c3))) #'pitch-transpose '(:vln (4 _) :vlc (12 _))) => (:vln ((h gs4)) :vlc ((h c4)))  
    Here are a few more relatively simple application examples. I am first defining some musical material to reduce the length of the remaining definitions. 
    (setf material '((-3h fs4 pp eb4 <) (q e4 < fs4 <) (3h gs4 mp> a4 > bb4 >) (q a4 pp -) (-5h - g4 pp leg eb4 < leg d4 < leg) (q bb4 < e4 <) (5h g4 mp> leg b4 > leg a4 > leg bb4 > leg d4 > leg) (q gs4 pp -)))  
    Now, the next example creates a strict canon formed with the given material -- but without following any counterpoint rules :)  For different parts the material is metrically shifted and transposed.
    This example also shows that map-parts calls can be nested (naturally). The function metric-shift appends some rest before some musical material, but preserves its rhythmical structure, i.e. metrically shifts the material.   
    (map-parts (map-parts `(:vl1 ,material :vl2 ,material :vla ,material :vlc ,material) #'metric-shift '(:vl1 :skip ;; :skip means to leave part unchanged :vl2 (-q _) :vla (-h _) :vlc (-h. _))) #'pitch-transpose '(:vl1 (6 _) :vl2 (4 _) :vla (2 _) :vlc :skip))  
    The next examples shows some simple homorhythmic texture created by randomised transpositions. Each part shares a similar overall pitch profile. Note also that calls can be more concise with a (lambda) function that nests calls to transformation functions -- instead of nesting map-parts as shown above.
    (map-parts `(:vl1 ,material :vl2 ,material :vla ,material :vlc ,material) #'(lambda (transpose seq) ;; static transposition for moving parts into different registers (pitch-transpose transpose ;; randomised transposition of notes in parts (pitch-transpose-n (rnd 10 :low -2 :high 2) seq))) '(:vl1 (7 _) :vl2 (0 _) :vla (-10 _) :vlc (-20 _)))  
    Finally, here is a homophonic texture created by random pitch variants (retrograde, inversion etc.). The global pitch profiles of parts differ here, in contrast to the previous example.
    (map-parts `(:vl1 ,material :vl2 ,material :vla ,material :vlc ,material) #'pitch-variant `(:vl1 (_ :transpose 7 :seed 10) :vl2 (_ :transpose 0 :seed 20) :vla (_ :transpose -10 :seed 30) :vlc (_ :transpose -20 :seed 40)) :shared-args '(:variant ?))  
    All these examples demonstrate very conventional textures, as such textures are more easy to explain.  
     
    For completeness, below is the definition of MAP-PARTS. There are various dependencies that I tried all to add as well. Please let me know if I missed any definition, and apologies in advance.
     
    Best,
    Torsten
    (defun map-parts (score fn part-args &key (parameter nil) (shared-args nil)) "Create or transform a polyphonic score. The original purpose is for creating/transforming musical textures, i.e., relations between polyphonic parts. Applies function `fn' to parts in `score': this function is a variant of the standard Lisp function `mapcar', but specialised for scores. A score is represented in the format discussed in the documentation of the function `preview-score'. Additional arguments for `fn' can be specified in `part-args', and these argument lists can be different for each part. However, one argument is the part of the score. This argument is marked by an underscore (_) in the argument lists. In the following example, the function `pitch-transpose' is applied to a score with two parts. This function has two required arguments, a transposition interval (measured in semitones), and the pitch sequence or OMN to transpose. The transposition interval for the first part is 4 (major third upwards), and the underscore marks the position of the violin part to transpose, etc. ;;; (map-parts '(:vln ((h e4)) ;;; :vlc ((h c3))) ;;; #'pitch-transpose ;;; '(:vln (4 _) ;;; :vlc (12 _))) Args: - score (headerless score): See {defun preview-score} for format description. - fn: A function that expects and returns an OMN sequence or a sequence of parameter values (e.g., lengths, or pitches) as specified in the argument `parameter'. - part-args (plist): Alternating instrument keywords (same as in `score') followed by arguments list for `fn' for that instrument/part. If arguments is :skip, then that part is returned unchanged. - parameter (omn parameter, e.g., :length or :pitch, default nil means processing full OMN expression): If `fn' expects only single parameter to process, then it can be set here. - shared-args (list): For all instruments/parts, these arguments are appended at end end of its part-specific arguments. They are useful, e.g., for keyword arguments. " ;; catching hard-to-find user error... (let* ((instruments (get-instruments score)) (missing-instruments (remove-if #'(lambda (arg-instr) (member arg-instr instruments)) (get-instruments part-args)))) (assert (not missing-instruments) (part-args) "map-parts: Some instruments in `part-args' don't have a matching instrument in `score'. ~A.~%" missing-instruments)) (let ((parts (make-hash-table :test #'equal))) ;; fill hash table, using leading keywords as keys (loop for part in (tu:plist->pairs score) do (setf (gethash (first part) parts) part)) (tu:pairs->plist (loop for instrument-arg-pair in (tu:plist->pairs part-args) for instrument = (first instrument-arg-pair) for part = (gethash instrument parts) for part-omn = (second part) for fn-args = (second instrument-arg-pair) collect (if (equal fn-args :skip) part ; no processing (cons instrument (let ((result (apply fn (append (substitute (if parameter (omn parameter part-omn) part-omn) '_ fn-args) shared-args)))) (list (if parameter (omn-replace parameter result part-omn) result))))) )))) (defun metric-shift (l lengths) "Appends `l' (a length or omn) before `lengths' (a list of lengths or omn), but maintains the metric structure, i.e., the function shifts `lengths' metrically 'to the right' by `l'. Returns an OMN form if lengths is an OMN form, otherwise a length form. Related: assemble-seq (but that does not shift across bars)" (let* ((time-sigs (get-time-signature lengths)) (result (omn-to-time-signature (cons l (flatten lengths)) time-sigs))) (if (omn-formp lengths) result (omn :length result)))) ; (metric-shift '-h '((q q q q) (q q q q))) ; (metric-shift '(h g4) '((q c4 q d4 q e4 q f4) (q c4 q d4 q e4 q f4))) (defun get-instruments (score) "Returns all instruments of `score', a headerless score (see {defun preview-score} for its format)." (at-even-position score)) (defun at-even-position (in-list) (at-position in-list 2 0)) (defun at-position (in-list factor offset) "Returns a list containing every factor-th elements of in-list starting at offset" (mapcar #'(lambda (i) (nth i in-list)) (arithmeric-series factor offset (ceiling (/ (length in-list) factor))))) (defun arithmeric-series (factor offset length) (let (result) (reverse (dotimes (i length result) (push (+ (* i factor) offset) result))))) (defun plist->pairs (plist) (loop :for (key val) :on plist :by #'cddr :collect (list key val))) (defun pairs->plist (pairs) (one-level-flat pairs)) (defun one-level-flat (list) "flatens one level of the given form. Example: (one-level-flat '(((note) (note)) ((pause) (pause)) ((note)))) -> ( (note) (note) (pause) (pause) (note))" (apply #'append list))  
  17. Thanks
    loopyc reacted to AM in omn-sieve-filter   
    (defun memberp (n liste) (not (equal 'nil (member n liste)))) ;;; MAIN (defun omn-sieve-filter (omn-list filter-list) (flatten (loop for i in (single-events omn-list) for j from 1 to (length omn-list) when (memberp j filter-list) collect i else collect (length-invert (car i))))) (omn-sieve-filter (make-omn :pitch (rnd-sample 10 '(c4 d4 e4 fs4 gs4) :seed 89) :length '(e) :span :pitch) '(1 2 3 5 8 9 10)) => (e c4 mf e gs4 mf e fs4 mf -1/8 e e4 mf -1/8 -1/8 e c4 mf e gs4 mf e fs4 mf)  
  18. Thanks
    loopyc reacted to AM in binary-filter   
    something i've coded...
     
    (defun binary-filter (alist bin-list) (let ((event-list (cond ((omn-formp alist) (single-events alist)) (t alist)))) (flatten (loop for i in event-list for j in bin-list when (= j 1) collect i else append (cond ((omn-formp i) (list (length-invert (car i)))) ((lengthp i) (neg! (omn :length (list i))))))))) (binary-filter '(q -q -q q) '(0 1 0 1)) => (-1/4 -q -1/4 q) (binary-filter '(q q q q -q) '(0 1 0 1 1)) => (-1/4 q -1/4 q -q) (binary-filter '(c4 d4 e4 f4) '(1 1 0 1)) => (c4 d4 f4) (binary-filter '(q c4 mf d4 e4 e f4 ppp g4 a4 b4) '(1 0 1 1 0 1 1)) => (q c4 mf -1/4 q e4 mf e f4 ppp -1/8 e a4 ppp e b4 ppp)  
  19. Thanks
    loopyc reacted to AM in neg-sieve   
    ...how ti filter all "unused/complementary" pitches inside a sieve (if you like to extend the function... could be interesting if it works also with chords)
     
    (defun neg-sieve (pitchlist) (let ((pitchlist (pitch-to-midi pitchlist))) (midi-to-pitch (loop for i from (car pitchlist) to (car (last pitchlist)) when (null (member i pitchlist)) collect i)))) (setf sieve '(fs3 g3 as3 b3 c4 cs4 ds4 e4 f4 gs4 a4 d5 eb5 fs5 g5 gs5 bb5 b5 c6 cs6 e6 f6)) (neg-sieve sieve) => (gs3 a3 d4 fs4 g4 bb4 b4 c5 cs5 e5 f5 a5 d6 eb6) (neg-sieve '(c4 d4 e4 fs4 gs4 as4 c5)) => (cs4 eb4 f4 g4 a4 b4)  
     
     
  20. Thanks
    loopyc reacted to opmo in Opusmodus 1.2.23428   
    Any value - an integer, by not a lists.
  21. Thanks
    loopyc reacted to opmo in Opusmodus 1.2.23428   
    View File Opusmodus 1.2.23428
    New:
    vector-to-envelope
    sum-to-size
    snippet - Audition default parameters.
     
    Function name change:
    vector-shift -> vector-envelope2
     
    L-System addition:
    Allows functions inside a rule.
     
    New keyword :seq in filter-repeat
     
     

    sum-to-size
    This function returns a list of numbers in a given size of equal numbers (plus/minus 1) which add up to a total.
     
    Examples:
     
     
    (sum-to-size 45 8) => (5 5 5 6 6 6 6 6)  
    (sum-to-size 25 7) => (3 3 3 4 4 4 4) (sum-to-size 25 3) => (8 8 9) (sum-to-size 25 11) => (2 2 2 2 2 2 2 2 3 3 3) (sum-to-count 104 8) => (13 13 13 13 13 13 13 13)  
     
     
     
    Snippet
    Audition default parameters:
     
    (defparameter *audition-tempo* 120) (defparameter *audition-length* 1/4) (defparameter *audition-pitch* 'c4) (defparameter *audition-velocity* 'mf) (defparameter *audition-ignore-ports* t) (defparameter *audition-sound* 'gm) (defparameter *audition-channel* 1) (defparameter *audition-program* 0) (defparameter *audition-volume* 92) (defparameter *audition-port* 0)  
    The default ‘Audition’ parameters will allow you to make changes to the ‘Preferences/Audition’ parameters without the need to open the window each time you make a change to port, channel, sound or program. Using the ‘Audition’ parameters as a part of the code will help you in your work flow. This possibility is useful for demonstrations and presentations.
     
    Examples:
    1.
     
    (progn ;;; Cello   (defparameter *audition-tempo* 72)   (defparameter *audition-velocity* 'f)   (defparameter *audition-sound* 'gm)   (defparameter *audition-channel* 7)   (defparameter *audition-program* 'cello)   (defparameter *audition-volume* 100) ) ;(J. S. Bach, Sechs Suiten Sonaten fuer Violoncello solo, Suite I, Preludium, 1722) '(((leg s g2 mf e3 b3 a3 b3 g3 fs3 g3)    (leg e3 g3 dig2 fs3 g3 b2 > dig1 d3 > cs3 > b2 >))   ((leg s cs3 p dig3 g3 dig2 a3 sul g3 dig2 a3 g3 a3 g3)    (leg cs3 g3 a3 g3 a3 g3 a3 g3))   ((leg s fs3 p< dig1 a3 < sul d4 < cs4 d4 mf a3 dig4 g3 a3 fs3)    (leg a3 g3 a3 d3 > sul fs3 > dig3 e3 > d3 >))   ((leg s e2 p dig1 b2 g3 fs3 g3 b2 g3 b2)    (leg e2 b2 g3 fs3 g3 b2 g3 b2)))  
     
    2.
     
    (progn ;;; Piano   (defparameter *audition-tempo* 98)   (defparameter *audition-velocity* 'f)   (defparameter *audition-sound* 'gm)   (defparameter *audition-channel* 1)   (defparameter *audition-program* 'Acoustic-Grand-Piano)   (defparameter *audition-volume* 100) ) ;(F. Chopin, Etudes, Op. 10, No. 5, 1833) '((3e gb6 bb6 db6 gb6 eb6 gb6 db6 gb6 bb5 db6 gb5 bb5)   (3e gb5 bb5 db5 gb5 eb5 gb5 db5 gb5 bb4 db5 gb4 bb4)   (3e db4 db5 ab4 db5 ab4 ab5 ab4 ab5 eb5 ab5 eb5 eb6)   (3e eb5 eb6 ab5 eb6 ab5 ab6 ab5 ab6 db6 ab6 db6 db7))  
     
    To send the snippet to a port you need to set the *audition-ignore-ports* to nil and set the *audition-port* to a number of your virtual instrument port:
     
    3.
     
    (progn ;;; Violin   (defparameter *audition-tempo* 120)   (defparameter *audition-velocity* 'mf)   (defparameter *audition-ignore-ports* nil)   (defparameter *audition-sound* 'vsl-violin)   (defparameter *audition-channel* 1)   (defparameter *audition-program* 0)   (defparameter *audition-volume* 100)   (defparameter *audition-port* 1)   )  
     
     
     
    vector-to-envelope
    This function applies ‘ambitus series’ derived from a envelope list into a list of floating-point numbers.
     
    Lets examine first how envelope create the ambitus series (low high).
    We interleave the envelope with a value 2 first and then we apply a sort function:
     
    (setf envelope '(-5.1 -2.3 1.5 -0.8 4.6 10.6)) (sort-asc (gen-interleave 2 envelope)) => ((-5.1 -2.3) (-2.3 1.5) (-0.8 1.5) (-0.8 4.6) (4.6 10.6))  
    From the envelope above the function creates five ambitus series each with two lists: start (low high) and end (low high).
     
    Start        End
    ((-5.1 -2.3) (-2.3 1.5))
    ((-2.3 1.5)  (-0.8 1.5))
    ((-0.8 1.5)  (-0.8 2.1))
    ((-0.8 2.1)  (-0.8 4.6))
    ((-0.8 4.6)  (4.6 10.6))
     
    Next, the values list (floating-point numbers) is divided by the count of the ambitus series. In our example the count is 5:
     
     
    (sum-to-size 128 5) => (25 25 26 26 26)  
     
    The final process is to select randomly segment numbers for each of the 5 sublists:
     
    With :type 1
     
    (rnd-sum 25 '(2 3 5 7 11 13 17 19)) => (7 3 2 2 11)  
    With :type 2 (length segments)
     
    (rnd-sum-to-size 25 8 '(2 3 5 7 11 13 17 19)) => (2 5 3 3 3 3 3 3)  
    With :type 3 (length segments) - with equal or plus/minus 1 equal numbers.
     
     
    (sum-to-size 25 8) => (3 3 3 3 3 3 3 4)  
     
    Lets see the result:
     
    (list-plot (vector-to-envelope '(-5.1 -2.3 1.5 -0.8 4.6 10.6) (gen-white-noise 128)))  

     
    A slightly different result we can achieve with optional :type 2:
     
    (list-plot (vector-to-envelope '(-5.1 -2.3 1.5 -0.8 4.6 10.6) (gen-white-noise 128) :type 2))  

     
    Most equal distribution of segments is achieved with :type 3:
     
    (list-plot (vector-to-envelope '(-5.1 -2.3 1.5 -0.8 4.6 10.6) (gen-white-noise 128) :type 3))  

     
     
    Examples:
     
     
    (list-plot (vector-to-envelope   (rnd 12 :low -10.0 :high 40.0)   (gen-white-noise 356)   :segment '(1 2 3 4 5)))  
     

     
     
     
    (list-plot (vector-to-envelope   (rnd 6 :low -1.0 :high 4.0 :seed 45)   (gen-white-noise 356)   :segment '(1 2 3)   :type 3))  
     

     
     
     
    (list-plot (vector-to-envelope   (rnd 4 :low -1.0 :high 4.0 :seed 45)   (gen-white-noise 356)   :segment (primes 12)))  
     

     
     
    (setf env2 '(0.2 0.1 0.5 0.1 0.8 0.5 0.1 0.4 0.2 0.3)) (list-plot (vector-to-envelope   (gen-tendency 4 env2)   (gen-tendency 356 env2)   :segment (primes 4)))  

     
     
     
     
    New keyword :seq in filter-repeat
     
    (filter-repeat 1 '(a4 gs4 a4 gs4 a4 fs4 gs4 g5 bb5 g5 gs4) :seq 2) => (a4 gs4 a4 fs4 gs4 g5 bb5 g5 gs4) (filter-repeat 1 '(gs4 fs3 a4 fs3 a4 bb5 a4 gs4) :seq 2) => (gs4 fs3 a4 bb5 a4 gs4) (filter-repeat 1 '(gs4 fs3 a4 fs3 fs3 a4 fs3 a4 bb5 a4 gs4) :seq 3) => (gs4 fs3 a4 fs3 a4 bb5 a4 gs4)  
     
     
     
    L-System
    Example with a function inside a rule:
     
    (progn   (defclass llen (l-system)     ((axiom :initform '(s e))      (depth :initform 2)))      (defmethod l-productions ((ls llen))     (choose-production      ls      (s (--> (rnd-pick '((s * e * s /) (s  e -s /))) q / s  e -s /))      (e (--> s * s * s / q / s  e -s / (rnd-pick '(h -q s -e) :encode nil)))))   )  
    (rewrite-lsystem 'llen :depth 2) => (s * e * s / q / s e -s / q / s e -s / s * s * s / q / s e -s / -q -s /     s e -s / q / s e -s / * s e -s / q / s e -s / * s e -s / q / s e -s / /     q / s e -s / q / s e -s / s * s * s / q / s e -s / -e -s / -e) or => (s e -s / q / s e -s / s * s * s / q / s e -s / -q -s / q / s e -s /     q / s e -s / s * s * s / q / s e -s / -e -s / s * e * s / q / s e    -s / * s e -s / q / s e -s / * s e -s / q / s e -s / / q / s * e *     s / q / s e -s / s * s * s / q / s e -s / h -s / h) . . . (length-lsystem 'llen :depth 2) => (s e -s e t e -s e t e -s t e = = t e -s - - t e -s e t e -s = e -s     e t e -s = e -s e t e -s = t e -s e t e -s t e = = t e -s -e -s -e)  
    Best wishes,
    Janusz
     
    Submitter opmo Submitted 06/11/2018 Category Opusmodus Latest Release  
  22. Like
    loopyc reacted to Stephane Boussuge in Opusmodus 1.2.23428   
    Thank you for this update Janusz, the possibility to specify the snippets audition parameters directly into the code was very useful for me for designing and test instrument by instrument the orchestral template based on EastWest Hollywood orchestra and Plogue Bidule shared into the Template and customisation section.
     
    no need to alway click and go to preferences
     
    just write some preconfigured code and evaluate it depend on your need
     
    Very convenient
     
    SB.
     
  23. Thanks
    loopyc reacted to opmo in Opusmodus 1.2.23392   
    View File Opusmodus 1.2.23392
    New functions:
    rnd-sum-to-size
    vector-shift (thanks to Andre Meier)
     
     
    rnd-sum-to-size
    This function returns a list of numbers which add up to N and a given size (list length). If total was not reached in a given size in a trial, altered numbers are append to the numbers set.
     
    (rnd-sum-to-size 11 5 '(1 2 3)) => (2 3 1 3 2)  
    Set random :seed to ensure recurring output:
     
    (rnd-sum-to-size 11 5 '(1 2 3) :seed 879) => (1 2 2 3 3)  
    Examples:
     
    (rnd-sum-to-size 45 8 '(2 3 5 7 11 13 17 19)) => (2 11 3 5 13 2 2 7) (rnd-sum-to-size 25 7 '(6 11 13 1 3) :seed 436) => (6 3 3 3 1 3 6) (rnd-sum-to-size 25 3 '(6 11 13 1 3) :seed 436) => (11 13 1) (rnd-sum-to-size 25 11 '(6 1 3) :seed 13) => (3 1 1 6 1 1 6 1 3 1 1) (rnd-sum-to-size 45 22 '(1 2 3) :seed 835) => (3 3 3 1 2 3 1 2 2 3 1 2 3 1 1 1 1 3 2 3 2 2)  
    In the next two examples the numbers set is altered:
     
    (rnd-sum-to-size 8 7 '(9 8 6) :seed 45) => (1 1 1 1 2 1 1) (rnd-sum-to-size 17 7 '(1 2) :seed 234) => (2 3 1 3 3 3 2)  
     
    vector-shift
    This function applies ‘ambitus series’ derived from wave1 and wave2 values into a list of floating-point numbers.
     
    Lets examine first how wave1 and wave2 create the ambitus series (low high).
    We mix the two waves first and then we apply a sort function:
     
    (setf wave1 '(-5.1 -2.3 1.5 -0.8 4.6 10.6)) (setf wave2 '(1.0 1.2 -1.1 2.1 -0.3 -2.5)) (sort-asc (gen-mix wave1 wave2)) => ((-5.1 1.0) (-2.3 1.2) (-1.1 1.5) (-0.8 2.1) (-0.3 4.6) (-2.5 10.6))  
    From the two waves above the function creates five ambitus series each with two lists: start (low high) and end (low high).
     
    Start      End ((-5.1 1.0) (-2.3 1.2)) ((-2.3 1.2) (-1.1 1.5)) ((-1.1 1.5) (-0.8 2.1)) ((-0.8 2.1) (-0.3 4.6)) ((-0.3 4.6) (-2.5 10.6))  
    Next, the values list (floating-point numbers) is divided by the count of the ambitus series. In our example the count is 5:
     
     
    (setf values (gen-white-noise 120)) (/ (length values) 5) => 24  
     
    The final process is to select randomly segment numbers for each of the 5 sublists:
     
    With :type 1
     
    (rnd-sum 24 '(2 3 5 7 11 13 17 19)) => (2 7 13 2)  
    With :type 2 (length segments)
     
    (rnd-sum-to-size 24 8 '(2 3 5 7 11 13 17 19)) => (3 3 3 3 3 3 3 3)  
    Lets see the result:
     
    (list-plot (vector-shift wave1 wave2 (gen-white-noise 120)))  

     
     
    A slightly different result we can achieve with optional :type 2:
     
     
    (list-plot (vector-shift wave1 wave2                          (gen-white-noise 120)                          :type 2))  
     

     
     
    Examples:
     
     
    (list-plot (vector-shift '(-7.1 1) '(-0.1 10)                (gen-white-noise 356)))  
     

     
     
     
    (list-plot (vector-shift '(-7.1 1) '(-0.1 10)                (gen-white-noise 356)                :segment '(1 2 3)))  
     

     
     
     
    (list-plot (vector-shift '(-7.1 1) '(-0.1 10)                (gen-white-noise 356)                :segment '(1 2 3)                :type 2))  
     

     
     
    (list-plot (vector-shift '(4.2456284 7.2268248 6.4440737)                          '(3.682579 8.78879 10.000002)                          (gen-white-noise 356)                          :segment (primes 12)))  

     
     
    (list-plot (vector-shift '(4.2456284 7.2268248 6.4440737)                          '(3.682579 8.78879 10.000002)                          (gen-white-noise 356)                          :segment (primes 12)                          :type 2))  
     

     
     
    (setf wave1 '(-5.1 -2.3 1.5 -0.8 4.6 10.6)) (setf wave2 '(1.0 1.2 -1.1 2.1 -0.3 -2.5)) (list-plot (vector-shift wave1 wave2 (gen-white-noise 356)))  
     

     
     
    (list-plot (vector-shift wave1 wave2 (gen-white-noise 356) :type 2))  

     
     
     
    (list-plot (vector-shift   (rnd 12 :low -1.0 :high 4.0 :seed 45)   (rnd 12 :low -1.0 :high 4.0 :seed 23)   (gen-white-noise 356)   :segment '(1 2 3)))  
     

     
     
     
    (list-plot (vector-shift   (rnd 12 :low -1.0 :high 4.0 :seed 45)   (rnd 12 :low -1.0 :high 4.0 :seed 23)   (gen-white-noise 356)   :segment '(1 2 3)   :type 2))  
     

     
     
     
    (list-plot (vector-shift   (rnd 12 :low -1.0 :high 4.0 :seed 45)   (rnd 12 :low -1.0 :high 4.0 :seed 23)   (gen-white-noise 356)   :segment '(3 6 9)))  
     

     
     
     
    (list-plot (vector-shift   (rnd 12 :low -1.0 :high 4.0 :seed 45)   (rnd 12 :low -1.0 :high 4.0 :seed 23)   (gen-white-noise 356)   :segment (primes 12)))  
     

     
     
    (setf wave3 '(.2 .1 .5 .1 .8 .5 .1 .4 .2 .3)) (list-plot (vector-shift   (gen-tendency 24 wave3)   (gen-tendency 24 wave3)   (gen-tendency 356 wave3)   :segment (primes 6)))  

     
     
     
    (list-plot (vector-shift   (gen-tendency 24 wave3)   (gen-tendency 24 wave3)   (gen-tendency 356 wave3)   :segment (primes 6)   :type 2))  
     

     
     
    Best wishes,
    JP
     
    Submitter opmo Submitted 06/06/2018 Category Opusmodus Latest Release  
  24. Like
    loopyc reacted to AM in vector-range-drift   
    INPUT-curves could be like that: (in that way you could imitate some early "xenakis-curves" when you map it to pitches :-))
     
    (setf curve1 '(-5.1 -2.3 -1.1 -0.8 -0.3 -2.5)) (setf curve2 '(1.0 1.2 1.5 2.1 4.6 10.6))  
    (vector-range-drift curve1 curve2 (gen-white-noise 250))  
    as result:
     

     
     
     
    "imitated" by my old/simple function:
     
    (list-plot (append (vector-range-drift '(-5.1 1) '(-2.3 1.2) (gen-white-noise 50)) (vector-range-drift '(-2.3 1.2) '(-1.1 1.5) (gen-white-noise 50)) (vector-range-drift '(-1.1 1.5) '(-0.8 2.1) (gen-white-noise 50)) (vector-range-drift '(-0.8 2.1) '(-0.3 4.6) (gen-white-noise 50)) (vector-range-drift '(-0.3 4.6) '(-2.5 10.6) (gen-white-noise 50))))  
     
  25. Thanks
    loopyc reacted to opmo in how to code a NAND gate?   
    Few more function which could be useful for you (part of the system):
     
    (contain-itemp 'inv '(c 7b9s11 inv 1 chord)) => t (contain-itemp '= '(e f d s)) => nil (contain-itemsp '(9 8) '(0 1 11 8 10 9)) => t (contain-sequencep '(11 8) '(0 1 11 8 10 9)) => t JP
×