Common Music Examples
Prev | Chapter 9. Examples | Next

## Common Music Examples

Example 9.13. 2 Part Polyphony

    (defparameter *part* (new fms:part :instr :piano :partid 'pno))

    (defun polygen (voice len minp maxp)
      (process repeat len
    	   output (new fms:note
    		    :off (now)
    		    :voice voice
    		    :partid 'pno
    		    :note (between minp maxp)
    		    :dur 1/2)
    	   wait 1/2))

    (events (list (polygen 1 20 60 80) (polygen 2 20 40 60)) "/tmp/fomus.ly" :parts *part* :view t)

> Output

Example 9.14. 2 Part Polyphony (FOMUS Chooses the Voice)

    (defparameter *part* (new fms:part :instr '(:piano :simultlim 1) :partid 'pno))

    (defun polygen (voice len minp maxp)
      (process repeat len
    	   output (new fms:note
    		    :off (now)
    		    :voice voice
    		    :partid 'pno
    		    :note (between minp maxp)
    		    :dur 1/2)
    	   wait 1/2))

    (events (list (polygen '(1 2) 20 50 80) (polygen '(1 2) 20 40 70)) "/tmp/fomus.ly" :parts *part* :view t)

> Output

Example 9.15. 3 Part Polyphony

    (defparameter *part* (new fms:part :instr '(:piano :simultlim 1) :partid 'pno))

    (defun polygen (voice len minp maxp)
      (process repeat len
    	   output (new fms:note
    		    :off (now)
    		    :voice voice
    		    :partid 'pno
    		    :note (between minp maxp)
    		    :dur 1/2)
    	   wait 1/2))

    (events (list (polygen '(1 2 3) 20 50 70) (polygen '(1 2 3) 20 50 70) (polygen '(1 2 3) 20 50 70))
    	"/tmp/fomus.ly" :parts *part* :view t)

> Output

Example 9.16. 6 Part Polyphony

    (defparameter *parts*
      (list (new fms:part :name "Violin 1" :instr :violin :partid 'vlns
    	     :props '((:distr (v2 2) (v3 3) (v4 4) (v5 5) (v6 6))))
    	(new fms:part :name "Violin 2" :instr :violin :partid 'v2)
    	(new fms:part :name "Violin 3" :instr :violin :partid 'v3)
    	(new fms:part :name "Violin 4" :instr :violin :partid 'v4)
    	(new fms:part :name "Violin 5" :instr :violin :partid 'v5)
    	(new fms:part :name "Violin 6" :instr :violin :partid 'v6)))

    (defun polygen (voice len minp maxp)
      (process repeat len
    	   output (new fms:note
    		    :off (now)
    		    :voice voice
    		    :partid 'vlns
    		    :note (between minp maxp)
    		    :dur 1/2)
    	   wait 1/2))

    (events (list (polygen '(1 2 3 4 5 6) 20 55 70)
    	      (polygen '(1 2 3 4 5 6) 20 60 75)
    	      (polygen '(1 2 3 4 5 6) 20 65 80)
    	      (polygen '(1 2 3 4 5 6) 20 70 85)
    	      (polygen '(1 2 3 4 5 6) 20 75 90)
    	      (polygen '(1 2 3 4 5 6) 20 80 95))
    	"/tmp/fomus.ly" :parts *parts* :quality 3 :view t)

> Output

Prev | Up | Next
Lisp Examples | Home | Text Input File Examples