Hi George
;; And about duplicates, sometimes I use some functions like this ...
;; if found duplicate notes, they are changed to 1 or 2 octave higher or lower
;; but not to too low or high pitches ....
;;
;; It is not bad to play these notes which this func returns as a chord,
;; that is, playing them at the same time,
;; buuut, it's nice to play them as a note sequence, that is, playing 1 note at the time,
;; with random or defined duration, then next note, kind of arpeggio or some phrase ......
;; it's boring to play them only in orderd(returned values), so picking out at random....
;; and more, sometimes adding 1 or more notes which pc:relative returns to a note
;; pc:make-chord made, then playing them at the same time...
;; yes, this could make nice phrases easily, too.
;;
;;
;; Back to duplicates ....
;;
;; A. play C(60) then play C(60) feel twice same note,
;; it's easy to notice that they are just the same note,
;; B. play C(60) then play C(48) feel twice different note,
;; it's not easy for many people to notice that they are the same note C !!
;; It brings very different effects to play them, though they are the same note
;; which pc:make-chord made,
;; I think that this is one of techniques to expand/develop a phrase/tune when
;; some sounds lack or wanting to add sounds by my experience/realization .....
;; p.s. I even think that pc:make-chord doesn't need cl:sort, because
;; when playing them as a chord, the order seems to mean nothing,
;; when playing them like arpeggio, usualy doing random choice(in above case),
;; when playing in order, from lower or higher, yes it's the time to use cl:sort ...
;; like as (cl:sort (pc:make-chord .... ) < or > ),
;; this seems to be lower cost than every time sorting ...
(define dup-octv
(lambda (p-lis)
(let ((dup-lis (cl:duplicates p-lis)))
(if (null? dup-lis)
p-lis
(let ((n (random '(56 60 68 72)))
(octv-lis '(12 24))
(p-lis2 (cl:remove-duplicates p-lis))
(f +))
(cl:sort (append (map (lambda (p)
(if (> p n)(set! f -)(set! f +))
(f p (random octv-lis)))
dup-lis)
p-lis2)
<))))))
(dup-octv '(60 64 65 69 71 72)) ; '(60 64 65 69 71 72)
(dup-octv '(60 64 64 65 69 69))
;; (52 57 60 64 65 69)
;; (40 45 60 64 65 69)
;; (40 57 60 64 65 69)
;; (57 60 64 65 69 88)
;; (60 64 65 69 81 88)
;; (57 60 64 65 69 76)
;; (45 52 60 64 65 69)
;; (40 57 60 64 65 69)
;; (60 64 65 69 88 93)
(dup-octv '(60 60 60 64 64 64))
;; (60 64 76 84 84 88)
;; (36 40 48 52 60 64)
;; (60 64 72 84 88 88)
;; (40 48 48 52 60 64)
;; (40 52 60 64 72 72)
;; (40 52 60 64 72 84)
;; (60 64 72 76 84 88)
;; (60 64 72 72 76 88)
(G-pc:make-chord 60 72 6 '(0 2 4 5 9))
;; 3rd argument is 6, elements of PC=5, so result has dup invariably ....
;; (60 62 64 64 64 69)
;; (60 60 62 65 69 69)
;; (60 62 65 65 69 69)
;; (60 60 62 64 65 69)
;; (60 62 62 64 65 69)
;; (60 60 62 65 65 69)
;; (60 62 64 65 69 69) etc ...
;; deleted .000000, 60.000000 -> 60
(dup-octv (G-pc:make-chord 60 72 6 '(0 2 4 5 9)))
;; (52 60 62 64 65 69)
;; (45 57 60 62 64 69)
;; (53 60 62 65 69 84)
;; (38 60 62 64 69 84)
;; (60 62 64 65 69 72)
;; (60 62 64 65 69 86)
;; (60 62 64 65 69 81)
;; (60 62 64 69 72 93)
;; (36 50 60 62 64 69) ... etc ...
;; deleted .000000
Best Regards
2023年2月16日木曜日 11:07:10 UTC+9 Minoru: