Stephane Boussuge Posted January 27, 2024 Posted January 27, 2024 I've shared a video here on CHORD-DICTUM function and you will find here the code from the video. Enjoy ! The Score: ;;;-------------------------------------------------------- ;;; SCORE 186 ;;; VARIATIONS POUR PIANO ;;; Etude de la fonction "chord-dictum" ;;; S.BOUSSUGE ;;; WIEN - 27.01.2024 ;;;-------------------------------------------------------- ;;; LEARN OPUSMODUS: WWW.COMPOSERWORKSHOP.COM ;;;-------------------------------------------------------- ;;; To view the score press the Cmd-Option-1 keys. ;;;-------------------------------------------------------- ;;; UTILITY ;;; REA-MARK (defun rea-mark (omn-exp) "Add rehearsal marks even on empty bars." (if (event-restp (nth-event 0 omn-exp)) (position-insert 1 'reh omn-exp :section '(0)) (edit-events '((1 1 'reh :articulation)) omn-exp))) ;;;-------------------------------------------------------- ;;; PARAMETERS (setf seed (rnd-round 1 1000000)) (init-seed seed) (setf chords.p '(h. cs3fs3b3d4fs4bb4 q bb2eb3g3b3eb4gs4 h. cs3fs3b3d4fs4bb4 q fs3bb3d4f4bb4eb5 h b2c3eb3a3c4eb4gs4 q gs2cs3f3g3bb3eb4 h fs2bb2d3e3gs3cs4 q eb2gs2c3d3fs3bb3 h. c3eb3fs3b3d4fs4bb4c5 q d3fs3bb3d4f4bb4f5 b2eb3fs3b3d4fs4bb4c5 g2bb2eb3g3b3cs4fs4a4 e2gs2cs3e3g3bb3eb4f4 a2cs3fs3a3c4eb4gs4b4 f2bb2eb3g3bb3eb4f4 h. c3eb3gs3c4e4fs4bb4d5 q a2fs3a3cs4fs4a4 d3fs3bb3d4f4bb4eb5f5 h f3gs3cs4f4g4bb4eb5g5 f3gs3cs4f4g4bb4eb5g5 w f3gs3cs4f4g4bb4eb5g5)) (setf rvel (rnd-sample (length (omn :pitch chords.p)) '((pp)(p)(mp)(mf)(f)(ff)))) (setf chords.d (omn-replace :velocity rvel chords.p)) (setf dictum1 '( (:len w :chd 7 :div 7 :vel nil :att nil :grp nil :int nil :var ? :mtd m :rhy t) #|2|# (:len w :chd 6 :div 2 :vel nil :att nil :grp 2 :int nil :var ? :mtd nil :rhy t) #|3|# (:len w :chd 5 :div 5 :vel nil :att nil :grp nil :int nil :var ? :mtd m :rhy t) #|4|# (:len w :chd 4 :div 4 :vel nil :att nil :grp 3 :int nil :var ? :mtd nil :rhy t) #|5|# (:len h. :chd 7 :div 7 :vel nil :att nil :grp nil :int nil :var ? :mtd m :rhy t) #|6|# (:len h. :chd 6 :div 3 :vel nil :att nil :grp 3 :int nil :var ? :mtd nil :rhy t) #|7|# (:len h. :chd 5 :div 5 :vel nil :att nil :grp nil :int nil :var ? :mtd m :rhy t) #|8|# (:len h. :chd 4 :div 4 :vel nil :att nil :grp nil :int nil :var ? :mtd m :rhy t) #|9|# (:len h :chd 7 :div 2 :vel nil :att nil :grp 2 :int nil :var ? :mtd nil :rhy t) #|10|# (:len h :chd 6 :div 6 :vel nil :att nil :grp 3 :int nil :var ? :mtd nil :rhy t) #|11|# (:len h :chd 5 :div 3 :vel nil :att nil :grp 2 :int nil :var ? :mtd nil :rhy t) #|12|# (:len h :chd 4 :div 4 :vel nil :att nil :grp nil :int nil :var ? :mtd m :rhy t) #|13|# (:len q :chd 7 :div 4 :vel nil :att nil :grp 2 :int nil :var ? :mtd nil :rhy t) #|14|# (:len q :chd 6 :div 6 :vel nil :att nil :grp nil :int nil :var ? :mtd m :rhy t) #|15|# (:len q :chd 5 :div 2 :vel nil :att nil :grp 2 :int nil :var ? :mtd nil :rhy t) #|16|# (:len q :chd 4 :div 4 :vel nil :att nil :grp nil :int nil :var ? :mtd m :rhy t) ) ) (setf dictum-temp `(list (rnd-sample 8 '(w h. h q)) ; Length map (rnd-number 8 4 8) ; Chord-size map (rnd-number 8 3 7) ; Length division nil ; Velocity map nil ; Attribute map (rnd-sample 8 '((3 4) (3 4) nil)) ; Chord group (rnd-sample 8 '((0 13 1 11) nil (0 6 -6 11) nil)) ; Intervals '? ; Variant (rnd-sample 8 '(m r nil)) ; Methods (rnd-sample 8 '(nil t t nil)) ; Rhythm series )) (setf dictum2 (gen-chord-dictum (eval dictum-temp))) (setf dictum3 (gen-chord-dictum (eval dictum-temp))) (setf out1 (chord-dictum dictum1 chords.d)) (setf out2 (chord-dictum dictum2 chords.d)) (setf out3 (chord-dictum dictum3 chords.d)) (setf out4 (chord-dictum dictum1 chords.d)) (setf piano (assemble-seq chords.d out1 out2 out3 out4)) (setf split1 (ambitus-filter '(c4 c8) piano)) (setf split2 (ambitus-filter '(a0 b3) piano)) (setf piano-rh split1) (setf piano-rh.rea (assemble-seq (loop for i in piano-rh :collect (rea-mark (list i))))) (setf piano-lh split2) (setf titre (concatenate 'string "Score186-Variation-Piano-" (stringify seed) )) ;;;-------------------------------------------------------- ;;; SCORE AND LAYOUT (def-score Score186 (:title titre :subtitle "pour Piano" :composer "Stephane Boussuge" :copyright "Copyright © 2024" :key-signature 'chromatic :time-signature '((1 1 1 1) 4) :tempo 108 :layout (piano-solo-layout 'piano-rh 'piano-lh)) (piano-rh :omn piano-rh.rea ;:port "bus 6" :channel 1 :sound 'gm :program 'acoustic-grand-piano ) (piano-lh :omn piano-lh ;:port "bus 6" :channel 1 ) ) (init-seed nil) TomTolleson, lviklund and david 1 2 Quote
opmo Posted January 27, 2024 Posted January 27, 2024 You find the score in the How-to/Chord Dictum directory in v. 3.0.29177 Stephane Boussuge 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.