Jump to content
  • Sign in to follow this  

    fm-violin-synth


    opmo

    A generic and versatile fm instrument.



    Source

    (progn
      (defparameter size 10)
      (defparameter count 50)
      (setf glc-v1
            (gen-length-cartesian
             1 3 'd '? 'w 3 (rnd-sample size '(13 11 10 8))
             '(1 2 3 4 5)))
      
      (setf glc-v2
            (gen-length-cartesian
             1 3 'd '? 'w 3 (rnd-sample size '(13 11 10 8))
             '(1 2 3 4 5)))
      
      (setf glc-va
            (gen-length-cartesian
             1 3 'd '? 'w 3 (rnd-sample size '(13 11 10 8))
             '(1 2 3 4 5)))
      
      (setf glc-vc
            (gen-length-cartesian
             1 3 'd '? 'w 3 (rnd-sample size '(13 11 10 8))
             '(1 2 3 4 5)))
      
      (setf gu-sq
            (gen-unison (list glc-v1 glc-v2 glc-va glc-vc)))
      
      (setf l-v1 (1~ gu-sq))
      (setf l-v2 (2~ gu-sq))
      (setf l-va (3~ gu-sq))
      (setf l-vc (4~ gu-sq))
      
      (setf l-max
            (first
             (sort-desc
              (list (get-count l-v1 :length :note :sum t)
                    (get-count l-v2 :length :note :sum t)
                    (get-count l-va :length :note :sum t)
                    (get-count l-vc :length :note :sum t)))))
      
      (setf
       intervals
       '((0 7) (0 0) (11 5) (-4 5) (-5 5) (0 13) (-5 18)
         (-36 13) (-13 13) (8) (-18 7) (-1 17) (-17 17)
         (-26 13) (-27 23) (-19 19) (-23 23) (18) (0) (7)
         (-14) (13) (-23 5) (-23 2) (-2 2) (6 2) (6 5)
         (19) (-10) (-17 11) (-11 11) (-11 5) (-24 13)
         (1 14) (-14 14) (-29 1) (-1 1) (7 0) (12 6)
         (-21 7) (-7 7) (-18 0) (1 13) (0 1) (-14 13)
         (-10 5) (-14 8) (0 6) (6) (-20 6) (-5 1) (17) (1)
         (-17 5) (-1 5) (-10 16) (-12 8) (0 8) (1 11)
         (-24 4) (-18 16) (-17) (-6 6) (-18 18) (-15 3)
         (-6 31) (-2 5) (-29 6) (-6 13) (-13 6) (7 13)))
      
      (setf pcount (gen-repeat 2 (get-count l-v1 :length :note)))
      (setf gr (gen-repeat (length pcount) (list intervals)))
      (setf gm-v1 (gen-markov gr :size pcount))
      (setf gm-v2 (gen-markov gr :size pcount))
      (setf gm-va (gen-markov gr :size pcount))
      (setf gm-vc (gen-markov gr :size pcount))
      (setf im-v1 (interval-map nil (append-sublist gm-v1)))
      (setf im-v2 (interval-map nil (append-sublist gm-v2)))
      (setf im-va (interval-map nil (append-sublist gm-va)))
      (setf im-vc (interval-map nil (append-sublist gm-vc)))
      (setf s-v1 (span l-v1 im-v1))
      (setf s-v2 (span l-v2 im-v2))
      (setf s-va (span l-va im-va))
      (setf s-vc (span l-vc im-vc))
      (setf ra-v1 (rnd-octaves 'violin s-v1))
      (setf ra-v2 (rnd-octaves 'violin s-v2))
      (setf ra-va (rnd-octaves 'viola  s-va))
      (setf ra-vc (rnd-octaves 'cello  s-vc))
      (setf p-v1 (ambitus 'violin ra-v1 :type :invert))
      (setf p-v2 (ambitus 'violin ra-v2 :type :invert))
      (setf p-va (ambitus 'viola ra-va :type :invert))
      (setf p-vc (ambitus '(a2 c5) ra-vc :type :invert))
      (setf weight '(29 19 8 8 17))
      (setf vel '(0.07 0.1 0.15 0.2 0.25 0.35))
      (setf v-v1 (gen-weight l-max (mapcar 'list vel weight)))
      (setf v-v2 (gen-weight l-max (mapcar 'list vel weight)))
      (setf v-va (gen-weight l-max (mapcar 'list vel weight)))
      (setf v-vc (gen-weight l-max (mapcar 'list vel weight)))
      
      (setf vln1 (make-omn :length l-v1 :pitch p-v1 :velocity v-v1))
      (setf vln2 (make-omn :length l-v2 :pitch p-v2 :velocity v-v2))
      (setf vla (make-omn :length l-va :pitch p-va :velocity v-va))
      (setf vlc (make-omn :length l-vc :pitch p-vc :velocity v-vc))
      
      (do-timeline
       '( 
         vln1 (---x---x-- ---x-x-x-- --x--xx--- ---x------ x-)
         vln2 (---x---x-- ---x---x-- --x--xx--- ---x------ x-)
         vla  (---x---x-- ---x---x-- --x--xx--- ---x------ --)
         vlc  (---x---x-- ---x---xx- --x--xx--- ---x------ --)
         )
       '(gen-pause x) :time '(h h. w))
      
      (defparameter v1 vln1)
      (defparameter v2 vln2)
      (defparameter v3 vla)
      (defparameter v4 vlc)
      (defparameter env
        '((0 0 40 .1000 60 .2000 75 .4000 82 1 90 1 100 0)
          (0 0 60 .1000 80 .2000 90 .4000 95 1 100 0)
          (0 0 10 1 16 0 32 .1000 50 1 56 0 60 0 90 .3000 100 0)
          (0 0 30 1 56 0 60 0 90 .3000 100 0)
          (0 0 50 1 80 .3000 100 0)
          (0 0 40 .1000 60 .2000 75 .4000 82 1 90 1 100 0)
          (0 0 10 1 32 .1000 50 1 90 .3000 100 0)
          (0 0 60 .1000 80 .3000 95 1 100 0)
          (0 0 80 .1000 90 1 100 0)))
      
      (with-sound (:reverb jc-reverb :scaled-to .7)
        (fm-violin-synth v1 v1 v1
                         :bpm 30
                         :degree (rnd-number count 45 85)
                         :fm-index (rnd-number count 0.10 1.0)
                         :reverb-amount 0.30
                         :noise-amount (rnd-number count 0.00 0.004)
                         :amp-env (rnd-sample count env)
                         :glissando-amount (rnd-number count 0.00 0.8))
        
        (fm-violin-synth v2 v2 v2
                         :bpm 30
                         :degree (rnd-number count 45 85)
                         :fm-index (rnd-number count 0.03 1.0)
                         :reverb-amount 0.30
                         :noise-amount (rnd-number count 0.00 0.004)
                         :amp-env (rnd-sample count env)
                         :glissando-amount (rnd-number count 0.00 0.8))
        
        (fm-violin-synth v3 v3 v3
                         :bpm 30
                         :degree (rnd-number count 45 85)
                         :fm-index (rnd-number count 0.10 1.0)
                         :reverb-amount 0.30
                         :noise-amount (rnd-number count 0.00 0.004)
                         :amp-env (rnd-sample count env)
                         :glissando-amount (rnd-number count 0.00 0.8))
        
        (fm-violin-synth v4 v4 v4
                         :bpm 30
                         :degree (rnd-number count 45 85)
                         :fm-index (rnd-number count 0.70 1.0)
                         :reverb-amount 0.30
                         :noise-amount (rnd-number count 0.00 0.004)
                         :amp-env (rnd-sample count env)
                         :glissando-amount (rnd-number count 0.00 0.8)))
      )


    Output

     

     

     

    Next page circular-scanned-synth


    Sign in to follow this  



  • Introduction to OMN the language

    OMN is designed as a scripting language for musical events. It’s not about sounds themselves, it is about their control and organisation in a musical composition. As a linear script rather than a graphic stave, musical events can be transformed, extended, reorganised by powerful computer algorithms. Some sequencers and score writers provide basic algorithms, but they do not represent the way composers now think about the process of music composition. Composing has become such a multi-faceted pro

    opmo
    opmo
    OMN The Language 0
  • Introduction to Opusmodus

    Contents A Contemporary Language for Making Music The Parametric World of Music The Parametric Instrument Learning Opusmodus : A Strategy Important Questions: Necessary Answers

    opmo
    opmo
    Tutorial Guide 0
  • CLM Installation

    Contents CLM Installation Command Line Tools Load and Compile Instruments CLM Installation Common Lisp Music, by William Schottstaedt is a powerful sound synthesis language implemented in Lisp and C. CLM is essentiall

    opmo
    opmo
    CLM Examples 0
×
×
  • Create New...