Jump to content

opmo

Administrators
  • Posts

    2,903
  • Joined

  • Last visited

Posts posted by opmo

  1. Here it is:

     

    (defun length-to-rnd-rest (n sequence &key seed)
      (let (state)
        (setf state *init-seed*)
        (setf seed (rnd-seed seed))
        (do-verbose ("length-to-rnd-rest :seed ~s" seed)
          (let* ((len (length sequence))
                 (sel (rnd-order
                       (append (gen-repeat n t) (gen-repeat (- len n) nil))
                       :seed (seed)))
                 (result (loop for i in sel
                               for j in sequence
                               collect (if (null i) j (* j -1)))))
            (init-state state)
            result))))

     

    (setf lengths '(15/16 15/32 1/32 1/32 1/32 61/32 1/32 1/2 1/32 5/32 1/32 13/16 17/32 3/2 9/16 7/16))
    
    (length-to-rnd-rest 5 lengths)
    => (15/16 15/32 1/32 -1/32 1/32 61/32 1/32 -1/2 -1/32 -5/32 1/32 -13/16 17/32 3/2 9/16 7/16)
    
    (length-to-rnd-rest 5 lengths :seed 5)
    => (15/16 -15/32 1/32 1/32 1/32 61/32 1/32 -1/2 1/32 -5/32 1/32 13/16 -17/32 -3/2 9/16 7/16)

     

    I could make something more useful with steps, omitting existing rests and of course working with length symbols and events (omn).

  2. You can't use pitches and articulation elements without length element.

     

    (setf protochords (gen-repeat 5 (respell '(q eb2eb4g4bb4 arp-down 
    c2c4e4ab4 ab2eb4ab4b4 arp-down d2d4f4a4 arp-down bb2d4f4bb4 arp-down 
    g2eb4g4b4 arp-down c2c4eb4g4 arp-down ab2eb4ab4b4 arp-down d2d4gb4a4 arp-down 
    bb2d4gb4bb4 arp-down g2d4g4bb4 arp-down c2c4eb4g4 arp-down ab2c4eb4ab4 arp-down 
    f2db4f4a4 arp-down bb2db4f4bb4 arp-down g2d4g4bb4 arp-down eb2eb4gb4bb4 arp-down 
    ab2c4eb4ab4 arp-down f2db4f4a4 arp-down d2d4f4a4 arp-down g2d4g4bb4 arp-down 
    eb2eb4g4bb4 arp-down))))
  3. Place the coursor on the end of the expression and press cmd-1

     

    (tonnetz '(c4e4g4) transition
             :net 11
             :join 1
             :rotate rotation)

     

    I would suggest to contact Stephane and take a introduction lesson.

    All example in the How-to etc... are working 🙂

     

    I copied the code and I don't see any errors:

    (setf pitches '(c4 cs4 fs4 g4 c5))
    (setf p-transp (pitch-transpose (pitch-to-integer pitches) (gen-repeat 5 (list pitches))))
    (setf r-transp (gen-retrograde p-transp :flatten t))
    (setf c-ambitus (ambitus '(c2 c3) p-transp))
    (setf p-ambitus (ambitus '(c2 c3) p-transp :type :flat-invert))
    (setf s-ambitus (ambitus '((c2 c3) (b2 f3) (g3 cs4) (fs4 g5) (c4 c5)) p-transp))
    (setf lengths (span p-transp '(1/8)))
    (setf interlude (span s-ambitus '(1/16)))
    (setf dynamics (mclist '(p mp mf f ff)))
    (setq r-dynamics (mclist '(ff f mf mp p)))
    
    (setf p-rh1 (make-omn
                 :length lengths
                 :pitch p-transp
                 :velocity dynamics))
    
    (setf p-lh1 (make-omn
                 :length lengths
                 :pitch c-ambitus
                 :velocity dynamics))
    
    (setf p-rh2 (make-omn
                 :length interlude
                 :pitch s-ambitus
                 :velocity r-dynamics))
    
    (setf p-lh2 (gen-pause p-rh2 :section '(0 1 2 3 4)))
    
    (setf p-rh3 (make-omn
                 :length lengths
                 :pitch r-transp
                 :velocity dynamics))
    
    (setf p-lh3 (make-omn
                 :length lengths
                 :pitch p-ambitus
                 :velocity dynamics))
    
    (setf rh-1 (assemble-seq p-rh1 p-rh2 p-rh3))
    (setf lh-1 (assemble-seq p-lh1 p-lh2 p-lh3))
    
    (setf timesigs (get-time-signature rh-1 :group '((5))))
    
    (def-score lesson-16
               (:key-signature 'chromatic
                :time-signature timesigs
                :flexible-clef t
                :tempo 80
                :layout (piano-layout 'piano-rh 'piano-lh))
      
      (piano-rh
       :omn rh-1
       :channel 1
       :sound 'gm
       :program 'acoustic-grand-piano)
      
      (piano-lh
       :omn lh-1)
      )

     

    Quit and restart the app and run the code from above.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy