Jump to content

Short piano example


Recommended Posts

Hi,
here's a small piece for piano as an example of different process like tonality mapping, harmonic rhythm, rhytm and pitch cells etc..

;;; UTILITY
;;; ------------------------------------------------------------------------------
;;; GEN-PITCH-LINE
;;; Fonction de génération de hauteurs basées sur une conversion de vecteur de bruit
;;; avec un grand choix de type de bruit, taux de compression du vecteur, filtrage des répétitions et ambitus.
(defun gen-pitch-line (nb-pitch &key (compress 1) (ambitus '(c4 c6)) seed filter-repeat (type :white))
  (let (pitches)
    (do-verbose
      ("gen-pitch-line")
    (rnd-seed seed)
    (labels ((white-or-pink (nb-pitch seed type)
               (if (eq type ':pink)
                 (gen-pink-noise nb-pitch :seed seed)
                 (gen-white-noise nb-pitch :seed seed :type (if (eq type ':white) :normal type))))

             (process  (nb-pitch &key (compress 1) (ambitus '(c4 c6)) seed filter-repeat type)
               (setf pitches (vector-to-pitch ambitus (vector-smooth compress (white-or-pink nb-pitch seed type)))) 
               (when filter-repeat
                 (setf pitches (gen-trim nb-pitch (filter-repeat filter-repeat pitches))))
               pitches)
             )
      (process nb-pitch :compress compress :ambitus ambitus :filter-repeat filter-repeat :seed (seed) :type type)))))

;;;---------------------------------------------------------
;;; Parameters
;;;---------------------------------------------------------

;;; Global size
(setf size 42)

;;; Global random seed init
(init-seed 392)

;;; Harmonic content definition
;; Base row
(setf row (rnd-row :type :pitch :transpose 2))

;; Extract scales from row
(setf sc (gen-chord 12 7 7 0 0 (gen-trim 14 row)))

;; Harmonic rhythm to apply for the piece
(setf hry '(4 4 2 2 1 1 2 2 3 3))

;;; Generation of rhythmic cells reservoir
(setf ryres (euclidean-rhythm (gen-trim 8 '(16))
                                       '(1)
                                       '(16)
                                       's
                                       :type 2
                                       ))

;;; Generation of pitch contours reservoir
(setf pres (gen-divide 16 (gen-pitch-line 64)))

;;; 2 global control vectors
(setf vc1 (gen-white-noise size))
(setf vc2 (gen-white-noise size))

;;; Choose pitch in pitch reservoir based on vector
(setf pch1 (vector-map pres vc1))
(setf pch2 (pitch-transpose -12 (vector-map pres vc2)))

;;; Choose rhythmic cells in rhythm reservoir based on control vector
(setf r1 (vector-map ryres vc1))
(setf r2 (vector-map ryres vc2))

;;; definition of dynamics and articulation reservoir 
(setf bvel '((pp)(p)(mp)(mf)(f)(ff)))
(setf bart '((-)(-)(-)(marc)(-)(stacc)(-)(-)))

;;; Choose dynamics based on control vector
(setf v1 (vector-map bvel vc1))
(setf v2 (vector-map bvel vc2))

;;; Choose articulation based on control vector
(setf art1 (vector-map bart vc1))
(setf art2 (vector-map bart vc2))

;;; Chordize pitch when length = 1/4 or 1/2
(setf chp1 (length-chordize-map 
           '((1/4 2)(1/2 2))
           pch1
           r1
           ))

(setf chp2 (length-chordize-map 
           '((1/4 2)(1/2 2))
           pch2
           r2
           ))

;;; OMN assembly and harmonic remapping with tonality map whith harmonic rhythm (:time hry)
(setf p1a (ambitus-chord 
           12
           (tonality-map
           (mclist sc)
           (make-omn
            :pitch chp1
            :length r1
            :velocity v1
            :articulation art1
            )
           :time hry)))

(setf p1b (ambitus-chord 
           12
           (tonality-map
            (mclist sc)
            (make-omn
             :pitch chp2
             :length r2
             :velocity v2
            :articulation art2
            )
            :time hry)))

;;; Coda chords
(setf p2a '((w eb5a5 f)))
(setf p2b '((w d4bb4 f)))

;;; Assemble part1 and part2 (coda)
(setf piano-rh (assemble-seq p1a p2a))
(setf piano-lh (assemble-seq p1b p2b))

;;;---------------------------------------------------------
;;; Score and Layout
;;;---------------------------------------------------------

(def-score snippet
           (:title "Snippet for Piano"
            :composer "S.Boussuge"
            :copyright "Copyright © 2016 s.boussuge "
            :key-signature 'chromatic
            :time-signature '((1 1 1 1) 4)
            :tempo 100
            :layout (piano-solo-layout 'piano-rh 'piano-lh))
  
  (piano-rh
   :omn piano-rh
   :channel 1
   :sound 'gm
   :program 'acoustic-grand-piano
   :volume 100
   :pan 64
   :controllers (91 '(48))
   )
  
  (piano-lh
   :omn piano-lh
   :channel 2
   :controllers (91 '(48))
   )
  )

SB.

Link to comment
Share on other sites

A better and more refined version. Attached, the Final score (from Dorico but first imported into Sibelius and after to Dorico because Dorico won't recall the opmo dynamics marks...).

 

 

;;; UTILITY
;;; ------------------------------------------------------------------------------
;;; GEN-PITCH-LINE
;;; Fonction de génération de hauteurs basées sur une conversion de vecteur de bruit
;;; avec un grand choix de type de bruit, taux de compression du vecteur, filtrage des répétitions et ambitus.
(defun gen-pitch-line (nb-pitch &key (compress 1) (ambitus '(c4 c6)) seed filter-repeat (type :white))
  (let (pitches)
    (do-verbose
      ("gen-pitch-line")
    (rnd-seed seed)
    (labels ((white-or-pink (nb-pitch seed type)
               (if (eq type ':pink)
                 (gen-pink-noise nb-pitch :seed seed)
                 (gen-white-noise nb-pitch :seed seed :type (if (eq type ':white) :normal type))))

             (process  (nb-pitch &key (compress 1) (ambitus '(c4 c6)) seed filter-repeat type)
               (setf pitches (vector-to-pitch ambitus (vector-smooth compress (white-or-pink nb-pitch seed type)))) 
               (when filter-repeat
                 (setf pitches (gen-trim nb-pitch (filter-repeat filter-repeat pitches))))
               pitches)
             )
      (process nb-pitch :compress compress :ambitus ambitus :filter-repeat filter-repeat :seed (seed) :type type)))))

;;;---------------------------------------------------------
;;; Parameters
;;;---------------------------------------------------------

;;; Global size
(setf size 42)

;;; Global random seed init
(init-seed 392)

;;; Harmonic content definition
;; Base row
(setf row (rnd-row :type :pitch :transpose 2))

;; Extract scales from row
(setf sc (gen-chord 12 7 7 0 0 (gen-trim 14 row)))

;; Harmonic rhythm to apply for the piece
(setf hry '(4 4 2 2 1 1 2 2 3 3))

;;; Generation of rhythmic cells reservoir
(setf ryres (euclidean-rhythm (gen-trim 8 '(16))
                                       '(1)
                                       '(16)
                                       's
                                       :type 2
                                       ))

;;; Generation of pitch contours reservoir
(setf pres (gen-divide 16 (gen-pitch-line 64 :compress 0.24)))

;;; 2 global control vectors
(setf vc1 (gen-white-noise size))
(setf vc2 (gen-white-noise size))

;;; Choose pitch in pitch reservoir based on vector
(setf pch1 (vector-map pres vc1))
(setf pch2 (pitch-transpose -12 (vector-map pres vc2)))

;;; Choose rhythmic cells in rhythm reservoir based on control vector
(setf r1 (vector-map ryres vc1))
(setf r2 (vector-map ryres vc2))

;;; definition of dynamics and articulation reservoir 
(setf bvel '((pp)(p)(mp)(mf)(f)(ff)))
(setf bart '((-)(-)(-)(marc)(-)(stacc)(-)(-)))

;;; Choose dynamics based on control vector
(setf v1 (vector-map bvel vc1))

;;; Choose articulation based on control vector
(setf art1 (vector-map bart vc1))
(setf art2 (vector-map bart vc2))

;;; Chordize pitch when length = 1/4 or 1/2
(setf chp1 (length-chordize-map 
           '((1/4 2)(1/2 2))
           pch1
           r1
           ))

(setf chp2 (length-chordize-map 
           '((1/4 2)(1/2 2))
           pch2
           r2
           ))

;;; OMN assembly and harmonic remapping with tonality map whith harmonic rhythm (:time hry)
(setf p1a (filter-tie
           (ambitus-chord 
            12
            (tonality-map
             (mclist sc)
             (chord-interval-replace
               '(1 2)
               '(4 8)
               (make-omn
                :pitch chp1
                :length r1
                :velocity v1
                :articulation art1
                ))
               :time hry))))

(setf p1b (ambitus
           '(c2 c4)
           (filter-tie
            (ambitus-chord 
             12
             (tonality-map
              (mclist sc)
              (chord-interval-replace
               '(1 2)
               '(4 8)
               (make-omn
                :pitch chp2
                :length r2
                :velocity v1
                :articulation art2
                ))
              :time hry)))))

;;; Coda chords
(setf p2a '((w eb5a5 f)))
(setf p2b '((w d4bb4 f)))

;;; Assemble part1 and part2 (coda)
(setf piano-rh (assemble-seq p1a p2a))
(setf piano-lh (assemble-seq p1b p2b))

;;;---------------------------------------------------------
;;; Score and Layout
;;;---------------------------------------------------------

(def-score snippet
           (:title "Snippet for Piano"
            :composer "S.Boussuge"
            :copyright "Copyright © 2016 s.boussuge "
            :key-signature 'chromatic
            :time-signature '((1 1 1 1) 4)
            :tempo 100
            :layout (piano-solo-layout 'piano-rh 'piano-lh))
  
  (piano-rh
   :omn piano-rh
   :channel 1
   :sound 'gm
   :program 'acoustic-grand-piano
   :volume 100
   :pan 64
   :controllers (91 '(48))
   )
  
  (piano-lh
   :omn piano-lh
   :channel 2
   :controllers (91 '(48))
   )
  )

SB.

SnippetForPiano Partition complète.pdf

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy