Posted March 11, 20214 yr Dear All,  I found a very interesting way to use the span function to my purposes of controlling the harmonic rhythm of my composition. But I need some help.  Here is one example:  I set pitch lists for each voice of my quartet. Here is an example of how the material is organized for each voice. Each voice for each chord is broken in 16 repeated notes and another 16 notes with some custom made melodic material.  The example below corresponds to TWO chords of the harmony.  PITCH MATERIAL LISTS The first 16 notes are repeating and the next 16 notes are melodic figures of the same harmony. This is done for all the chords of the composition  (setf pitmat '( ;;;first chord material ;16 note repetitions (ab4 ab4 ab4 ab4 ab4 ab4 ab4 ab4 ab4 ab4 ab4 ab4 ab4 ab4 ab4 ab4) ;plus 16 notes of melodic figuration over this first chord (that can be customized to my taste) (b4 e4 gs4 a4 b4 e4 gs4 a4 b4 e4 gs4 a4 b4 e4 gs4 a4) ;;;second chord material ;16 note repeats (bb4 bb4 bb4 bb4 bb4 bb4 bb4 bb4 bb4 bb4 bb4 bb4 bb4 bb4 bb4 bb4) ;+ 16 notes of melodic figuration (eb5 g4 bb4 gs4 eb5 g4 bb4 gs4 eb5 g4 bb4 gs4 eb5 g4 bb4 gs4))) ;;; and so on, for each chord  RHYTHM  The rhythm is organized and divided in lists that are used in the span method of the make-omn to skip between: a) the lists with repeated notes and b) the lists with melodic figuration. LIKE THIS  (setf rv1 (gen-divide '(5 4) (gen-repeat 1 '(-e q. s s e s s s s))))  In this way I can choose: a) To use chords as repeated notes with the first division of the rhythm, and/or b) to skip to the second reservoir of notes, for melodic ornamentation.  This provides a very flexible and musical way to go ! Marvellous...  This means that the gen-divide of the rhythm lists are a form of selecting betwen the lists: every division of the rhythm lists (parenthesis) is used to forward to the next pitch list (or next chord of the harmony control). This maintain the coherence of harmony.  So, I use the divisions of the rhythm lists to alternate between the lists using the span functions, like this.  (setf rv1 (gen-divide '(5 4) (gen-repeat 5 '(-e q. s s e s s s s)))) (make-omn       :length rv1       :pitch (span rv1 pitmat)       :span :length) It works like a wonder, like this: ((-1/8 3/8 1/16 1/16 1/8)    (1/16 1/16 1/16 1/16)) ;;; This rhythm with the    ;; And this with the ;;; note repeats of the list  ;; melodic figurations The PROBLEM IS :  As I said before, each chord of the harmony (pitmat) is comprised of TWO lists First list is a list of 16 note repeats '((ab4 ab4 ab4 ab4 ab4 ab4 ab4 ab4 ab4 ab4 ab4 ab4 ab4 ab4 ab4 ab4) the next list and 16 notes of melodic figuration (b4 e4 gs4 a4 b4 e4 gs4 a4 b4 e4 gs4 a4 b4 e4 gs4 a4)) This is done for each chord. Each chord have a 32 pitch items (two lists of 16).  OK, BUT...  Sometimes, I want to use just ONE note of the chord repeating list and ZERO notes for the melodic figuration (i.e., no figuration). In this case I miss one skip of the list... Using ZERO notes will not skip for the next chord that begins with the next 16 items of repeating notes. In this way, my harmony will go out of sync, because the skips of the lists will be different causing a clashing harmony, a "train wreck"... The instruments with melodic figurations will skip differently from the instruments that plays only ONE note of the first repeating notes list. It will become clearer...  WHAT I NEED  I need an INVISIBLE Symbol, that makes no musical interference in the OMN expression, but counts as an item to make the list skipping in the span, like a GHOST character that count as a rhythm without duration, or a pitch without sound, to act ONLY as a list skipping for the span process.   (setf rv1 (gen-divide '(3) (gen-repeat 5 '(-q h %)))) ;;; The symbol " % " (or anything) is a symbol to count in the span of the lists but won´t interfere ;;musically (no rhythm/pitch/attribute meaning in the expression) (make-omn       :length rv1       :pitch (span rv1 pitmat)       :span :length)  A symbol, anything that count as an item for the SPAN of the list that I can put instead of the NIL. It does not need to be a function. A special character is prefereable, to not mess with the OMN expressions... I need some item to make the list skip  (in order to get the span of the lists aligned), but this CANNOT be a NOTE or a RHYTHM, just something to SWALLOW one item (but not putting any note or duration) , to skip to the next list (but without playing any pitch or altering any rhythm). I tried to put an articulation there, but I think it wont work in the span process. Hope you can understand it Help greatly appreciated !  BEST !  JULIO      Â
March 11, 20214 yr Look to the function span and the function gen-swallow. May be it could help to achieve what you want. Â May be something like that: Â (setf pch (span rv1 pitmat :swallow t)) (make-omn :pitch pch :length rv1) Â S.
March 11, 20214 yr Author Thanks, Stephane !  Yes, I´ve checked gen-swallow. Does not seem to do what I want...  The span is already in use for generating the final make-omn expression. But, as far as I understand, the gen-swallow skip items but it produces a result. For example:  (gen-swallow '((-1/4 1/4) (-1/4)) '((c4 d4 e4 g4)(cs4 ds4 f4 gs4))) ;;; will result ((d4) nil)  This will produce a skip in the first list and results in a NIL for the second list. The nil won´t work as a ghost invisible character for skipping the note or list the way I need.  I don´t want a function that produces a result: I want a charachter that means nothing, except for counting as an item of a list and can work inside the span function, instead of a rhythm (like s q h) or a pitch (like c4, d4, etc).   As I said, would be much easier to have a "special" character, like the backslash on python, but in this case, a character that counts as an item list, but means nothing musically. I would be used only with the purpose of skipping or introduce "false" items when needed, to keep lists with the same form.  Best, Julio   Stephane I´m going to check your suggestion, below. Let´s see... Thanks a lot ! 2 hours ago, Stephane Boussuge said: (setf pch (span rv1 pitmat :swallow t)) (make-omn :pitch pch :length rv1) Unfortunately, this is not the solution... Thank you !
March 11, 20214 yr Author All the programming languages have some special symbols. In LISP, the "( )" contain lists, the " ' " means literal quotation in declaring some expression. This kind of "null" character must have all the properties of a rhythm or pitch symbol, including the possibility of being processed by all the functions, like  (gen-divide (3 2) '(% % c4 d4 %)) resulting in ((% % c4) (d4 %))  ETC... IN my case, I need to use it with rhythms, like  (gen-divide (5 3) (q e. s % % e e %))  > ((q e. s % %) (e e %))  (get-count (q e. s % % e e %)) > 8  This works (gen-repeat 3 '(% % %)) (% % % % % % % % %)   Please, let me know if I can implement something like this at least for me, in the initialization of Opusmodus.  All the best, Julio
March 11, 20214 yr Author THIS IS THE EXAMPLE  THIS IS THE WAY SPAN WORKS  (setf pitchlist '((c4 d4 e4 f4)(cs4 ds4 as4 fs4)(bb4 eb4 ab4))) (setf rhy '((s s s)(s s)(s)(s s s)(s s)(s s))) (span rhy pitchlist) ;;;result ((c4 d4 e4) (cs4 ds4) (bb4) (c4 d4 e4) (cs4 ds4) (bb4 eb4))  THIS WOULD BE WITH THE FAKE CHARACTER  ;;with the fake/ghost/ "invisible" character (%) (setf pitchlist '((c4 d4 e4 f4)(cs4 ds4 as4 fs4)(bb4 eb4 ab4))) (setf rhy '((s s s)(s s)(%)(s s s)(s s)(s s))) (span rhy pitchlist) ;;;result ((c4 d4 e4) (cs4 ds4) (c4 d4 e4) (cs4 ds4) (bb4 eb4))  I NEED THIS SO BAD !!ðŸ˜Â ðŸ˜Â ðŸ˜Â ðŸ˜Â ONE MORE IDEA  Maybe a variation of the span function, like span2 that could recognize this special character can do the trick...  like  (setf pitchlist '((c4 d4 e4 f4)(cs4 ds4 as4 fs4)(bb4 eb4 ab4))) (setf rhy '((s s s)(s s)(%)(s s s)(s s)(s s))) (span2 rhy pitchlist) ;;;result ((c4 d4 e4) (cs4 ds4) (c4 d4 e4) (cs4 ds4) (bb4 eb4)) Â
March 12, 20214 yr Author More precisely - THIS IS THE ACTUAL SPAN  (setf pitchlist '((c4 d4 e4 f4)(cs4 ds4 as4 fs4)(bb4 eb4 ab4))) (setf rhy '((q e e)(-s s)(s)(s e e)(e e)(e e_h))) (omn-to-time-signature (make-omn :length rhy :pitch (span rhy pitchlist) :span :length)'(4 4))  RESULT Without omn to time sig ((q c4 e d4 e4) (-s cs4) (s bb4) (s c4 e d4 e4) (e cs4 ds4) (e bb4 e_h eb4)) WITH OMN to TIME SIG with omn to time sig (for better reading)  WITH THE SPAN2 FUNCTION THAT ALLOWS THE % character to skip the list   (setf pitchlist '((c4 d4 e4 f4)(cs4 ds4 as4 fs4)(bb4 eb4 ab4))) (setf rhy '((q e e)(-s s)(%)(s)(s e e)(e e)(e e_h))) (omn-to-time-signature (make-omn :length rhy :pitch (span2 rhy pitchlist) :span :length) '(4 4))  RESULT  with omn to time sig (for better reading) (omn-to-time-signature '((q c4 e d4 e4) (-s cs4) (s c4) (s d4 e e4 f4) (e cs4 ds4) (e bb4 e_h eb4)) '(4 4))  Span2 function exactly the same way Span, with the possibility of using % (or any chosen character by programmer) to skip a list, without changing the rhythm content.  Best, Julio  COMPARISON PITCH LISTS (c4 d4 e4 f4) (cs4 ds4 as4 fs4) (bb4 eb4 ab4) (setf rhy '((q e e)(-s s)(s)(s e e)(e e)(e e_h))) SPAN SPAN 2 PITCH LISTS  (c4 d4 e4 f4) (cs4 ds4 as4 fs4) (bb4 eb4 ab4) '((q e e)(-s s)(%)(s)(s e e)(e e)(e e_h))) Hope it clarifies the subtle difference...  All the best !  Julio
March 12, 20214 yr Author ONE LAST COMMENT FOR NOW  In the example above, in the (hopefully possible) function span2  the character % let you skip to the next list.  I don't even imagine how but, if there is some possibility, I can imagine the following:  % as a symbol to skip forward in a sublist and $ as a symbol to skip backward in a sublist.  In this model of make-omn using span, musically it would be an immense achievement for organizing non-linear approaches to the materials.  You can make just a long list containing many sublists of materials and just skip back and forth through them  just using span2. You can organize the gen-divide of the rhythmic material lists that also could contain the characters to skip up and down in the pitch material sublists.  I like this kind of architeture most than the counterpoint function, maybe because I'm constructing this ideas for some time and the counterpoint thing looks a little opaque to me now...  Let me know if it is possible.  Best, Julio
March 12, 20214 yr What about this:  (setf pitchlist '((c4 d4 e4 f4)(cs4 ds4 as4 fs4)(bb4 eb4 ab4))) (setf rhy '((s s s)(s s) nil (s s s)(s s)(s s))) (remove-nils (gen-swallow  rhy pitchlist)) => ((c4 d4 e4) (cs4 ds4) (c4 d4 e4) (cs4 ds4) (bb4 eb4))
March 12, 20214 yr Hi Julio, hi Stéphane,  I've try to follow.. @Stèphane: I'am missing 'remove-nils', are you willing to share it?  best  ole
March 12, 20214 yr Author Thank you, Stephane,  Your solution have some problems because the rests in the rhythm lists will result in undesirable skips in the sublists of nested lists, because of the swallow, like this:  (setf pitchlist '((c4 d4 e4 f4)(cs4 ds4 as4 fs4)(bb4 eb4 ab4))) (setf rhy (gen-repeat 3 '((q e e)(-s s) (s) (s e e)(e e)(e e_h)))) (remove-nils (gen-swallow rhy pitchlist))  ((q c4 e d4 e4) (-s ds4) (s bb4) (s c4 e d4 e4) (e cs4 ds4) (e bb4 he eb4))   The D# is not the in the beggining of the list... I also tried in the context of the make-omn architeture. like this... (setf pitchlist '((c4 d4 e4 f4)(cs4 ds4 as4 fs4)(bb4 eb4 ab4))) (setf rhy '((q e e)(-s s) nil (s) (s e e)(e e)(e e_h))) (remove-nils (gen-swallow rhy pitchlist)) (make-omn :length rhy :pitch (span rhy (remove-nils (gen-swallow rhy pitchlist))) :span :length)  I still think that the creation of a span2 function, as described above , could be useful. Thank you ! Best ! Hi, Ole The function remove-nils is native in Opusmodus. It worked here (although not in the documentation). Best, Julio   2 hours ago, o_e said: Hi Julio, hi Stéphane,  I've try to follow.. @Stèphane: I'am missing 'remove-nils', are you willing to share it?  best  ole Â
March 12, 20214 yr Author Thank you, Janusz But the gen-swallow won´t do what I propose either before or inside the make-omn... Best !  And  Even if it worked, I will have to make a gen-swallow for each rhythm, creating many derived lists...  The idea of span2 is more elegant and preserve the materials more intact inside the compositional architeture, providing much more flexibility to skip lists. More free and musical, I think. It´s just a little adjust to make the old span function skip the lists, according to some special character. Best Please, take a closer look and you´ll see. Â
March 12, 20214 yr Author Yes, I understand that the gen-swallow is to be used before the make-omn as a selector of the lists and it really works doing it.  But the span2 can bypass that stage, doing at the same time the span AND the selection/skipping of the nested lists.  BEst
March 12, 20214 yr Only Janusz can do such a function but indeed I think something like that could be useful for controlling vertical intervalic harmony between multiple voices coming from and already generated chord canevas and extracted with pitch-demix or similar function. Â Â S.
March 12, 20214 yr Author Exactly, Stephane !!  This is precisely the way I´m working. I´d like to share with you in the forum the complete process for generating the score. Goes like this: And with this new function it will became easier !! Best, Julio  ;;; Julio Herrlein ;;;Compositional Process - String Quartet ;;; CHORALE - MIDI GUITAR RECORDED (progn (setf pitmidi2 '(a3b3e4ab4 gs3ds4g4bb4 cs3a3b3e4 gs2f3as3d4)) (assign-variable 'ch pitmidi2) ;;;FASTER PITCH-DEMIX using Array (setf chordarray (build-array (sort-desc (melodize (mclist pitmidi2))))) (setf size (get-count pitmidi2)) ;;; v1rp - repeating 16 notes (setf chrptimes '(16)) (assign-variable 'v1rp (gen-repeat chrptimes (mclist (get-array 0 0 size chordarray :direction 'down)))) (assign-variable 'v2rp (gen-repeat chrptimes (mclist (get-array 0 1 size chordarray :direction 'down)))) (assign-variable 'v3rp (gen-repeat chrptimes (mclist (get-array 0 2 size chordarray :direction 'down)))) (assign-variable 'v4rp (gen-repeat chrptimes (mclist (get-array 0 3 size chordarray :direction 'down)))) ;;; repeating notes material ;;; VOZ 1 a 4 (setf vrpt1 '(v1rp0 v1rp1 v1rp2 v1rp3)) (setf vrpt2 '(v2rp0 v2rp1 v2rp2 v2rp3)) (setf vrpt3 '(v3rp0 v3rp1 v3rp2 v3rp3)) (setf vrpt4 '(v4rp0 v4rp1 v4rp2 v4rp3)) ;;;MELODIC MATERIAL - arpeggios or custom material ;;VL 1 (assign-variable 'melch1- (gen-repeat '(4) (ambitus-octaves 'e4 1 (pitch-rotate 1 (melodize (gen-divide 1 (list ch0 ch1 ch2 ch3))))))) (setf vml1 '(melch1-0 melch1-1 melch1-2 melch1-3)) ;;VL 2 (assign-variable 'melch2- (gen-repeat '(4) (ambitus-octaves 'e3 1 (pitch-rotate 0 (melodize (gen-divide 1 (list ch0 ch1 ch2 ch3))))))) (setf vml2 '(melch2-0 melch2-1 melch2-2 melch2-3)) ;; VIOLA (assign-variable 'melch3- (gen-repeat '(4) (ambitus-octaves 'e3 1 (pitch-rotate -2 (melodize (gen-divide 1 (list ch0 ch1 ch2 ch3))))))) (setf vml3 '(melch3-0 melch3-1 melch3-2 melch3-3)) ;; CELLO (assign-variable 'melch4- (gen-repeat '(4) (ambitus-octaves 'e2 1 (pitch-rotate -1 (melodize (gen-divide 1 (list ch0 ch1 ch2 ch3))))))) (setf vml4 '(melch4-0 melch4-1 melch4-2 melch4-3)) ;;; MIXING LISTS (repeated notes and melodic fragments) (setf list1 vrpt1) (setf list1b vml1) (setf v1dt (gen-divide '(16) (flatten (apply-eval (matrix-transpose (list list1 list1b)))))) (setf list2 vrpt2) (setf list2b vml2) (setf v2dt (gen-divide '(16) (flatten (apply-eval (matrix-transpose (list list2 list2b)))))) (setf list3 vrpt3) (setf list3b vml3) (setf v3dt (gen-divide '(16) (flatten (apply-eval (matrix-transpose (list list3 list3b)))))) (setf list4 vrpt4) (setf list4b vml4) (setf v4dt (gen-divide '(16) (flatten (apply-eval (matrix-transpose (list list4 list4b)))))) ;;; Length Map atualizado - 8 FEV (setf len-map1 '((e (stacc)) (s (ord)) (h (long)) (h. (long)) (w (long)))) (setf len-map2 '((e (list (rnd-pick '(mf f)))) (s (mf)) (e. (mf)) (h (p<f)) (h. (p<f)) (w (P<f>p))(wq (P<f>p))(wh (P<f>p))(wh. (P<f>p))(ww (P<f>p)))) ;;;RITMOS ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; 12 mar B (setf rv1 (gen-repeat 5 (gen-divide '(3 7) (gen-repeat 5 '(q e. s s s s s h_e s s))))) (setf rv2 (gen-repeat 5 (gen-divide '(2) (gen-repeat 5 '(-e eh -e eh))))) (setf rv3 (gen-repeat 5 (gen-divide '(2) (gen-repeat 5 '(-q qq -q qq))))) (setf rv4 (gen-repeat 5 (gen-divide '(2) (gen-repeat 5 '(-q. eq -q. eq))))) (setf timesig '(6 4 1)) (setf timesigs '((6 4 1) (6 4 1))) (setf timesig-proc (butlast (gen-divide 3 (span (flatten v1dt) timesigs)))) ) ;;;FINAL DO PROGN INITIALIZE ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;BUG TRACKING #3 11 mar ;;; Mudando o :span de :pitch para :length, ;;faz com que cada vez que recomeça a lista de length os acordes partem do inÃcio;;isso pode ser interessante e os ritmos estão com o comportamento esperado (progn ;(setf timesig '(6 4 1)) (setf vh1-2 (make-omn :length rv1 :pitch (span rv1 v1dt) :span :length :velocity (length-map len-map2 rv1 :otherwise '(mf) :repeat t) :articulation (length-map len-map1 rv1 :otherwise '(ord) :repeat t))) (setf vh2-2 (make-omn :length rv2 :pitch (span rv2 v2dt) :span :length :velocity (length-map len-map2 rv2 :otherwise '(mf) :repeat t) :articulation (length-map len-map1 rv2 :otherwise '(ord) :repeat t))) (setf vh3-2 (make-omn :length rv3 :pitch (span rv3 v3dt) :span :length :velocity (length-map len-map2 rv3 :otherwise '(mf) :repeat t) :articulation (length-map len-map1 rv3 :otherwise '(ord) :repeat t))) (setf vh4-2 (make-omn :length rv4 :pitch (span rv4 v4dt) :span :length :velocity (length-map len-map2 rv4 :otherwise '(mf) :repeat t) :articulation (length-map len-map1 rv4 :otherwise '(ord) :repeat t))) (ps 'gm :sq ;(list (pitch-transpose 12 vh1-2) vh2-2 vh3-2 vh4-2) (list (pitch-transpose 12 (ambitus 'violin vh1-2)) (ambitus 'violin vh2-2) (ambitus 'viola vh3-2) (ambitus 'cello vh4-2)) :key-signature 'atonal ;;;obs: abrindo o time sig aqui, faz bypass do omn-to-time-signature acima :time-signature timesig-proc ;time-signature timesig :tempo 80 :title "STR 4tet" :display :window)) ;;;>>>>>>>>>>>>> F I N A L <<<<<<<<<<<<<<<<< ;;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;;;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Â
March 12, 20214 yr Author There are some comments in portuguese... Maybe I´ll do a video about it, later. Now, I´m in the process of composition. Thanks to the forum where I learned the stuff. This is my modest contribution. Hope it can help someone to work out things in Opusmodus. Â
March 13, 20214 yr Author ONE MORE IDEA  span-index  This function could be a variation of the span2: The span-index could do the counting and indexing of the lists used for the spanning process. In the same way of span2, span-index could have a number before or after the special character to specify the sublist to skip.  Something like:  ;;; HIPOTHESIS (setf pitchlist '((c4 d4 e4 f4)(cs4 ds4 as4 fs4)(bb4 eb4 ab4))) (setf rhy '((q e e)(-s s)(%1)(s)(s e e)(e e)(%3)(e e_h)(%2)(q))) (make-omn :length rhy :pitch (span-index rhy pitchlist) :span :length) '(4 4)) > ((q c4 e d4 e e4)(-s s cs4) (c4) (s cs4 e ds4 e as4)(e bb4 eb4)(e bb4 e_h eb4)(q cs4))  The special characters in the rhythm lists affects the list of pitches when in the :span :length mode. The special characters in the pitch lists affects the list of rhythms when in the :span :pitch mode.  More 2 cents to discussion.  Best, Julio
March 13, 20214 yr i've experimented a bit with pitch alignment for controlling harmony, here's what I tried. Hope it could help. ;;; Pich alignment with binaries ;;; Proof of concept (progn (setf lvl (rnd-sample 8 '(8 12 16))) (setf len1 (euclidean-rhythm lvl 1 12 's)) (setf len2 (euclidean-rhythm lvl 1 12 's)) (setf len3 (euclidean-rhythm lvl 1 12 's)) (setf bin1 (length-to-binary len1)) (setf bin2 (length-to-binary len2)) (setf bin3 (length-to-binary len3)) (setf pch '(c4 d4 e4 f4 g4 a4 b4 c5 b4 a4 g4 f4 e4 d4 c4)) (setf pch1 (binary-map bin1 pch)) (setf pch2 (binary-map bin2 pch)) (setf pch3 (binary-map bin3 pch)) (setf omn1 (make-omn :pitch pch1 :length len1)) (setf omn2 (make-omn :pitch pch2 :length len2)) (setf omn3 (make-omn :pitch pch3 :length len3)) (ps 'gm :fl (list omn1) :fl (list omn2) :fl (list omn3)) ) ;;; Now with intervals (progn (setf lvl (rnd-sample 8 '(8 12 16))) (setf len1 (euclidean-rhythm lvl 1 12 's)) (setf len2 (euclidean-rhythm lvl 1 12 's)) (setf len3 (euclidean-rhythm lvl 1 12 's)) (setf bin1 (length-to-binary len1)) (setf bin2 (length-to-binary len2)) (setf bin3 (length-to-binary len3)) (setf pch '(c4 d4 e4 f4 g4 a4 b4 c5 b4 a4 g4 f4 e4 d4 c4)) (setf pch1 (binary-map bin1 pch)) (setf pch2 (binary-map bin2 (pitch-transpose-n '(-4 -3 -7) pch1))) (setf pch3 (binary-map bin3 (pitch-transpose-n '(-17 -20 -19) pch1))) (setf omn1 (make-omn :pitch pch1 :length len1)) (setf omn2 (make-omn :pitch pch2 :length len2)) (setf omn3 (make-omn :pitch pch3 :length len3)) (ps 'gm :fl (list omn1) :cl (list omn2) :bn (list omn3)) ) ;;; Pitch generation from choral with 7th chords (progn (setf lvl (rnd-sample 8 '(8 12 16))) (setf len1 (euclidean-rhythm lvl 1 12 's)) (setf len2 (euclidean-rhythm lvl 1 12 's)) (setf len3 (euclidean-rhythm lvl 1 12 's)) (setf bin1 (length-to-binary len1)) (setf bin2 (length-to-binary len2)) (setf bin3 (length-to-binary len3)) (setf chords (gen-chord3 '(d3 f3 e3 a3) '((10 16)))) (setf cpch1 (pitch-demix 1 chords)) (setf cpch2 (pitch-demix 2 chords)) (setf cpch3 (pitch-demix 3 chords)) (setf pch1 (binary-map bin1 cpch1)) (setf pch2 (binary-map bin2 cpch2)) (setf pch3 (binary-map bin3 cpch3)) (setf omn1 (make-omn :pitch pch1 :length len1)) (setf omn2 (make-omn :pitch pch2 :length len2)) (setf omn3 (make-omn :pitch pch3 :length len3)) (ps 'gm :fl (list omn1) :cl (list omn2) :bn (list omn3)) ) ;;; Same as above but with chord change only on every bar (progn (setf lvl (rnd-sample 8 '(8 12 16))) (setf len1 (euclidean-rhythm lvl 1 12 's)) (setf len2 (euclidean-rhythm lvl 1 12 's)) (setf len3 (euclidean-rhythm lvl 1 12 's)) (setf bin1 (length-to-binary len1)) (setf bin2 (length-to-binary len2)) (setf bin3 (length-to-binary len3)) (setf chords (gen-chord3 '(d3 f3 e3 a3) '((10 16)))) (setf cpch1 (mclist (pitch-demix 1 chords))) (setf cpch2 (mclist (pitch-demix 2 chords))) (setf cpch3 (mclist (pitch-demix 3 chords))) (setf pch1 (binary-map bin1 cpch1)) (setf pch2 (binary-map bin2 cpch2)) (setf pch3 (binary-map bin3 cpch3)) (setf omn1 (make-omn :pitch pch1 :length len1)) (setf omn2 (make-omn :pitch pch2 :length len2)) (setf omn3 (make-omn :pitch pch3 :length len3)) (ps 'gm :fl (list omn1) :cl (list omn2) :bn (list omn3)) ) SB.
March 13, 20214 yr Author Thank you, Stephane  The idea of aligning using the binaries is interesting. Looks good. But, I feel that this concept of span + skipping is more flexible. Let's cross fingers and see if Janusz find this interesting.  Best, Julio
March 14, 20214 yr Author I did something unnecessary... I don't need the repeating note list... As far as the rhythm list is separated in a sublist, it will remain spanning the same note over and over. But the problem of skipping lists in the span remains the same... Â (make-omn :length rhy :pitch (span rhy v1dtb) :span :length) (setf rhy '((q e. s) (s s s s h_e s s) (s s s s)(h h))) (setf v1dtb '((ab4) (b4 e4 gs4 a4 b4 e4 gs4 a4 b4 e4 gs4 a4 b4 e4 gs4 a4) (bb4) (eb5 g4 bb4 gs4 eb5 g4 bb4 gs4 eb5 g4 bb4 gs4 eb5 g4 bb4 gs4) (e4) (a4 b4 e4 cs5 a4 b4 e4 cs5 a4 b4 e4 cs5 a4 b4 e4 cs5) (d4) (f4 bb4 d5 gs4 f4 bb4 d5 gs4 f4 bb4 d5 gs4 f4 bb4 d5 gs4))) > ((q ab4 e. s) (s b4 e4 gs4 a4 h_e b4 s e4 gs4) (s bb4 bb4 bb4 bb4) (h eb5 g4)) Â
March 15, 20214 yr Author Sorry if I might seem a little crazy speaking here alone but I can relate to this in the future, as a kind of memorial of proceedings... My solution for now is a giant substitute-map for customizing each voice.  You, know ? In the end, this kind of manual work makes me feel more like composing, since I have to annotate a lot on paper.  This is cool. I´m enjoying it.  I´m filling the gaps of my bad programming with compositional work.  Best ! Julio  ;;;;;;Voice 1 - recombining the list steps (setf matlistsize-v1 (get-count (get-count v1dt))) (setf listmatord-v1 '( 0 1 ;ch 1 - size/form (1 16) 2 3 4 5 6 7 8 9 10 ;11 put semicolons to mute items of the list 12 ;13 14 ;15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 )) (setf gen-divlist (get-count (substitute-map v1dt (gen-integer matlistsize-v1) listmatord-v1))) (setf v1dtb (gen-divide gen-divlist (flatten (substitute-map v1dt (gen-integer matlistsize-v1) listmatord-v1)))) Â
March 15, 20214 yr My understanding of what you are trying to do is that you should explore loop, here are few examples which might help you with your work:  (loop for i in '(1 4 1 4) when (not (equal 1 i)) counting i) => 2 (loop for i in '(8 6 8 7 4 3 3 6 2 2 9 7) counting (evenp i) into evens counting (oddp i) into odds summing i into total maximizing i into max minimizing i into min finally (return (list min max total evens odds))) => (2 9 65 7 5) (loop for i in '(1 2 3) when (> i 1) return i) => 2 ;;; Position (loop for i in '(1 4 1 4) with cnt = -1 for n = (incf cnt) when (not (equal 1 i)) collect n) => (1 3) (loop for i from 1 to 100 if (evenp i) minimize i into min-even and maximize i into max-even and unless (zerop (mod i 4)) sum i into even-not-fours-total end and sum i into even-total else minimize i into min-odd and maximize i into max-odd and when (zerop (mod i 5)) sum i into fives-total end and sum i into odd-total finally (return (list min-even max-even min-odd max-odd even-total odd-total fives-total even-not-fours-total))) => (2 100 1 99 2550 2500 500 1250) (loop repeat 10 collect (random 10000)) => (4338 3277 1359 1272 3755 711 4365 828 4652 2346) (loop repeat 5 for x = 0 then y for y = 1 then (+ x y) collect y) => (1 2 4 8 16) (loop repeat 5 for y = 1 then (+ x y) for x = 0 then y collect y) => (1 1 2 4 8) (loop repeat 5 for x = 0 then y and y = 1 then (+ x y) collect y) => (1 1 2 3 5) (loop for i in '(1 2 3) when (> i 1) return i) => 2 (loop for i across #(1 2 3) do (print i)) => 1 => 2 => 3 => nil (loop for x from 1 to 3 collect (loop for y from 1 to x collect y)) => ((1) (1 2) (1 2 3)) (loop for x from 1 to 3 for y = (* x 10) collect y) => (10 20 30) (loop repeat 10 for x = (random 100) if (evenp x) collect x into evens else collect x into odds finally (return (values evens odds))) => (52 94 86 50 8 50) => (85 27 1 39) (loop for x in '(1 2 3 4 5) until (> x 3) collect x) => (1 2 3) (loop for x in '(1 2 3 4 5) while (< x 4) do (format t "x is ~a~&" x) collect x) => x is 1 => x is 2 => x is 3 => (1 2 3) (loop named loop-1 for x from 0 to 10 by 2 do (loop for y from 0 to 100 by (1+ (random 3)) when (< x y) do (return-from loop-1 (values x y)))) => 0 => 2 (loop for x in '(foo 2) thereis (numberp x)) => t (loop for x in '(foo 2) never (numberp x)) => nil (loop for x in '(foo 2) always (numberp x)) => nil (loop for i from 1 to 3 count (oddp i)) => 2 (loop for i from 1 to 3 sum i) => 6 (loop for i from 1 to 3 maximize (mod i 3)) => 2 (loop for (a b) in '((x 1) (y 2) (z 3)) collect (list b a)) => ((1 x) (2 y) (3 z)) (loop for (x . y) in '((1 . a) (2 . b) (3 . c)) collect y) => (a b c) ;;; Use nil to ignore a term: (loop for (a nil) in '((x 1) (y 2) (z 3)) collect a) => (x y z) (loop for i upto 10 collect i) => (0 1 2 3 4 5 6 7 8 9 10) (loop for i from 0 downto -10 collect i) => (0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10) (loop for i in (list 10 20 30 40) collect i) => (10 20 30 40) (loop for i in (list 10 20 30 40) by #'cddr collect i) => (10 30) (loop for x on (list 10 20 30) collect x) => ((10 20 30) (20 30) (30)) (loop for x on (list 10 20 30 40) by #'cddr collect x) => ((10 20 30 40) (30 40))  Tutorial for the Common Lisp Loop Macro WWW.AI.SRI.COM  Loop, iteration, mapping LISPCOOKBOOK.GITHUB.IO A collection of examples of using Common Lisp Â
March 15, 20214 yr Author Thanks a lot, Janusz !! I have many gaps on programming. Thanks a lot for it ! I´m going to study that. Certainly, it will help on remaping the list ! Best ! Julio
March 16, 20214 yr real LISP knowledge is very helpful for me. i think it's enough if you know (work with) the fundamentals - like... list/append/cons/loop/loop-inside-a-loop/progn/push/pop/collect/defun... ...  so that you can code your specific solutions!  greetings andré
March 16, 20214 yr Author Yes, André !  Thank you for encouragement and precious information. Someday I´ll study LISP seriously... By the way, do you think that this idea of transforming the span function is possible with a customized code ? Like indexing the lists (in a "master" list) and using a special character to skip back and forth the items of a "slave" list, like this "span-index" function ? ;;; HIPOTHESIS (setf pitchlist '((c4 d4 e4 f4)(cs4 ds4 as4 fs4)(bb4 eb4 ab4))) (setf rhy '((q e e)(-s s)(%1)(s)(s e e)(e e)(%3)(e e_h)(%2)(q))) (make-omn :length rhy :pitch (span-index rhy pitchlist) :span :length) '(4 4)) > ((q c4 e d4 e e4)(-s s cs4) (c4) (s cs4 e ds4 e as4)(e bb4 eb4)(e bb4 e_h eb4)(q cs4))  Or at least this, where the % works for skipping ?  (setf pitchlist '((c4 d4 e4 f4)(cs4 ds4 as4 fs4)(bb4 eb4 ab4))) (setf rhy '((q e e)(-s s)(%)(s)(s e e)(e e)(e e_h))) (omn-to-time-signature (make-omn :length rhy :pitch (span2 rhy pitchlist) :span :length) '(4 4)) >> ((q c4 e d4 e4) (-s cs4) (s c4) (s d4 e e4 f4) (e cs4 ds4) (e bb4 e_h eb4))  Best ! Julio
Create an account or sign in to comment