Jump to content

opmo

Administrators
  • Posts

    2,903
  • Joined

  • Last visited

Posts posted by opmo

  1. An example of algorithmic composition in a few simple steps.

    Initialise random seed to all functions which may use random seed.

    (init-seed 8975)

     

    Six lists (bars) of note-length values.

    (setf len '((s s q s) (s q -s s) (s s s s) (s s -s s) (s e s) (s -s e)))

     

    The GEN-SINE function generates a sequence of vectors that describe and simulate the characteristics of a sine wave.

    (setf sine1 (gen-sine 12 2 0.3))
    (setf sine2 (gen-sine 24 3 0.4))
    (setf sine3 (gen-sine 30 4 0.5))
    (setf sine4 (gen-sine 36 5 0.6))

     

    Generate a graph from the data provided in these four sine sequences.

    (list-plot (list sine1 sine2 sine3 sine4)
     :zero-based t :point-radius 2 :join-points t)

    sine_01.png

     
    Conversion process from vector to pitch in a given ambitus.
    (setf pitch1 (vector-to-pitch '(g3 g6)  sine1))
    (setf pitch2 (vector-to-pitch '(gs3 g6) sine2))
    (setf pitch3 (vector-to-pitch '(a3 g6)  sine3))
    (setf pitch4 (vector-to-pitch '(as3 g6) sine4))
     
    Combining pitches to chords. 
    (setf chords2 (chordize-list (gen-combine pitch1 pitch2)))
    (setf chords3 (chordize-list (gen-combine pitch1 pitch2 pitch3)))
    (setf chords4 (chordize-list (gen-combine pitch1 pitch2 pitch3 pitch4)))
    (setf chords  (chord-pitch-unique (flatten (list chords2 chords3 chords4))))

     

    Generating length lists with the help of RND-SAMPLE and RND-ORDER functions.

    (setf dur1 (rnd-order (rnd-sample 6 (rnd-sample 4 len))))
    (setf dur2 (rnd-order (rnd-sample 4 (rnd-sample 4 len))))
    (setf dur3 (rnd-order (rnd-sample 2 (rnd-sample 4 len))))
    (setf dur4 (rnd-order (rnd-sample 4 (rnd-sample 4 len))))
    (setf dur5 (rnd-order (rnd-sample 10 (rnd-sample 4 len))))
     
    Generating velocity lists with the help of RND-SAMPLE function.
    (setf dyn1 '(p mp mf f ff))
    (setf dyn2 (rnd-sample 6 dyn1))
    (setf dyn3 (rnd-sample 12 dyn1))
    (setf dyn4 (rnd-sample 24 dyn1))
    (setf dyn5 (rnd-sample 36 dyn1))
     
    Making OMN lists.
    (setf m1 (make-omn :length dur1 :pitch pitch1 :velocity dyn1))
    (setf m2 (make-omn :length dur2 :pitch pitch2 :velocity dyn2))
    (setf m3 (make-omn :length dur3 :pitch pitch3 :velocity dyn3))
    (setf m4 (make-omn :length dur4 :pitch pitch4 :velocity dyn4))
    (setf m5 (make-omn :length dur5 :pitch chords :velocity dyn5))
     
    Random selection of variants.
    (setf part1 (pitch-variant m1 :variant '?))
    (setf part2 (pitch-variant m2 :variant '?))
    (setf part3 (pitch-variant m3 :variant '?))
    (setf part4 (pitch-variant m4 :variant '?))
    (setf part5 (pitch-variant m5 :variant '?))
     
    A pause of 1 quarter.
    (setf pause '(-1/4))

     

    Assembling a sequence.

    (setf result (assemble-seq part1 pause
                               part2 pause
                               part3 pause
                               part4 pause
                               part3 pause
                               part2 part1
                               part5))

     

    Finally, defining a score with GRAND-LAYOUT instrument - direct conversion to standard notation.

    (def-score wave-to-pitch
               (:composer "OPMO"
                :copyright "Opusmodus"
                :key-signature 'atonal
                :time-signature (get-time-signature result)
                :tempo 108
                :layout (grand-layout 'piano))
      (piano :omn result :sound 'gm :channel 1 :program 0))
     
    vector-to-pitch_01.png
  2. J.S. Bach, Chorale cantata, BWV 5

    Four voices.

    (setf soprano
    '((-h. q g4) (q g4 a4 bb4 c5) (h. d5 fermata q d5)
            (q d5 c5 bb4 c5) (h. a4 fermata q a4) (q bb4 c5 d5 d5)
            (h c5 q d5 fermata d5) (q bb4 c5 d5 d5) (h c5 q bb4 fermata d5)
            (q f5 d5 d5 d5) (h c5 q c5 fermata c5) (q d5 c5 bb4 c5)
            (h a4 q g4 fermata)))
    
    (setf alto
          '((-h. q d4) (q eb4 e e4 gb4 q g4 g4) (h. gb4 fermata q gb4)
            (q g4 e g4 gb4 q g4 a4) (h. gb4 fermata q gb4)
            (q g4 a4 bb4 bb4) (q bb4 e a4 g4 q a4 fermata gb4)
            (q d4 c4 f4 g4) (q g4 e f4 eb4 q d4 fermata f4)
            (q f4 e f4 g4 q a4 g4) (e g4 f4 g4 e4 q f4 fermata e f4 eb4)
            (q d4 e e4 gb4 q g4 g4) (q g4 gb4 d4 fermata)))
    
    (setf tenor
          '((-h. q bb3) (q c4 c4 d4 eb4) (h. a3 fermata q a3)
            (q bb3 c4 d4 eb4) (h. d4 fermata q d4) (q d4 eb4 f4 f4)
            (q g4 e f4 eb4 q d4 fermata a3) (q bb3 e f4 eb4 d4 c4 q bb3)
            (q bb3 a3 f3 fermata bb3) (q c4 d4 e d4 c4 q bb3)
            (e bb3 a3 bb3 g3 q a3 fermata a3) (q bb3 a3 e g3 bb3 q eb4)
            (e d4 s c4 bb3 q c4 b3 fermata)))
    
    (setf bass
          '((-h. q g3) (e c4 bb3 q a3 e g3 f3 q eb3) (h. d3 fermata q c3)
            (q bb2 a2 g2 c3) (h. d3 fermata q d3)
            (q g3 e f3 eb3 d3 c3 q bb2) (q eb3 f3 gb3 fermata d3)
            (q g3 a3 e bb3 a3 g3 f3) (q eb3 f3 bb2 fermata bb3)
            (q a3 bb3 gb3 e g3 f3) (q e3 c3 f3 fermata f3)
            (q bb2 e c3 d3 q eb3 e d3 c3) (h d3 q g2 fermata)))

    DEF-SCORE function defines a score.

    (def-score bach-bwv-0005
               (:title "Bach, BWV-0005"
                :composer "J. S. Bach"
                :key-signature '(g min)
                :time-signature '(4 4)
                :tempo 96
                :layout (choir-satb-layout 'soprano 'alto 'tenor 'bass))
      
      (soprano :omn soprano :channel 1 :sound 'gm :program 0)
      (alto :omn alto :channel 2)
      (tenor :omn tenor :channel 3)
      (bass :omn bass :channel 4))

    chorales_01.png

  3. An example of the direct conversion of OMN score to the standard notation.
    J.S. Bach, Goldberg-Variationen, Variation 18 a 1 Clav.
     
     
    Right hand (1st voices).
    (setf rh1
          '((repeat
             (-h g5 tie)
             (h g5 fs5 tie)
             (q fs5 e g5 fs5 h e5 tie)
             (q e5 e d5 cs5 h d5)
             (-h e5 tie)
             (q e5 e d5 e5 h fs5 tie)
             (q fs5 e a5 g5 h a5 tie)
             (e a5 g5 a5 fs5 h g5)
             (-h e5 tie)
             (h e5 d5 tie)
             (q d5 e e5 fs5 h g5 tie)
             (e g5 fs5 g5 e5 h fs5 tie)
             (q fs5 fs5 h e5 tie)
             (q e5 e5 h d5 tie)
             (q d5 g5 e cs5 d5 q e5 tie)
             (h e5 d5))
    
            (-h a5 tie)
            (h a5 g5 tie)
            (q g5 e a5 b5 h c6 tie)
            (e c6 b5 q c6 h b5)
            (-h e5 tie)
            (h e5 q ds5 e5)
            (h. fs5 e e5 fs5)
            (h_e g5 e fs5 e5 d5)
            (q c5 -q h a5 tie)
            (h a5 g5 tie)
            (q g5 e a5 b5 h c6 tie)
            (e c6 b5 c6 a5 h b5 tie)
            (q b5 b5 h a5 tie)
            (q a5 a5 h g5 tie)
            (q g5 c6 e fs5 g5 q a5 tie)
            (h a5 g5)))
    

    Right hand (2nd voice).

    (setf rh2
          '((repeat
             (w b4)
             (h. a4 e b4 a4)
             (h. g4 e fs4 e4)
             (h fs4 -h)
             (h. g4 e fs4 g4)
             (h. a4 e c5 b4)
             (h_e c5 e b4 c5 a4)
             (h b4 -)
             (w g4)
             (h. fs4 e g4 a4)
             (h_e b4 e a4 b4 g4)
             (h. a4 q)
             (h. g4 q)
             (h. fs4 q b4)
             (e e4 fs4 h. g4)
             (w fs4))
    
            (w c5)
            (h. b4 e c5 d5)
            (h_e e5 e ds5 q e5)
            (w ds5)
            (w g4)
            (q fs4 g4 h a4 tie)
            (q a4 e g4 a4 h b4 tie)
            (e b4 a4 g4 fs4 h e4) (w c5)
            (h. b4 e c5 d5)
            (h_e e5 e d5 e5 c5)
            (h. d5 q)
            (h. c5 q)
            (h. b4 q e5)
            (e a4 b4 h. c5)
            (w b4)))

    Left hand

    (setf lh
          '((repeat
             (-q e g3 a3 q b3 c4)
             (q d4 d3 h d4)
             (-q e e4 d4 q cs4 a3)
             (q d4 d3 d4 c4)
             (q b3 mordent1 e a3 b3 q c4 c3)
             (q c4 e b3 c4 q d4 a3)
             (q d3 e fs3 e3 q fs3 d3)
             (q g3 d3 g2 e g3 a3)
             (q b3 e a3 b3 q cs4 e b3 cs4)
             (q d4 cs4 b3 a3)
             (q g3 fs3 e3 d3)
             (q cs3 e b2 cs3 q d3 e cs3 d3)
             (q b2 e a2 b2 q cs3 e b2 cs3)
             (q as2 e gs2 as2 b2 a2 g2 fs2)
             (q g2 e2 a2 a1)
             (q d2 a2 h d3))
    
            (-q e d3 e3 q fs3 d3)
            (q g3 g2 g3 e a3 b3)
            (q c4 b3 a3 e g3 a3)
            (q. b3 e a3 g3 fs3 e3 ds3)
            (q e3 e e4 d4 q c4 b3) 
            (q a3 e b3 c4 q fs3 e g3 a3)
            (q ds3 e e3 fs3 q b2 e cs3 ds3)
            (q e3 e e4 ds4 q e4 e fs4 g4)
            (q a4 e g4 a4 q fs4 e e4 fs4)
            (q g4 fs4 e4 d4)
            (q c4 b3 a3 g3)
            (q fs3 e e3 fs3 q g3 e fs3 g3)
            (q e3 e d3 e3 q fs3 e e3 fs3)
            (q ds3 e cs3 ds3 e3 d3 c3 b2)
            (q c3 a2 d3 d2)
            (q g2 d3 h g3)))

    Defining a score with PIANO-SOLO-LAYOUT instrument.

    (def-score voices
               (:title "Goldberg-Variationen"
                :subtitle "Variation 18 a 1 Clav."
                :composer "J.S. Bach"
                :key-signature '(c maj)
                :time-signature '(2 2)
                :tempo '("Canone alla Sesta" q 182)
                :layout (piano-solo-layout '(pno-rh1 pno-rh2) 'pno-lh))
    
      (pno-rh1 :omn rh1 :channel 1 :sound 'gm :program 0)
      (pno-rh2 :omn rh2)
      (pno-lh :omn lh))

    bach_01.png

  4. This sound-set below is part of the Opusmodus system and is used here to demonstrate what the group will be focussing on - creating new sound sets for old and new samples, synthesisers or any other software. Opusmodus can control any system that accepts MIDI CC. We have great results with Reaktor and Kyma system.

    ;;;---------------------------------------------------------
    ;;; VIENNA INSTRUMENTS - UPRIGHT BASS
    ;;;---------------------------------------------------------
    
    ;; Patches, keyswitches and controllers change events.
    (def-sound-set VSL-Upright
                   :programs
      (:group Short-and-Long-Notes
              pizz-staccato           (cc1 0 :key f7 :key c1 :key a0)
              pizz-sustain-novib      (cc1 0 :key f7 :key cs1 :key a0)
              pizz-snap               (cc1 0 :key f7 :key d1 :key a0)
              pizz-portato-short      (cc1 64 :key f7 :key c1 :key a0)
              pizz-sustain-vib-light  (cc1 64 :key f7 :key cs1 :key a0)
              pizz-damp               (cc1 64 :key f7 :key d1 :key a0)
              pizz-portato-long       (cc1 127 :key f7 :key c1 :key a0)
              pizz-sustain-vib        (cc1 127 :key f7 :key cs1 :key a0)
              pizz-muted              (cc1 127 :key f7 :key d1 :key a0)
              
              :group Legato-Performances
              pizz-perf-legato        (cc1 0 :key e7 :key c1 :key a0)
              pizz-perf-legato-ghost  (cc1 0 :key e7 :key cs1 :key a0)
              pizz-perf-gliss         (cc1 64 :key e7 :key d1 :key a0)
              pizz-perf-gliss-slow    (cc1 127 :key e7 :key c1 :key a0)
    
              :group Repetitions
              pizz-perf-rep-leg-novib (cc1 40 :key fs7 :key c1 :key a0)
              pizz-perf-rep-por-sl    (cc1 40 :key fs7 :key cs1 :key a0)
              pizz-perf-rep-por-fa    (cc1 40 :key fs7 :key d1 :key a0)
              pizz-perf-rep-leg-vib   (cc1 80 :key fs7 :key c1 :key a0)
    
              :group Upbeats
              pizz-ub-a1-80           (cc1 0 :key g7 :key c1 :key a0)
              pizz-ub-a1-100          (cc1 0 :key g7 :key cs1 :key a0)
              pizz-ub-a1-120          (cc1 0 :key g7 :key d1 :key a0)
              pizz-ub-a1-140          (cc1 0 :key g7 :key ds1 :key a0)
              pizz-ub-a2-80           (cc1 64 :key g7 :key c1 :key a0)
              pizz-ub-a2-100          (cc1 64 :key g7 :key cs1 :key a0)
              pizz-ub-a2-120          (cc1 64 :key g7 :key d1 :key a0)
              pizz-ub-a2-140          (cc1 64 :key g7 :key ds1 :key a0)
              pizz-ub-a3-80           (cc1 127 :key g7 :key c1 :key a0)
              pizz-ub-a3-100          (cc1 127 :key g7 :key cs1 :key a0)
              pizz-ub-a3-120          (cc1 127 :key g7 :key d1 :key a0)
              pizz-ub-a3-140          (cc1 127 :key g7 :key ds1 :key a0)
        
              :group FX
              slides                  (:key gs7 :key c1 :key a0)
              finger-stop             (:key gs7 :key cs1 :key a0)
              body-noises             (:key gs7 :key d1 :key a0)
              arco-sustain-fx         (:key gs7 :key ds1 :key a0)
       )
      
      :controllers
      (:group Default-Settings
              Pitch               0
              Velocity-XF         2
              Volume              7
              Pan                10
              Expression         11
              Reverb-Dry/Wet     14
              Reverb-On/Off      15
              Slot-XF            20
              Start-Scaler       21
              Master-Attack      22
              Master-Release     23
              Master-Filter      24
              Delay-Scaler       25
              Tuning-Scaler      26
              Humanize           27
              Velocity-XF-On-Off 28
              Rsamp-On-Off       29
              Dynamics-Scaler    30
    
              :group Pedal
              Ped                64
              
              :group Matrix
              cc1                 1
              
      )
    )
  5. Four voices.

    (setf vox1 '(q d4 g4 a4 b4 a4 h. g4))
    (setf vox2 '(q b3 e4 g4 g4 fs4 h. d4))
    (setf vox3 '(q g3 b3 d4 d4 d4 h. b3))
    (setf vox4 '(q g3 e3 d3 g3 d3 h. g2))

     

    1st layout:

    (def-score layout1
               (:key-signature '(g maj)
                :time-signature '((1 1 1 1) 4)
                :tempo 85
                :layout (list
                         (treble-layout 'inst1)
                         (treble-layout 'inst2)
                         (treble-layout 'inst3)
                         (treble-layout 'inst4)))
      
      (inst1 :omn vox1 :channel 1 :sound 'gm :program 0)
      (inst2 :omn vox2)
      (inst3 :omn vox3)
      (inst4 :omn vox4)
      )

    post-1-0-24808100-1412350942_thumb.png

     

    2nd layout:

    (def-score layout2
                (:key-signature '(g maj)
                :time-signature '((1 1 1 1) 4)
                :tempo 85
                :layout (list
                         (treble-layout 'inst1)
                         (treble-layout 'inst2)
                         (tenor-layout 'inst3)
                         (bass-layout 'inst4)))
      
      (inst1 :omn vox1 :channel 1 :sound 'gm :program 0)
      (inst2 :omn vox2)
      (inst3 :omn vox3)
      (inst4 :omn vox4)
      )

    post-1-0-24774500-1412350948_thumb.png

     

    3rd layout:

    (def-score layout3
                (:key-signature '(g maj)
                :time-signature '((1 1 1 1) 4)
                :tempo 85
                :layout (bracket-group
                          (treble-layout 'inst1)
                          (treble-layout 'inst2)
                          (tenor-layout 'inst3)
                          (bass-layout 'inst4)))
      
      (inst1 :omn vox1 :channel 1 :sound 'gm :program 0)
      (inst2 :omn vox2)
      (inst3 :omn vox3)
      (inst4 :omn vox4)
      )

    post-1-0-40895900-1412350954_thumb.png

     

    4th layout:

    (def-score layout4
                (:key-signature '(g maj)
                :time-signature '((1 1 1 1) 4)
                :tempo 85
                :layout (choir-satb-layout
                         'inst1 'inst2 'inst3 'inst4))
      
      (inst1 :omn vox1 :channel 1 :sound 'gm :program 0)
      (inst2 :omn vox2)
      (inst3 :omn vox3)
      (inst4 :omn vox4)
      ) 

    post-1-0-33307700-1412350961_thumb.png

  6. The ASSEMBLE-SEQ function is particularly useful when a composer has collected and named short pieces of omn script material and wishes create one from all the pieces.

    (setf vox1 '(q d4 g4 a4 b4 a4 h. g4))
    (setf vox2 '(q b3 e e4 q g4 e fs4 g4 s fs4 e4 q fs4 h. d4))
    (setf vox3 '(q g3 b3 d4 d4 e d4 c4 h. b3))
    (setf vox4 '(q g3 e3 d3 g3 d3 h. g2))

     

    Now we assemble a new motive:

    (assemble-seq (list vox1 vox2 (gen-retrograde vox2) vox1 vox4))

    post-1-0-48562900-1412273479_thumb.png

  7. To add a SEED to your own function and make it work you need to follow three simple rules:

    1. Add keyword SEED into the function arguments.
    2. (rnd-seed seed) should be placed at the beginning of the function.
    3. Nested functions that use seed need to use a (seed) function and not a seed argument.

    Example:

    (defun rnd-number (n low high &key seed)
      (do-verbose ("rnd-number")
        (rnd-seed seed)
        (if (zerop n)
            nil
            (cons (round (+ low (rnd-round 0 (- high low) :seed (seed))))
                  (rnd-number (decf n) low high :seed (seed))))))

     

    Each time we evaluate the expression we get a different result.

    (rnd-number 12 0 5)
    => (0 3 2 5 3 3 4 3 2 2 4 4)

     

    Adding seed to the expression will produce always the same result.

    (rnd-number 12 0 5 :seed 45)
    => (2 2 5 4 5 0 5 3 5 3 1 1)
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy