Jump to content

Stephane Boussuge

Moderators
  • Posts

    1,070
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Stephane Boussuge reacted to lviklund in Après la pluie Trio   
    I think that it is very important to remember that, at least for me, I am myself my biggest critic. Good of course but also very destructible som times.
     
     
    Yes indeed. Your friend is very wise :-).
     
    Actually in my case I have done in the past a lot of composing even as a pro for many years but for now I just enjoy digging my bits and pieces....
    Taking apart music by f.ex. Bartók with tools like OM and fiddle around with the snippets is very fun and you learn alot.
    Using the sound of the blackbird as a blueprint for my new theme is very educational. The list of what you can do can be made very long.
    The biggest problem is to find the time to do everything that is possible :-).
     
    One more reflection is that when getting older and with better finances it is very easy to buy new gear and software.
    Very fun but also very time consuming, so as said earlier in this thread, you have to make choices and decide on what tools to learn, what should be finished and so on.
     
    /Lasse
  2. Like
    Stephane Boussuge got a reaction from ydepps in Après la pluie Trio   
    Lasse, i write many many unfinished Bits and pieces, and in past almost only that. 
    Long time ago, when speaking with a friend, i said i never finish my piece but i said it was not to important because it was only training, but this friend reply: i understand but finishing a piece is also a training and finishing a piece is a different training than starting a piece....
    From this day and discussion with that friend, i have started to finish some of my pieces :-)
     
    SB.
  3. Like
    Stephane Boussuge got a reaction from lviklund in Après la pluie Trio   
    Hi,
    here's a new score, Après la pluie, scored for a friends trio.

     
    Opusmodus score and Notation file score attached to this post.
     
    SB.
     
    ApresLaPluieTrio - Partition et parties.pdf
    ApresLaPluieTrio.opmo
  4. Like
    Stephane Boussuge got a reaction from lviklund in Après la pluie Trio   
    Hi Rangarajan,
     
    when composing, i always start in Opusmodus and do almost all in Opusmodus.
    I use Score editor only in the very final phase of composition.
    Because for me, the Opusmodus script is the Sketch of the piece and also the final piece. It is a bit like a stone in the hand of a sculptor, i start with an idea (rhythm, harmony, atmosphere, whatever...) and the vision of the piece emerge globally in my head and i try to render it in the Opusmodus script when writing the code by iterative successive refinement and more and more fine definition of what i want to hear and how to render it in a repeated loop between my imagination and the score script and Opusmodus output. But i need to precise what i often try to do with Opusmodus script is to define a musical relation between events and not necessary a fixed piece of music. For me the scipt is a model of my musical thinking and the script help me to output different instances of this thinking.
     
    I think it is a training, typical from music composition (i suppose..), to have some idea and to learn how to develop this ideas and how to put this ideas and developments side to side in a global and coherent way in a full vision of the global form of the piece.
     
    In my case, it took many years to gain this capability but Opusmodus can help a lot in the music composition knowledge acquisition process with his fast feedback loop between the user and the software.
     
    For my part, i am not a good programmer, more a musician but i'm trying to progress in Lisp.
    By the way, i have some question to ask to you about the Midi importation techniques in Opmo because your article on your blog was very interesting but it is not the place for this subject, it is another thread and i will write about it in the correct place 😉
     
    Best regards
     
    Stéphane
  5. Like
    Stephane Boussuge reacted to Rangarajan in Enhancing the permute function   
    Your implementation of permute is very nice. I looked at a few implementations on the net, but they do not handle duplicate elements correctly, whereas your implementation seems correct.
     
    I would like to propose two enhancements to this function:
    1) Sometimes, I might not require all permutations of a list, but only some N, where N < the maximum possible size. For example, with 4 distinct elements, 24 is the max possible, but I might just require 6. To handle this case, we can have a keyword argument to limit the size.
     
    (permute '( 1 2 3 4) :limit 6) => Returns only 6 elements, not 24. Order is not guaranteed.
     
    2) This is a bit tricky. Instead of restricting the number of elements explicitly as in (1), I might want to filter the elements based on some constraint. Here is a scenario:
     
    (constrained-permute '(1 2 3 4) #'(lambda (e) (if (< (first e) (second e)) e nil)))
     
    This will generate only those sequences where the first element of the list is less than the second element (just a hypothetical example).
     
    Here is one way to implement this:
    (defun constrained-permute (alist constraint)
      (filter-remove nil (mapcar constraint (permute alist))))
     
    The problem with this is it is costly. It filters after generation. It will be better to apply the filter as part of the generation itself. To support this, we can add another keyword argument to permute:
     
    (permute '(1 2 3 4) :filter #'(lambda (e) (if (< (first e) (second e)) e nil)))
     
    Of course, we can also specify the limit if we want:
     
    (permute '(1 2 3 4) :limit 6 :filter #'(lambda (e) (if (< (first e) (second e)) e nil)))
     
    Do you think this makes sense?
     
    Regards,
    Rangarajan
  6. Like
    Stephane Boussuge got a reaction from opmo in Reading and Transforming a MIDI File   
    Hi Rangarajan,
    thank you for your kind proposition.
     
    What i want basicaly is to serialize them (i.e., write each to a separate file).
    But a would love also to be able to write them directly in Library files for algorithmic access to this material.
    Imagine the creation of Library of piano accompaniment figures, strings ostinato etc... directly extracted from midi file and called in score script by the function Library....
     
    i am ok to use this forum if you agree because this information could be useful for other users too and i think sharing and knowledge exchange is good.
     
    Regards
    Stéphane
     
  7. Like
    Stephane Boussuge reacted to Rangarajan in Reading and Transforming a MIDI File   
    Friends,
    Time for yet another blog post! This week I have described a technique that you can use to read a MIDI file and then transform the corresponding score.
     
    I personally think that Opusmodus could introduce many interesting functions for working with MIDI files, not just for transforming as explained in my blog, but also for analyzing the score.
     
    Hope you find this article interesting.
     
    Regards,
    Rangarajan   
  8. Like
    Stephane Boussuge got a reaction from opmo in Après la pluie Trio   
    Hi,
    here's a new score, Après la pluie, scored for a friends trio.

     
    Opusmodus score and Notation file score attached to this post.
     
    SB.
     
    ApresLaPluieTrio - Partition et parties.pdf
    ApresLaPluieTrio.opmo
  9. Like
    Stephane Boussuge reacted to AM in gen-hoquetus   
    ;; gen-hoquetus.4 https://en.wikipedia.org/wiki/Hocket ;;; andré meier / 27-4-2016 ;;; write a instrumentation-list (instrument + techniques + velocity), pitch-list ;;; and length-list. the gen-hoquetus-function will split the melody ;;; off... in any possibilities, techniques/articulations/velocities will be added ;;; this is only a function i coded for my actual work... perhaps you could use ;;; it or code it properly :-) ;;; HAVE FUN! regards, andré (setq instrumentation '(((pno ponte ppp)) ((vn pizz p)) ((vn pizz f) (va ponte f)) ((pno tasto ff)) ((pno pizz fff)) ((vn tasto mf) (pno ord ff) (vc tasto mf) (trp ord pp)) ((trp mute pp) (vn ponte mf)))) ;; mainfuction: (defun gen-hoquetus.4 (filtered-instrument &key pitch length instrument-list) (let ((events (generate-events.4 length pitch :optional_data instrument-list))) (filtering-color.4 filtered-instrument events))) (gen-hoquetus.4 'vn :pitch '(c4 d4 e5 f6) :length '(1/32 2/32 3/32 4/32) :instrument-list instrumentation) ;; subfunctions (defun generate-events.4 (durations pitches &key (velocity '(mf)) (articulation '(-)) (optional_data 'nil)) (loop repeat (length durations) with cnt-d = 0 with cnt-rest = 0 when (> (nth cnt-d durations) 0) collect (list (nth cnt-d durations) (nth cnt-rest pitches) (nth cnt-rest velocity) (nth cnt-rest articulation) (nth cnt-rest optional_data)) and do (incf cnt-rest) and do (incf cnt-d) else collect (list (nth cnt-d durations) 'nil 'nil 'nil 'nil) and do (incf cnt-d))) (generate-events.4 '(1 2 -3 4) '(60 61 62) :optional_data instrumentation) (defun filtering-color.4 (selected-color event-stream) (loop for i in event-stream with match = 0 append (loop for x in (fifth i) when (equal (first x) selected-color) do (setq articulation (second x) velocity (third x)) and do (setq match 1)) when (and (= match 1) (> (first i) 0)) append (list (first i) (second i) velocity articulation) else collect (* -1 (abs (first i))) do (setq match 0))) (filtering-color.4 'vn (generate-events.4 (gen-length '(1 -100 2 3 4 5) 1/32) '(c4 d4 e4 e5) :optional_data instrumentation)) ;; OMN_EXAMPLE: (setq pitches (midi-to-pitch '(60 61 62 63 64 65 66 67 68 69 70))) ; only an example (setq lengths (gen-length '(1 2 3 -4 5 6 5 -4 3 -2 1) 1/16)) ; only an example (setq instrumentation (loop repeat 10 collect (rnd-pick '(((pno ponte ppp)) ; only an example ((vn pizz p)) ((vn pizz f) (va ponte f)) ((pno tasto ff)) ((pno pizz fff)) ((vn tasto mf) (pno ord ff) (vc tasto mf) (trp ord pp)) ((trp mute pp) (vn ponte mf)))))) (def-score hoquetus.4 (:key-signature '(c maj) :time-signature '(4 4) :tempo '(120) :layout (bracket-group (trumpet-layout 'trumpet) (piano-grand-layout 'piano) (violin-layout 'violin) (viola-layout 'viola) (violoncello-layout 'violoncello))) (trumpet :omn (gen-hoquetus.4 'trp :pitch pitches :length lengths :instrument-list instrumentation) :channel 1) (piano :omn (gen-hoquetus.4 'pno :pitch pitches :length lengths :instrument-list instrumentation) :channel 1) (violin :omn (gen-hoquetus.4 'vn :pitch pitches :length lengths :instrument-list instrumentation) :channel 1) (viola :omn (gen-hoquetus.4 'va :pitch pitches :length lengths :instrument-list instrumentation) :channel 1) (violoncello :omn (gen-hoquetus.4 'vc :pitch pitches :length lengths :instrument-list instrumentation) :channel 1))  
  10. Like
    Stephane Boussuge got a reaction from RST in Many Strings 1 and 2 for two 18 strings (virtual) guitars   
    Hi,
     
    here's 2 piece from the same algorithm slightly modified for the second version.

     
    SB.
  11. Like
    Stephane Boussuge reacted to opmo in articulations in OMN   
    Please send me a list of articulation and technique names you would like to add to the system.
    I will see what I can do :-)
  12. Like
    Stephane Boussuge got a reaction from Lance Massey in Use a database, or wrong thinking?   
    Hi,
     
    you can use all the Opusmodus Library functions  to store and retrieve material like phrases, motives, chords, scales and full part of song you have imported from midi.
    In library, you can put this material in sections, named for example: dark, clear, joyful etc... and call this material with rules and structures.
     
    Try the demo version of Opusmodus and have a look to the Library functions and associates.
     
    SB.
  13. Like
    Stephane Boussuge reacted to Wim Dijkgraaf in Beginner: Slonimsky 648 as a function   
    This is a great learning experience. Both SB and AM thank you so much!!!!
     
    Worked on page 90 of Slonimsky's book to further discover what can be done with make-scale and came up with the following:
     
    ;; Slonimsky 648
    (make-scale 'c4  14 :alt '(13 -11) :type :pal)
     
    ;; Slonimsky 649
    (make-scale 'c4  14 :alt '(13 13 -11 -11) :type :pal)
     
    ;; Slonimsky 650
    (make-scale 'c4  13 :alt '(13 13 13 -11 -11 -11) :type :pal)
     
    ;; Slonimsky 651
    (make-scale 'c4  13 :alt '(1 13 -11) :type :pal)
     
    ;; Slonimsky 652
    (make-scale 'c4  13 :alt '(13 -11 1) :type :pal)
     
    ;; Slonimsky 653
    (make-scale 'c4  13 :alt '(13 1 -11) :type :pal)
     
    ;; Slonimsky 654
    (make-scale 'c4  13 :alt '(1 1 13 1 1 -11) :type :pal)
     
    ;; Slonimsky 655
    (make-scale 'c2  13 :alt '(11 -1 11 -1) :type :pal)
     
    ;; Slonimsky 656 - has mismatch with original -> to be checked why
    (make-scale 'c2  14 :alt '(11 11 -13 11) :type :pal)
     
    ;; Slonimsky 657 - has mismatch with original -> to be checked why
    (make-scale 'c2  14 :alt '(11 11 11 11 -13 -13 -13) :type :pal)
     
    It makes my day :-)
     
    Wim Dijkgraaf
  14. Like
    Stephane Boussuge reacted to Rangarajan in Beginner: Slonimsky 648 as a function   
    WOW, SB!
     
    -Rangarajan
  15. Like
    Stephane Boussuge reacted to AM in Doubt about motif-map function   
    short question (i didn't read the whole documentation)... when i use/work with pattern-matching, i've done it with WILDCARDS ... is there any aspect of that in the motif-map function? or is a "ordinary pattern-matching-function" in OM?
     
    like that: pattern to search/replace 
    '(0 1 ? 3)  
    this is musically interesting, because it works with "fuzziness"....
     
    regards,
    andré
     
     
  16. Like
    Stephane Boussuge reacted to AM in Doubt about motif-map function   
    dear rangarajan
     
    i think the motif-map-function has a PATTERN-MATCH inside, but it "replaces the MATCH", (like in a contextual-rewrite), but perhaps i don't use the name/expression "pattern-match" in a wright/correct way... i'm more composer/musician then programmer :-)

    here's a very basic example for am SIMPLE/PURE PATTERN MATCH:
    a rnd-gen-value-list (to show how you could use it), with a PATTERN-MATCH-prog who scans it. 
    the next value - after a complete match - will be changed into a rest... but you also could start a sub-function then who do what ever you want...? (when you change the code)
     
    in a concrete project i coded it also in a more complex way - kind of "nontrivial-machines" (as an experiment) -> PATTERNmatch in pitches changes the DURATIONS, PATTERNmatch in durations changes pitches or timbre... and so on... like a "dynamic-interaction-network"...
     
    sorry for my bad english...
    regards
    andré
     
    FUNCTION - FOR A SIMPLE EXAMPLE
    (defun pattern_cogn (liste pattern)    (loop for z in liste     with cnt = 0     with pattern_cnt = 0        collect z             ;;;check a value - if it's a match -> incf counter     when (or (eq  (nth cnt pattern) z)  (eq '? (nth cnt pattern)))     do (incf pattern_cnt)     and do (incf cnt)     else do (setq cnt (setq pattern_cnt 0))          ;;; if the pattern is MATCHED (=> counter = length pattern)  -> the output changes ... for example, the next value will be a rest     ;;; = consequence     when (eq pattern_cnt (length pattern))     collect (* z -1)     and do (setq cnt (setq pattern_cnt 0))))  
    FUNCTION-EVAL
    (pattern_cogn (loop repeat 100                 collect (1+ (random 5))) ; generates rnd-values ->  TO SEARCH IN IT               '(4 ? 2)) ; pattern to search (here with wildcard)  
    WHEN PATTERN MATCH THEN NEXT VALUE (* -1)
  17. Like
    Stephane Boussuge reacted to opmo in Motifs and Transformations   
    I truly like the concept of build-from-transforms function. Maybe we could add something like that to our system. 
  18. Like
    Stephane Boussuge got a reaction from opmo in A possible motivic lengths approach to articulation generation   
    here's a small exemple of using motif-map function for the particular case of legato slurs:
     
    (setf len '((e e e e q -q e e)(q e e q s s s s e -e))) (setf art (motif-map '(((e e e e) (leg leg leg -)) ((e e) (leg -)) ((s s s s) (leg leg leg -)) ) len :otherwise '- :swallow t)) (setf phrase (make-omn :pitch (rnd-sample 24 (make-scale 'a3 18)) :length len :articulation art ))
  19. Like
    Stephane Boussuge got a reaction from lviklund in A possible motivic lengths approach to articulation generation   
    Sometimes we generate some flow of pitch and lengths that we assemble later into OMN material,

    It can be tiedous to add manually the articulations particularly the "leg" omn instruction,
     and it can sometimes be useful to have a technique for automated implementation
    of part of these task, who it will be always possible to edit more precisely thereafter. 
    Below a possible technique based on the recognition and association of patterns of lengths values with articulation instructions.
     
    At first, we define a stream of lengths for our phrase:
    (setf len '(1/8 1/8 1/16 1/16 -1/16 1/8 1/8 1/8 1/8)) and we generate with the help of the function substitute-motif some articulations based on motivic lengths patterns.
    The substitute-motif will search for motives and will replace this motives by other (in that case, replace by motives of articulation instructions)
    If the function doesn't find some corresponding motives, it will use the :otherwise clause.
    (setf artic (substitute-motif '((1/8 1/8)(1/16))                               '((leg -)(stacc))                               len                               :otherwise '-)) ;=> (leg - stacc stacc - leg - leg -) We have to process this output now with the function gen-swallow for "swallow" the item corresponding to rest values.
    (setf artic.swallow (gen-swallow len artic)) => (leg - stacc stacc leg - leg -) Finally, we assemble all the parameters into an OMN stream with the make-omn function:
    (setf omn (make-omn             :pitch '((c4 d4 e4 f4 g4))             :length len             :velocity '((f))             :articulation artic.swallow))
    Here's a complementary score example:
    ;;; Length defintion based on euclidean algorithm (setf basery (euclidean-rhythm (rnd-sample                                 16                                 '(16 18 24))                                4 16 '1/16                                :type 2)) ;;; Apply the search and substitute process on each of the sublists ;;; with mapcar function (setf artic (mapcar              (lambda(x)                (substitute-motif                  '((1/16 1/16 1/16 1/16)(1/16 1/16 1/16)(1/16 1/16)(1/8 1/8)                   (1/4)(1/8)                   ) ;old                 '((leg leg leg -)(- - -)(leg -)(leg -)                   (stacc)(stacc)                   ) ;new                 x                 :otherwise '-                 ))              basery)) ;;;Cleaning with gen-swallow (setf artic.swa (gen-swallow basery artic)) ;;; Pitch generation based on white noise (setf pch (vector-to-pitch '(g3 c5) (gen-white-noise 64))) ;;; Parameters assembly (setf p1.omn (make-omn               :pitch pch               :length basery               :velocity '((f))               :articulation artic.swa               )) ;;; Get the times signatures  (setf ts (get-time-signature p1.omn)) ;;; Score definition (def-score solo            (             :title "solo"             :composer "S.Boussuge"                    :key-signature 'chromatic             :time-signature ts             :tempo 108             :layout (violin-layout 'violon)             ) (violon :omn p1.omn :channel 1 :sound 'gm :program 'violin) ) 
     
    SB.
  20. Like
    Stephane Boussuge reacted to Dago in Font And Colors   
    Hello,
     
    I would like to set the color of the normal font to white or green so I can use a black background and have a night hacking modus.
    Is that possible ?
    The preferences show only color adjustment for special symbols.
     
    Kind Regards,
     
    Dago Sondervan
  21. Like
    Stephane Boussuge got a reaction from opmo in A possible motivic lengths approach to articulation generation   
    Sometimes we generate some flow of pitch and lengths that we assemble later into OMN material,

    It can be tiedous to add manually the articulations particularly the "leg" omn instruction,
     and it can sometimes be useful to have a technique for automated implementation
    of part of these task, who it will be always possible to edit more precisely thereafter. 
    Below a possible technique based on the recognition and association of patterns of lengths values with articulation instructions.
     
    At first, we define a stream of lengths for our phrase:
    (setf len '(1/8 1/8 1/16 1/16 -1/16 1/8 1/8 1/8 1/8)) and we generate with the help of the function substitute-motif some articulations based on motivic lengths patterns.
    The substitute-motif will search for motives and will replace this motives by other (in that case, replace by motives of articulation instructions)
    If the function doesn't find some corresponding motives, it will use the :otherwise clause.
    (setf artic (substitute-motif '((1/8 1/8)(1/16))                               '((leg -)(stacc))                               len                               :otherwise '-)) ;=> (leg - stacc stacc - leg - leg -) We have to process this output now with the function gen-swallow for "swallow" the item corresponding to rest values.
    (setf artic.swallow (gen-swallow len artic)) => (leg - stacc stacc leg - leg -) Finally, we assemble all the parameters into an OMN stream with the make-omn function:
    (setf omn (make-omn             :pitch '((c4 d4 e4 f4 g4))             :length len             :velocity '((f))             :articulation artic.swallow))
    Here's a complementary score example:
    ;;; Length defintion based on euclidean algorithm (setf basery (euclidean-rhythm (rnd-sample                                 16                                 '(16 18 24))                                4 16 '1/16                                :type 2)) ;;; Apply the search and substitute process on each of the sublists ;;; with mapcar function (setf artic (mapcar              (lambda(x)                (substitute-motif                  '((1/16 1/16 1/16 1/16)(1/16 1/16 1/16)(1/16 1/16)(1/8 1/8)                   (1/4)(1/8)                   ) ;old                 '((leg leg leg -)(- - -)(leg -)(leg -)                   (stacc)(stacc)                   ) ;new                 x                 :otherwise '-                 ))              basery)) ;;;Cleaning with gen-swallow (setf artic.swa (gen-swallow basery artic)) ;;; Pitch generation based on white noise (setf pch (vector-to-pitch '(g3 c5) (gen-white-noise 64))) ;;; Parameters assembly (setf p1.omn (make-omn               :pitch pch               :length basery               :velocity '((f))               :articulation artic.swa               )) ;;; Get the times signatures  (setf ts (get-time-signature p1.omn)) ;;; Score definition (def-score solo            (             :title "solo"             :composer "S.Boussuge"                    :key-signature 'chromatic             :time-signature ts             :tempo 108             :layout (violin-layout 'violon)             ) (violon :omn p1.omn :channel 1 :sound 'gm :program 'violin) ) 
     
    SB.
  22. Like
    Stephane Boussuge reacted to opmo in The IF* macro used in Allegro   
    Opusmodus 1.1.1.8740
    New macro IF* added to Opusmodus system.
     
    The IF* (public domain) macro used in Allegro:
    if* Arguments: (test-form {then then-form+ | thenret} {elseif else-test-form {then else-then-form+ | thenret}}* [else else-form+]) This form consists of a series of clauses introduced by the symbols then, elseif, else, and thenret. First the predicate test-form is evaluated. If it is true, the then-forms are evaluated, and the value of the last such form is returned. If test-form evaluates to nil, any remaining clauses are processed. If no clauses remain, if* returns nil. When a thenret clause is encountered no further evaluation takes place, and the value of the most recently evaluated test-form is returned. When an elseif clause is encountered, the predicate else-test-form is evaluated. If it is true, the else-then-forms are evaluated, and the value of the last such form is returned; otherwise any remaining clauses are processed. If no clauses remain, if* returns nil. And lastly, when an else clause is encountered, the else-forms are evaluated, and the value of the last such form is returned. Examples ;; The basic format of a IF* expression is: ;; ;; (if* [test] then [do this 1] [do this 2] else [do other 1] [do other 2]) ;; ;; When [test] is true, the forms after the THEN are evaluated and the ;; result of the last returned; if [test] if false, the forms after the ;; ELSE are evaluated and the result of the last is returned. ;; So: (if* (> 3 2) then "three is bigger" 3 else "three is smaller" 2) => 3 ;; Your do not need an ELSE form: (if* (> 3 2) then "three is bigger" 3) => 3 (if* (> 2 3) then "two is bigger" 2) => nil ;; You can have multiple fors after THEN or ELSE: (defun foo (x) (if* x then (setq y 2) (print x) else (setq y -2) "no")) (foo 2) => 2 (foo "hello") => "hello" "hello" (foo nil) => "no" ;; There are two more special symbols: THENRET and ELSEIF. ;; THENRET says when the test is true just return the value of the test ;; form just evaluated: (if* (+ 4 5) thenret) => 9 ;; ELSEIF introduces a new test, so you can have compound tests: (setq score 77) (if* (< score 60) then "F" elseif (< score 70) then "D" elseif (< score 80) then "C" elseif (< score 90) then "B" else "A") => "C" (setq score 55) (if* (< score 60) then "F" elseif (< score 70) then "D" elseif (< score 80) then "C" elseif (< score 90) then "B" else "A") => "F" (setq score 92) (if* (< score 60) then "F" elseif (< score 70) then "D" elseif (< score 80) then "C" elseif (< score 90) then "B" else "A") => "A"  
  23. Like
    Stephane Boussuge reacted to opmo in Rhythmically Odd Rhythms   
    Done. The final function:
     
    ;; ------------------------------------------------------------------------- ;; gen-binary-series ;; ------------------------------------------------------------------------- (defun gen-binary-series (size number level &key rotate variant seed) (do-verbose ("gen-binary-series") (rnd-seed seed) (flet ((binary-series (size number level &key rotate) (let* ((binary (reverse (binary-level number level))) (out (gen-trim* size binary))) (if rotate (gen-rotate rotate out) out)))) (let* ((size (list! size)) (number (list! number)) (level (list! level)) (len (find-max (mapcar 'length (list size number level)))) (series (mapcar #'(lambda (a b c d) (binary-series a b c :rotate d)) (gen-trim* len size) (gen-trim* len number) (gen-trim* len level) (gen-trim* len (list! rotate)))) (out (if (and (listsp series) (< 1 (length series))) series (car series)))) (if variant (binary-variant out variant :seed (seed)) out))))) (gen-binary-series 24 1 2) => (1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0) (gen-binary-series 24 1 '(3 2 4)) => ((1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0) (1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0) (1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0)) (gen-binary-series 24 '(1 3 4) '(3 5 4) :rotate -2) => ((0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0) (0 0 0 1 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1 0 0 1 1) (1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0)) (gen-binary-series '(8 12 16) '(1 3 4) '(3 5 4) :rotate '(1 -1 0)) => ((0 1 0 0 1 0 0 1) (1 0 0 0 1 1 0 0 0 1 1 1) (0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0)) (gen-binary-series '(8 12 16) '(1 3 4) '(3 5 4) :rotate '(1 -1 0) :variant '? :seed 786) => ((0 1 0 0 1 0 0 1) (1 0 0 0 1 1 0 0 0 1 1 1) (1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1)) (gen-binary-series '(8 12 16) '(1 3 4) '(3 5 4) :rotate '(1 -1 0) :variant '(? r ri) :seed 786) => ((0 1 0 0 1 0 0 1) (1 1 1 0 0 0 1 1 0 0 0 1) (1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1)) Added variant as well.
  24. Like
    Stephane Boussuge reacted to opmo in Opusmodus 1.1.18694   
    New:
     
    rnd-12tone-form n row &key type seed
     
    [Function]
     
    Arguments and Values:
     
    n                 an integer (number of forms).
    row               a 12-tone row.
    type                                 :integer or :pitch. The default is :integer.
    seed                                 NIL or an integer. The default is NIL.
     
    Description:
     
    This function returns N lists of 12-tone forms selected at random.
     
    (rnd-12tone-form 2 '(0 4 9 10 5 3 8 7 1 2 11 6) :seed 56)
    => ((6 1 10 11 5 4 9 7 2 3 8 0) (8 3 0 1 7 6 11 9 4 5 10 2))
     
    (rnd-12tone-form 2 '(0 4 9 10 5 3 8 7 1 2 11 6) :type :pitch :seed 56)
    => ((fs4 cs4 bb4 b4 f4 e4 a4 g4 d4 eb4 gs4 c4)
        (gs4 eb4 c4 cs4 g4 fs4 b4 a4 e4 f4 bb4 d4))
     
    Example:
     
    ;;;---------------------------------------------------------
    ;;; SCORE EXAMPLE
    ;;;---------------------------------------------------------
     
    (progn
      (setf forms (rnd-12tone-form 24 (rnd-row :transpose 6)))
      (setf pitch (integer-to-pitch forms))
      (setf mat (gen-chord2 200 (rnd-sample 12 '(1 2)) (flatten pitch)))
     
      (setf vel (substitute-map '(ppp ppp pp pp p p f f ff ff fff fff)
                                '(0 1 2 3 4 5 6 7 8 9 10 11) forms))
      
      (setf fib (rnd-sample 16 (fibonacci 10 18)))
      (setf l1 (binary-rhythm '(16 20 32) fib '(1/16 1/20 1/32)
                              :type (rnd-sample 12 '(1 2))
                              :rotate (rnd-sample 12 '(0 1 -1 2 -2))))
      
      (setf l2 (binary-rhythm '(28 16 12) fib '(1/28 1/16 1/12)
                              :type (rnd-sample 12 '(1 2 3))
                              :rotate (rnd-sample 12 '(0 1 -1 2 -2))))
      
      (setf cd-p (distribute-seq mat l1 l2))
      (setf cd-v (distribute-seq vel l1 l2))
      (setf p1 (randomize-octaves 'piano (1~ cd-p)))
      (setf p2 (randomize-octaves 'piano (2~ cd-p)))
      (setf v1 (1~ cd-v))
      (setf v2 (2~ cd-v))
      (setf in1 (make-omn :length l1 :pitch p1 :velocity v1))
      (setf in2 (make-omn :length l2 :pitch p2 :velocity v2))
      (setf tempo (gen-tempo '(32 88 72 56 96) '(1) l1 :beat 1/1))
      
      (def-score form-dist
                 (:title "Form Distribution"
                  :copyright "(c) 2016 Opusmodus"
                  :composer "OPMO"
                  :key-signature 'chromatic
                  :time-signature '(8 8)
                  :tempo tempo
                  :layout (grand-layout '(in1 in2)))
        
        (in1 :omn in1 :channel 1 :sound 'gm :program 0)
        (in2 :omn in2 :channel 2 :sound 'gm :program 0)
        )
      )
     
     
    ---------------------------------------------------------
     
     
    get—12tone-form row form &key type
     
    [Function]
     
    Arguments and Values:
     
    row               a 12-tone row.
    form                            a form or list of forms.
    type                           :integer or :pitch. The default is :integer.
     
    Description:
     
    The function GET-12TONE-FORM returns 12-tone row of a given form.
     
    Forms:
    Prime:                            P  0-11
    Inversion:                      I  0-11
    Retrograde:                    R  0-11
    Retrograde Inversion:    RI 0-11
     
    (get-12tone-form '(0 4 9 10 5 3 8 7 1 2 11 6) 'r7)
    => (1 6 9 8 2 3 10 0 5 4 11 7)
     
    (get-12tone-form '(0 4 9 10 5 3 8 7 1 2 11 6) 'r7 :type :pitch)
    => (cs4 fs4 a4 gs4 d4 eb4 bb4 c4 f4 e4 b4 g4)
     
    Example:
     
    (get-12tone-form '(0 4 9 10 5 3 8 7 1 2 11 6) '(r5 p4 ri3))
    => ((11 4 7 6 0 1 8 10 3 2 9 5)
        (4 8 1 2 9 7 0 11 5 6 3 10)
        (9 4 1 2 8 7 0 10 5 6 11 3))
     
    (get-12tone-form (rnd-row) '(p0 r9 i3 ri5))
    => ((0 9 5 4 2 3 7 10 11 6 1 8)
        (5 10 3 8 7 4 0 11 1 2 6 9)
        (3 6 10 11 1 0 8 5 4 9 2 7)
        (9 4 11 6 7 10 2 3 1 0 8 5))
     
     
    ---------------------------------------------------------
     
    Renamed functions:
    CONSECUTIVE-DISTRIBUTE -> DISTRIBUTE-SEQ
    CONSECUTIVE-COLLECT -> COLLECT-SEQ
     
    And minor bug fixes.
    JP
  25. Like
    Stephane Boussuge got a reaction from hujairi in Orchestral Section maker template   
    Hi,
     
    Attached to this post, you will find an Orchestral template based on the Opusmodus Orchestra Romantic Template.
    This template is made with some ready to use configuration and parameters, i.e.; you can start to use it immediately for your own composition, just change the parameters, tweak them, explore and experiment.
     
    I made this template for help the people who start with Opusmodus and want to have immediate fun with it and want to learn by hacking more than by coding ;-)
     
    You also will find attached a possible raw audio example of a possible basic output of the template used in his most basic form (just evaluated and play).
    SB.
     
    ExampleOrchestralSectionMakerTemplate.mp3
    OrchlRmtcSectionMk.opmo
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy