Jump to content

opmo

Administrators
  • Posts

    2,894
  • Joined

  • Last visited

Everything posted by opmo

  1. Note to all. Please add to your examples the results of the expressions. This will help to understand the idea on the spot :-)
  2. A random sort '? - RND-PICK from ascending and descending result of a sequence. Ascending: (list-plot (flatten (sorting (rnd-number 20 1 10 :seed 2346) :type 'selection :sort '<)) :zero-based t :point-radius 1 :join-points t) Descending: (list-plot (flatten (sorting (rnd-number 20 1 10 :seed 2346) :type 'selection :sort '>)) :zero-based t :point-radius 1 :join-points t) At random: (list-plot (flatten (sorting (rnd-number 20 1 10 :seed 2346) :type 'selection :sort '?)) :zero-based t :point-radius 1 :join-points t) In 5 steps: (list-plot (flatten (sorting (rnd-number 20 1 10 :seed 2346) :type 'selection :sort '? :step 5)) :zero-based t :point-radius 1 :join-points t) The default sort is ascending.
  3. I have added a new keyword :step - number of steps to complete the process. Exp. without step: (list-plot (flatten (sorting (rnd-number 30 1 10 :seed 2346) :type 'selection)) :zero-based t :point-radius 1 :join-points t) Same as above but with 5 steps: (list-plot (flatten (sorting (rnd-number 30 1 10 :seed 2346) :type 'selection :step 5)) :zero-based t :point-radius 1 :join-points t)
  4. Will add the MIN-MAX as well to the SORTING function.
  5. Well done, I could add the SORTING function to our system. The examples are very good as well. Note: If you like to share a workspace with files etc... you simply make a folder (same name as the workspace file) with the workspace and other files. This way the workspace is ready to use. Sorting Algorithms.zip
  6. With the methods from above you can achieve that.
  7. I would use GEN-MORPH for that. Ex. 1 (setf org (rnd-order '(c4 cs4 d4 ds4) :seed 3657)) => (d4 c4 ds4 cs4) (setf sort (sort-asc org)) => (c4 cs4 d4 ds4) (gen-morph (length org) sort org) => ((c4 cs4 d4 ds4) (d4 cs4 d4 ds4) (d4 cs4 ds4 cs4) (d4 c4 ds4 cs4)) (gen-morph 8 sort org) => ((c4 cs4 d4 ds4) (d4 cs4 d4 ds4) (d4 cs4 d4 ds4) (d4 cs4 d4 cs4) (d4 cs4 d4 cs4) (d4 cs4 ds4 cs4) (d4 cs4 ds4 cs4) (d4 c4 ds4 cs4)) Ex.2 (setf noise (gen-white-noise 200 :seed 23)) (setf sort (sort-asc noise)) (gen-morph 8 noise sort)
  8. The score of this piece you will find in the 'Score Examples/Ensembles' folder (ver. 1.2.23227). Thank you Stephane.
  9. As you can see all values staying with in the range: 0.55 and 0.67 Simple test: (setf rh-a-dynamics (gen-eval 8 '(vector-to-velocity 0.55 0.67 (gen-white-noise 5) :type :float) :seed 12)) => ((0.56 0.67 0.55 0.58 0.67) (0.67 0.61 0.65 0.57 0.55) (0.67 0.63 0.55 0.65 0.6) (0.67 0.55 0.58 0.67 0.62) (0.62 0.67 0.57 0.55 0.58) (0.65 0.55 0.67 0.61 0.62) (0.55 0.58 0.67 0.62 0.63) (0.67 0.57 0.55 0.58 0.66))
  10. This way you have control over seed in INIT-SEED if used: (setf rh-a-dynamics (gen-eval 8 '(vector-to-velocity 0.55 0.67 (gen-white-noise 5)) :seed 12))
  11. That would be very complicated. The snippet (section) is rewritten from all kind of selections into DEF-SCORE.
  12. There is an error in your code: the variable dynamics-rh should be dynamic-rh Example: (setf dynamic-rh (vector-to-velocity 0.55 0.62 (gen-white-noise 10 :seed 122) :type :midi)) (setf dynamic-lh (vector-to-velocity 0.33 0.41 (gen-white-noise 10 :seed 67) :type :midi)) (velocity-list-plot (list dynamic-lh dynamic-rh) :point-radius 2)
  13. I think it will help us to work even more freely and this is what we expect from Opusmodus :-) Thank you for the suggestion.
  14. I found a way to display an internal seed if seed is nil (random process). Example without a seed (each time different result): (rnd-number 12 1 10) ? rnd-number :seed 678732 => (10 6 10 6 1 9 5 6 10 2 4 2) Now the same function with a manually "lock" using the :seed (rnd-number 12 1 10 :seed 678732) ? rnd-number :seed 678732 => (10 6 10 6 1 9 5 6 10 2 4 2) (rnd-pick '((q c4 p d4 ff s a4 stacc) (s e4 app q c5 d5 pp))) ? rnd-pick :seed 598336 => (q c4 p d4 ff s a4 stacc) I hope everybody will be happy with the solution :-) To add this functionality to all the functions using random seed will take some time to do. Hopefully tomorrow :-) Best, Janusz
  15. If we use random function without a seed then there is nothing to retrieve because there is no seed of any kind in random pick at any stage.
  16. With snippet: (setf pitch (rnd-sample 5 '(c4 e4 g4 b4) :seed (setf seed (rnd-range 1 999999)))) => (g4 e4 c4 b4 b4) Test: (rnd-sample 5 '(c4 e4 g4 b4) :seed 675029) => (g4 e4 c4 b4 b4) Note: ctrl-3 is not for displaying numbers.
  17. INIT-SEED can be used at the start of algorithmic compositions employing high degrees of randomness in order to create consisted results, without having to worry about supplying seed N values to all the other functions which may also use random generation. Example: (setf init-seed (init-seed (rnd1 :low 1 :high 99999))) init-seed => 3467 This way you can recover the initial seed if needed.
  18. Example: (setf omn '((h. cs3gs2as5cs5cs4as3gs3g3as4gs4g4 f arp) (-e g5d5g4 mp arp fs5ds5fs4 arp-down g5ds5g4 arp-down gs5e5gs4 arp) (-e - a5d5 f c6f5 d5b5 g5d5 gs5ds5 gs5e5) (-e h c6d5cs5g4cs4g3d3 p arp-down))) With omn-form sequence: (metronome omn) => ((q c4 0.8 bb3 0.65 bb3) (e c4 0.8 bb3 0.65 bb3 bb3 bb3) (q c4 0.8 bb3 0.65 bb3 bb3) (e c4 0.8 bb3 0.65 bb3 bb3 bb3)) With time-signature-form sequence: (metronome '((3 4 1) (5 8 2) (4 4 1) (5 8 1))) => ((q c4 0.8 bb3 0.65 bb3) (e c4 0.8 bb3 0.65 bb3 bb3 bb3) (e c4 0.8 bb3 0.65 bb3 bb3 bb3) (q c4 0.8 bb3 0.65 bb3 bb3) (e c4 0.8 bb3 0.65 bb3 bb3 bb3))
  19. I like the easy beats :-) This function works with omn-form sequence and time-signature-form sequence: (defun metronome (sequence &key (pitch 'c4) (velocity 0.8)) (do-verbose ("metronome") (let* ((get-ts (if (omn-formp sequence) (get-time-signature sequence) sequence)) (ts (loop for i in (lists! get-ts) collect (cons (if (listp (first i)) (apply #'+ (first i)) (first i)) (rest i)))) (len (assemble-seq (loop for i in ts collect (if (equal 1 (last1 i)) (gen-repeat (first i) (list (/ 1 (second i)))) (gen-repeat (last1 i) (list (gen-repeat (first i) (list (/ 1 (second i)))))))))) (vel (loop for i in len collect (cons velocity (gen-repeat (1- (length i)) (list (- velocity 0.15)))))) (pch (loop for i in len collect (cons pitch (pitch-transpose -2 (gen-repeat (1- (length i)) pitch)))))) (make-omn :length len :pitch pch :velocity vel))))
  20. This example illustrate how this could be done: (metronome :omn (metronome phrase-lh) :channel 16 :sound 'gm :program 'woodblock) Function: (defun metronome (sequence &key (pitch 'c4) (velocity 'ff)) (let* ((ts (get-time-signature sequence)) (len (loop for i in ts collect (gen-repeat (last1 i) (gen-repeat (car i) (list (/ 1 (second i))))))) (vel (loop for i in ts collect (append (list velocity) (gen-repeat (1- (car i)) (list 'mf)))))) (make-omn :length len :pitch (list pitch) :velocity vel))) (setf sequence '((-h.) (-e g3cs3 mp arp fs3b2 arp-down g3as2 arp-down gs3as2 arp) (-e - fs3c3 f fs3as2 g3cs3 a3as2 gs3c3 gs3cs3) (-q._q))) (metronome sequence) => ((q c4 ff mf c4) (e c4 ff mf c4 c4 c4) (q c4 ff mf c4 c4) (e c4 ff mf c4 c4 c4)) Score example: (setf phrase-rh '((h. cs3gs2as5cs5cs4as3gs3g3as4gs4g4 f arp) (-e g5d5g4 mp arp fs5ds5fs4 arp-down g5ds5g4 arp-down gs5e5gs4 arp) (-e - a5d5 f c6f5 d5b5 g5d5 gs5ds5 gs5e5) (-e h c6d5cs5g4cs4g3d3 p arp-down))) (setf phrase-lh '((-h.) (-e g3cs3 mp arp fs3b2 arp-down g3as2 arp-down gs3as2 arp) (-e - fs3c3 f fs3as2 g3cs3 a3as2 gs3c3 gs3cs3) (-q._q))) (setf ts (get-time-signature phrase-lh)) (def-score arpeggiation-chords-3 (:key-signature 'chromatic :time-signature ts :tempo 60 :layout (harp-grand-layout '(rh lh))) (metronome :omn (metronome phrase-lh) :channel 16 :sound 'gm :program 'woodblock) (rh :omn phrase-rh :channel 1 :sound 'gm :program 'orchestral-harp) (lh :omn phrase-lh) ) I will add the METRONOME function to the next release. JP
  21. To transpose a list of pitches (symbols) we are using PITCH-TRANSPOSE function or others. The best way to see what is possible check the System Function library docs or search the files with the Search system.
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy