Jump to content

AM

Members
  • Posts

    792
  • Joined

  • Last visited

Reputation Activity

  1. Like
    AM reacted to torstenanders in lisp / special divide - help needed   
    For a generic solution, you could use some function split-if that expects a Boolean function as argument comparing two consecutive pairs, and always splits a sublist if the Boolean function returns True. I don't have such a Lisp function at hand right now, but of an algorithm idea here is a similar Python function, only that this expects a Boolean function of a single argument only. If you port this function to Lisp, you could then generalise it by checking the number of arguments the given Boolean function expects, and it apply it always to the corresponding consecutive number of elements of xs.
     
    def split_if(fun, xs): """ Splits `xs` (list) into sublists based on a test. Starts a new sublist at every element for which Boolean function `fun` returns true. Examples -------- >>> split_if(lambda x: x % 3 == 0, [0, 1, 2, 3, 4, 5]) [[0, 1, 2], [3, 4, 5]] >>> split_if(lambda x: x % 3 == 0, [1, 2, 3, 4, 5, 6, 7]) [[1, 2], [3, 4, 5], [6, 7]] NOTE: Internally, `split_if` skips the first element of `xs`. So, if `fun` is stateful, it should initialise its state using that first element. For an example, see implementation of `format_api.split_into_sections`. """ result_list = [] start = 0 # Collect new list up to x whenever fun(x) == true, but not before first element for index, x in enumerate(xs[1:]): if fun(x): result_list.append(xs[start:index+1]) start = index+1 if start == 0: return [xs] result_list.append(xs[start:]) return result_list  
     
    Here is another approach as well with a Lisp function from my toolbox expecting a list of positions where to split the list. You could find those positions by iterating over conservative pairs of your list elements with the function positions-if listed below.
     
    OK, none of this is a ready made solution, but all the necessary pieces are there 🙂  I need to head back to work now ....
     
    Torsten
     
    (defun subseqs (sequence positions &optional end) "Splits `sequence' into a list of subsequences split at `positions'. Each element in `positions' specifies a position at which a new sublist starts. ; (subseqs '(0 1 2 3 4 5 6) '(0 2 4)) => ((0 1) (2 3) (4 5 6)) ; (subseqs '(0 1 2 3 4 5 6) '(2 4 6) 5) => ((2 3) (4)) `positions' are implicitly sorted and positions beyond end are excluded. " (let* ((updated-pos (sort (if end (remove-if #'(lambda (x) (>= x end)) positions) positions) #'<)) (full-pos (append updated-pos (list (if end end (length sequence)))))) (mapcar #'(lambda (start end) (subseq sequence start end)) (butlast full-pos) (rest full-pos)) )) (defun positions-if (predicate sequence &key key (start 0)) "Like the Common Lisp function `position-if', but returns all positions in `sequence' that match `predicate'. ; (positions-if #'oddp '((1) (2) (3) (4)) :key #'car) ; => (0 2)" (labels ((aux (predicate sequence &key key (start 0) accum) (let ((pos (position-if predicate sequence :start start :key key))) (if pos (aux predicate sequence :start (1+ pos) :key key :accum (cons pos accum)) (reverse accum))))) (aux predicate sequence :start start :key key))) #| ;; comparison (position-if #'oddp '((1) (2) (3) (4)) :key #'car) |#  
  2. Like
    AM reacted to opmo in Opusmodus - Italian (version 1.4)   
    We are happy to announce the Italian version of Opusmodus is almost ready and will be released with the forthcoming update version 1.4.
    The entire Opusmodus documentation was translated by Prof. Marco Giommoni.


     
    Best wishes,
    Janusz
  3. Like
    AM reacted to torstenanders in lsystem - extension idea   
    > the GAP is between visual L-systems and acoustic ones
     
    Yes, of course, there is a completely different way of perception at play. If you come up with a good answer to that, I would be interested.
     
    BTW, if you want some other examples of compositional applications, you might want to have a look at ”Cells” (1993/94) by Hanspeter Kyburz, discussed in the following two publications.
     
     
    Supper, M. (2001) A Few Remarks on Algorithmic Composition. Computer Music Journal. 25 (1), 48–53.  
    Holz, E. (2012) Das Wachstumprinzip von L-Systemen in der Musik von Hanspeter Kyburz. Master’s thesis. Hochschule für Musik Hanns Eisler.  Available from: http://www.eresholz.de/de/text/Eres Holz_Ausschnitt aus der Masterarbeit.pdf(Accessed 20 September 2016).  
  4. Like
    AM reacted to torstenanders in Triggering event - anonymous functions (like in Javascript)   
    > but SLEEP is not very precise
     
    The Common Lisp standard actually says that the number of seconds specified as arguments for sleep is approximate:
     
    > Causes execution to cease and become dormant for approximately the seconds of real time indicated by seconds, whereupon execution is resumed. 
     
    CLHS: Function SLEEP
    WWW.LISPWORKS.COM  
    Anyway, it seems that at least on a Mac the imprecision is rather regular, see the following discussion with empirical tests.
    Time to sleep under different platforms
    LISP-HUG.LISPWORKS.NARKIVE.COM  
    Anyway, for realtime scheduling in a musical context one needs likely a proper scheduler for that. 
     
    Best,
    Torsten
  5. Like
    AM reacted to opmo in Triggering event - anonymous functions (like in Javascript)   
    SLEEP is the function you are looking for.
    (sleep time) ; in seconds 
     
    The 1st expression will play for 10 second. The 2nd for 4 seconds.
    (progn (ps 'gm :cl (list (gen-repeat 100 '((s c4 d4 e4 f4 g4))))) (sleep 10) (ps 'gm :fl (list '(q c5 d5 e5 f5 g5 a5 b5))) (sleep 4) (ps 'gm :fl (list '(w cs6))) )  
  6. Like
    AM reacted to opmo in lsystem - extension idea   
    Will have a look if time permit. Working on Italian version.
  7. Like
    AM reacted to opmo in import pitches/chords from midi-file?   
    Shortly.
  8. Like
    AM got a reaction from opmo in import pitches/chords from midi-file?   
    dear all
     
    is there a quick way to import (or filter) only pitches and chords from a midi-file? if i only use these (nothing else from midi/xml)
     
    thanx for a hint
    andré
  9. Like
    AM got a reaction from JulioHerrlein in import pitches/chords from midi-file?   
    dear all
     
    is there a quick way to import (or filter) only pitches and chords from a midi-file? if i only use these (nothing else from midi/xml)
     
    thanx for a hint
    andré
  10. Like
    AM reacted to JulioHerrlein in Negative Harmony Function   
    Dear All, 
     
    One interesting thing that could be implemented as a function could be a form of generating Negative Harmony.
    In the video below, there are some explanation of what it is and the origin in the Levy book.
    It was a trendy topic due to the Jacob Collier interview. And there are a lot of fun videos making versions of pop tunes using negative harmony.
     
    The way I understand it, it is simply a kind of mapping notes in relation to an axis, like in the figure below.
     

     
    So we need a function that could map a note in any register to another note in the closest register to the first on.
    So, any  C note will be mapped to G, all Db to F#, all D to F, all, Eb to E, all B to Ab, all Bb to A.
     
    It´s also possible to generate other mappings as well.
     
    I think that replace map or substitute map can do the job, but I´m not sure (I will try), but I find interesting to post it here to explore the idea.
     
    All the best,
     
    Julio
     
    It´s kind of funny to sse in this por versions how every is upside down and how you can generate an entirely new song from exactly the same material.
     
     
     
    POP TUNES with negative harmony:
     
     
     
     
     
  11. Like
    AM reacted to Stephane Boussuge in Melody for Flute and Piano   
    Hi,
     
    A short study about some harmonic procedures and unfold set simple usage.
     
       
     
    SB.
     
    Score:
     
    MelodieFlutePiano280819GM.opmo
  12. Like
    AM got a reaction from opmo in play polytempo -> code/examples   
    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
     
    ...some explanations about the piece....
    andré meier - trompete | komposition - modular form
    WWW.ANDREMEIER.ORG  
     
     
    greetings
    andré
     
    Polytempo - Wikipedia
    EN.WIKIPEDIA.ORG  
    ;;; POLYTEMPO-PLAY ;;; with a MAX-patch (from my friend thomas peter) and some OSC-send i can play the same/different midis (up to 30) ;;; in different tempos in parallel - any combination, with precise coordination ;;; also possible: change global velocity (means: change velocity inside midi) ;;; time-delay (start) in ms ;;; 1) OSC-send functions: (defparameter *out-socket* (make-socket :type :datagram)) (defparameter *remote-host* "127.0.0.1") (defparameter *remote-port* 7500) (defun udpsend (&rest args) (let ((message (apply' osc::encode-message args))) (send-to *out-socket* message (length message) :remote-host *remote-host* :remote-port *remote-port*))) ;;; 2) a) put the MAX-player-folder on desktop ;;; b) start midiplayer.maxpat ;;; c) midiplayer: define your output source in [midiout@name "from MAX 1"] ;;; d) the MIDIS must be placed in the midi-folder (inside MAX-player-folder) ;;; 3) generate SCORE (here a nonsense example) (setf omn (make-omn :pitch (setf pitches (filter-repeat 1 (flatten (gen-sort (rnd-air :type :pitch :seed 45) :step 5 :sort '> :seed 123)))) :length (gen-length '(1) 1/32) :velocity (pitch-to-velocity 'p 'mf pitches :type :float) :span :pitch)) (def-score sorted-whitenoise (:title "sorted-whitenoise" :key-signature 'atonal :time-signature '(4 4) :tempo 60 :layout (grand-layout 'inst)) (inst :omn omn :port 0 :channel 1 :sound 'gm :program 'acoustic-grand-piano)) ;;; 4) COMPILE that score into your Max-Player/midi-folder => PATH+NAME!!! (compile-score 'sorted-whitenoise :file "your-path/sorted-whitenoise") ;;; 5) play it by evaluate UPSEND -> some examples ;;; /eplayer / midi-name / tempo-factor / velocity factor / time-delay in ms (udpsend "/eplayer" "sorted-whitenoise" 1.0 0.5 0) ;; originaltempo, velocity 0.5 (udpsend "/eplayer" "sorted-whitenoise" 2.3 1.0 0) ;; (* tempo 2.3) etc... (udpsend "/eplayer" "sorted-whitenoise" 0.375 1.0 2000) ;; (* tempo 0.375 with startdelay 2000ms) (udpsend "/eplayer" "stop") ; you can stop with that ;;; a tempo-relations => 23:17:13:9:3:2 -> a complex example with time-delays ;;; also possible with every and different midis you like (progn (udpsend "/eplayer" "sorted-whitenoise" 2.3 1.0 0) (udpsend "/eplayer" "sorted-whitenoise" 0.3 0.8 0) (udpsend "/eplayer" "sorted-whitenoise" 0.2 0.4 0) (udpsend "/eplayer" "sorted-whitenoise" 1.3 1.0 10000) (udpsend "/eplayer" "sorted-whitenoise" 1.7 0.9 16000) (udpsend "/eplayer" "sorted-whitenoise" 0.9 0.7 20000)) (udpsend "/eplayer" "stop") ; you can stop with that  
     
    Max_Player_19-08-23.zip example.aiff
    goldberg_13_11.aiff example_11_7_5_3_2.aiff
  13. Like
    AM reacted to torstenanders in Opposite of gen-swallow for functions that add notes like length-divide?   
    Do you mean as an option for the function length-divide? That would be great, but my preferred solution would be to have some extra function complementing gen-swallow for added notes -- which then could be called within functions like length-divide -- because that would be a generic solution for all sorts of functions that somehow add notes. The slightly tricky bit would perhaps be for the function to notice which are the new notes, so it should likely get as an input both the original material and the material with the added notes to find out... 
    I would be happy to help sketching such a function...
    One approach might also be if functions adding notes would somehow mark such notes with some custom articulation only used for that purpose, but that would only work for full OMN results, not single parameters (e.g., length-divide supports single length values). An alternative idea would be for functions adding notes to simply specify the positions in the resulting list that they added (with some special notation for nested lists). 
    Anyway, if it would be much more simply to refactor only length-divide and friends, that would be welcome too...
  14. Like
    AM reacted to torstenanders in Opposite of gen-swallow for functions that add notes like length-divide?   
    The function LENGTH-DIVIDE and friends are a useful device for introducing some rhythmic variation to some material. However, when the processed sequence is a full OMN expression (see example below), then the added notes cause all other parameters to shift forward (additional parameters are added at the end by looping). For introducing only a slight variation to some existing material (e.g., motif) these functions are therefore not so useful, because this shift of all parameters to basically "fill" the new added notes with pitches etc. greatly change the varied material for a listener.
    (length-divide 1 2 '(q f3 leg+m1 q ab3 leg e c4 leg bb3 leg ab3 leg g3))  
    Basically, this is the opposite situation of the situation addressed by swallowing. Swallowing (e.g., with GEN-SWALLOW and the swallow argument of many other functions) avoids the shift of parameters like pitch etc. that would result from removing notes and turning them into rests. For addressing the situation above properly we would need something like the opposite of swallowing, some way to fill in parameters like pitch etc. for new notes to avoid shifting existing notes. I hope my explanation makes sense and you can see why something like the opposite of swallowing would be useful for functions that add notes to some input material.
     
    Now, the tricky question is of course, what parameters (pitch etc.) should be added in such cases. Musically useful and common in the classical literature would be, e.g., repeating the parameters (pitch etc.) of the predecessor note (though that might be a bit too simplistic and annoying at times) or somehow interpolating some pitch gap between the previous and next note with a little scale or arpeggio and only repeating the other parameters like articulations (resulting in some variation that is likely most similar to the input material, so it would be good to have that as an option).  If the pitch interval between the two original notes is too small to add some pitch in between for the new now (or as an option in general for variety), it would also be good  to add some ornamentation (e.g., using PITCH-ORNAMENT), but for a close similarity between the original material and the variation it would be best as an option to apply such ornamentation only to the newly added notes, not all notes. Of course, other options could also be useful for variations that vary the input material a bit more strongly, e.g., some random pitch for the new notes within certain interval bounds.
     
    Does some function that kind of is the opposite of GEN-SWALLOW in that it adds parameters like pitches for subdivided rhythmic values (to avoid the shifting) sound like a good idea?
     
    The idea with the interpolation of gaps could be implemented by turning the original duration values and pitches into some envelope and then reading that envelope with the new rhythmic values. So, that is rather strait forward. However, that would not allow for some ornamentation, because such algorithm would not recognise which notes are new that should be ornamented.
     
    Any other idea perhaps? Thanks! 
  15. Like
    AM got a reaction from Stephane Boussuge in conTimbre library + pitchbend   
    dear all
     
    conTimbre-library works (in the next update) perfect with TUNING  (midi-pitchbend) and PAN now. thanx to thomas hummel and janusz!
    here are some simple sound examples...
     
    ct-micro+pan2.aiff
    ct-micro+pan3.aiff
    ct-micro+pan.aiff
    ct-micro+pan4.aiff
  16. Like
    AM got a reaction from opmo in brownian bridges - algorithmic study   
    too much code and too complicated to post - I do not have the time to write a manual.
     
    it's a "machine" that creates multiple "brownian bridges" combined with "pitch-contour" and "add-rnd-dust".  it's an all-in-ONE tool/machine/bot...
     
    I'm interested in repetition/difference in other contexts than traditional ones; but "brownian bridges" then resemble ornaments. when the sequences are short - brownian bridges are "rnd-processes" between 2 fixed points - then you will keep ornamental sequences between this 2 points/pitches...
     
    (I did not work with a score, just coding and listening - it's only sketching/testing, not composing. and all the examples are "rnd-generated"/not-composed by the machine, you could produce more and more...)
     
    some links:
     
    Brownian bridge - Wikipedia
    EN.WIKIPEDIA.ORG  
     
    -> in OPMO
     
  17. Like
    AM got a reaction from JulioHerrlein in brownian bridges - algorithmic study   
    too much code and too complicated to post - I do not have the time to write a manual.
     
    it's a "machine" that creates multiple "brownian bridges" combined with "pitch-contour" and "add-rnd-dust".  it's an all-in-ONE tool/machine/bot...
     
    I'm interested in repetition/difference in other contexts than traditional ones; but "brownian bridges" then resemble ornaments. when the sequences are short - brownian bridges are "rnd-processes" between 2 fixed points - then you will keep ornamental sequences between this 2 points/pitches...
     
    (I did not work with a score, just coding and listening - it's only sketching/testing, not composing. and all the examples are "rnd-generated"/not-composed by the machine, you could produce more and more...)
     
    some links:
     
    Brownian bridge - Wikipedia
    EN.WIKIPEDIA.ORG  
     
    -> in OPMO
     
  18. Thanks
    AM got a reaction from JulioHerrlein in brownian bridges - algorithmic study   
    another example/experiment  - you hear 4 times the same "brownian-phrase"  but mapped on different tonalities...
     
       
     
    untitled.aiff
     
    a) diatonic/major
    b) blues-heptatonic
    c) chromatic
    d) messiaen-modus
     
    greetings
    andré
     
     
     
  19. Like
    AM got a reaction from opmo in brownian bridges - algorithmic study   
    another example/experiment  - you hear 4 times the same "brownian-phrase"  but mapped on different tonalities...
     
       
     
    untitled.aiff
     
    a) diatonic/major
    b) blues-heptatonic
    c) chromatic
    d) messiaen-modus
     
    greetings
    andré
     
     
     
  20. Like
    AM reacted to opmo in Opusmodus 1.3.24902   
    – New function:
    POLYGON-RHYTHM – Generates a symmetrical polygon to a given n-gon.
    – Update:
    LENGTH-WEIGHT – :swallow keyword added.
    LENGTH-REST-SERIES – omn-form and :swallow keyword added.
    LENGTH-TO-REST – omn-form and :swallow keyword added.

    – Documents:
    Howto Score/Rhythm/Polygon Rhythm.opmo 
     
    Note: 
    Select 'Check for Updates...' from Opusmodus app menu to get the latest version.
     
     
    POLYGON-RHYTHM

    This function returns a symmetrical polygon to a given n-gon (sides number) with circle points (denominator) and a given staring point.
    In this example we use 3-gon in a 16 point circle with the starting point 0:
    (polygon-rhythm 3 16 0) => (1/16 -1/16 -1/16 -1/16 1/16 -1/16 -1/16 -1/16     -1/16 -1/16 -1/16 -1/16 1/16 -1/16 -1/16 -1/16)  
    Same as above with :legato t added:
    (polygon-rhythm 3 16 0 :legato t) => (1/4 1/2 1/4)  
    The 3-gon in a 16 point circle with the starting point 0 will produce 7 symmetrical 3-gon’s:
     



     
    Example with start point 5:
    (polygon-rhythm 3 16 5) => (-1/16 -1/16 -1/16 -1/16 -1/16 1/16 -1/16 -1/16     -1/16 -1/16 -1/16 1/16 -1/16 -1/16 -1/16 1/16) (circle-rhythm-plot (polygon-rhythm 3 16 5) :points 16)
     
     
    Examples:
     
    In the following example we create 8 bars of a ‘Drum Set’ rhythm.
    First we assign the ‘GM Percussion’ names to variables:
    (setf bd (read-map *gm-percussion* 'acoustic-bass-drum)) (setf sd (read-map *gm-percussion* 'Acoustic-Snare)) (setf ht (read-map *gm-percussion* 'High-Tom)) (setf hh (read-map *gm-percussion* 'Open-Hi-hat))  
    Next we create 4 polygon rhythms:
    (setf bd-gon (polygon-rhythm 3 16 0 :pitch bd :seed 5)) (setf sd-gon (polygon-rhythm 2 16 1 :pitch sd :seed 45)) (setf ht-gon (polygon-rhythm 2 16 5 :pitch ht :seed 45)) (setf hh-gon (polygon-rhythm 5 16 2 :pitch hh :seed 5))  
    With the CIRCLE-RHYTHM-PLOT function you can visualise how the rhythms are working together:
    (circle-rhythm-plot (list bd-gon sd-gon ht-gon hh-gon) :points 16)
     
    Let’s hear the result above, using PS function and ‘GM Instrument Set’ with a 8 times loop:
    (ps 'gm     :ds-bd (list (gen-eval 8 'bd-gon))     :ds-sd (list (gen-eval 8 'sd-gon))     :ds-ht (list (gen-eval 8 'ht-gon))     :ds-hh (list (gen-eval 8 'hh-gon))     :tempo 120)  
    Same as above but without a seed value:
    (ps 'gm     :ds-bd (list (gen-eval 8 '(polygon-rhythm 3 16 0 :pitch bd)))     :ds-sd (list (gen-eval 8 '(polygon-rhythm 2 16 1 :pitch sd)))     :ds-ht (list (gen-eval 8 '(polygon-rhythm 2 16 5 :pitch ht)))     :ds-hh (list (gen-eval 8 '(polygon-rhythm 5 16 2 :pitch hh)))     :tempo 120)  
    In the next example we add a few more percussion instruments.
    The '? start symbol means the start point is selected at random: 0 to 15.
    (progn   (setf bd (read-map *gm-percussion* 'Acoustic-Bass-Drum))   (setf sd (read-map *gm-percussion* 'Acoustic-Snare))   (setf ht (read-map *gm-percussion* 'High-Tom))   (setf hh (read-map *gm-percussion* 'Open-Hi-hat))   (setf lb (read-map *gm-percussion* 'Low-Bongo))   (setf hb (read-map *gm-percussion* 'High-Bongo))   (setf mhc (read-map *gm-percussion* 'Mute-Hi-Conga))   (setf lc (read-map *gm-percussion* 'Low-Conga))      (ps 'gm       :ds-bd (list (gen-eval 16 '(polygon-rhythm 3 16 0 :pitch bd)))       :ds-sd (list (gen-eval 16 '(polygon-rhythm 2 16 1 :pitch sd)))       :ds-ht (list (gen-eval 16 '(polygon-rhythm 2 16 5 :pitch ht)))       :ds-hh (list (gen-eval 16 '(polygon-rhythm 5 16 2 :pitch hh)))       :rhy (list (gen-eval 16 '(polygon-rhythm 5 16 '? :pitch lb))                  (gen-eval 16 '(polygon-rhythm 4 16 '? :pitch hb))                  (gen-eval 16 '(polygon-rhythm 7 16 '? :pitch mhc))                  (gen-eval 16 '(polygon-rhythm 7 16 '? :pitch lc)))       :tempo 120)   )  
  21. Like
    AM got a reaction from opmo in brownian bridges - algorithmic study   
  22. Like
    AM reacted to Stephane Boussuge in Mapcar Study 1 for small ensemble   
    Here's a short study for a small ensemble.
     
       
     
    All the best !
    SB.
     
    Mapcar1.opmo
     
  23. Thanks
    AM got a reaction from opmo in polygon-rhythm   
    very nice, janusz!! 😎
  24. Like
    AM reacted to opmo in polygon-rhythm   
    The forthcoming POLYGON-RHYTHM function will allow you to think and compose in a clear symmetrical structures. The great amount of keywords (OPMO stile) makes this algorithm very powerful.
     
    This is a short example using POLYGON-RHYTHM exclusively.
    Instruments: VSL Tenor Sax and Jazz Drumset.
     
       
     
  25. Like
    AM reacted to opmo in add-rnd-dust to lengths   
    (defun gen-rnd-dust (sequence &key (span '(0.1)) (quantize '(1 2 3 4 5 6 7 8)) (scale 1.0) (tolerance 0.05) seed)   (let (state)     (setf state *init-seed*)     (setf seed (rnd-seed seed))     (do-verbose ("gen-rnd-dust, span: ~s quantize: ~s scale: ~s tolerance: ~s seed: ~s"                  span quantize scale tolerance seed)       (disassembling-omn ((sequence plist) sequence :length)         (let* ((length sequence)                (sp)                (out (float-to-ratio                      (loop                         with cnt = 0                        for i in length                        do (setf sp (nth cnt span))                        when (> i 0)                         collect (+ i (car (rnd-number 1 0.0 (* i sp) :seed (seed))))                        else collect (- i (car (rnd-number 1 0.0 (* i sp) :seed (seed))))                        when (< cnt (1- (length span)))                        do (incf cnt))                      :ratio 1)))           (init-state state)           (quantize out quantize :scale scale :tolerance tolerance)))))) or (with sublists):
    (defun gen-rnd-dust (sequence &key (span '(0.1)) (quantize '(1 2 3 4 5 6 7 8)) (scale 1.0) (tolerance 0.05) seed) (let (state) (setf state *init-seed*) (setf seed (rnd-seed seed)) (do-verbose ("gen-rnd-dust, span: ~s quantize: ~s scale: ~s tolerance: ~s seed: ~s" span quantize scale tolerance seed) (let ((ts (get-time-signature sequence)) (seq (flatten-omn sequence))) (omn-to-time-signature (disassembling-omn ((seq plist) seq :length) (let* ((length seq) (sp) (out (float-to-ratio (loop with cnt = 0 for i in length do (setf sp (nth cnt span)) when (> i 0) collect (+ i (car (rnd-number 1 0.0 (* i sp) :seed (seed)))) else collect (- i (car (rnd-number 1 0.0 (* i sp) :seed (seed)))) when (< cnt (1- (length span))) do (incf cnt)) :ratio 1))) (init-state state) (quantize out quantize :scale scale :tolerance tolerance))) ts)))))  
    Best,
    Janusz
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy