Computer Music - Spring 2014/HW1

From MCIS Wiki
Jump to: navigation, search

The Four Note Study

We'll take an extra day on this to give you some time to get things done. Work session in H101 at 7:30 Monday. For Monday's class bring in something to share like an idea function. --Professor Peterson 04:39, 25 January 2014 (UTC)

This assignment's purpose is to familiarize you with basic Euterpea ideas and the basic ideas of abstraction and recursion. You will be expected to consider the aesthetics of your composition and create a piece with an interesting structure and sound.

This is due on Tuesday, January 28, midnight. Hurst 101 will be available.

The Elements

Begin by selecting 4 notes to serve as your basic structure. These should be assigned to four variables as whole notes - I suggest you use short, simple names: n1, n2, n3, and n4.

Create at least 6 "idea" functions which use these four notes in a way that creates a small musical idea. These functions should have parameters so that they can be used in different ways. Here are a couple simple ones:

rhy4 d1 d2 d3 d4 = tempo (1/d1) n1 :+: tempo (1/d2) n2 :+: tempo (1/d3) n3 :+: tempo (1/d4) n4

fcn3 d = n1 :=: (rest d :+: n2) :=: (rest (2*d) :+: n3) :=: (rest (3*d) :+: n4)

You can alter the four notes in ways that are not too unrecognizable. Some examples:

  • Play them backwards
  • Overlap them using :=:
  • Invert them (go up instead of down)
  • Change the order slightly
  • Create rhythmic figures on each note
  • Slightly change the pitch of a note

Each of these creates an idea (a single piece of music). Your composition should also explore transformation of ideas. Create at least one of each of the following:

  • A function which combines multiple ideas in a fixed pattern (such as an ABA form)
  • A function which uses integer recursion to create a piece of music from an integer and one or more ideas.
  • A function which is generalized over the some style of idea function - since different ideas may have different parameters you have to select a specific type of idea to generalize over.

Structure

Create your composition by assigning different components to variables and combining these with the basic Euterpea operators such as :+:, :=:, transpose, instrument changes, dynamic changes, and other such. Each component can use the idea and transformation functions as needed. You shouldn't need any individual notes, just ideas generated by the notes.

Parameters

The final composition should be clearly labeled in your code. A short wiki report will be required but that won't be due immediately. Your composition should last between 30 and 60 seconds.


Example

Here's a submission from Kevin. It might not have all of the elements I requested but it's quite good!

n1 = c 3 wn
n2 = ef 3 wn
n3 = e 3 wn
n4 = b 2 wn
m1 = n1 :+: n2 :+: n3 :+: n4

rhy4 d1 d2 d3 d4 = tempo (1/d1) n1 :+: tempo (1/d2) n2 :+: tempo (1/d3) n3 :+: tempo (1/d4) n4

test1 = rhy4 dqn en dqn en

slapbass2 :: Music a -> Music a
slapbass2 m = instrument SlapBass2 m

steeldrums :: Music a -> Music a
steeldrums m = instrument SteelDrums m

test3 = slapbass2 m1
test4 = steeldrums(tempo 1 ( transpose 12(rhy4 dqn en dqn en)))

up = transpose

turn n = n1 :+: up n n1 :+: n1 :+: 
         n2 :+: up n n2 :+: n2 :+: 
		 n3 :+: up n n3 :+: n3 :+: 
		 n4 :+: up n n4 :+: n4

lturn n = n1 :+: up n n1 :+: n1 :+: n2 :+: n3 :+: up n n3 :+: n3 :+: n4
		 
test5 = tempo 10 $ turn 5 :=: turn 9

test6 = slapbass2 test5

twice m = m :+: m
xrepeat 1 m = m
xrepeat n m = m :+: xrepeat (n-1) m

test7 = slapbass2 (xrepeat 2 (transpose 7 (rhy4 en en en en)) :+: xrepeat 2 (transpose 5 (rhy4 en en en en)):+: xrepeat 4 (rhy4 en en en en) :+:
	 xrepeat 2 (rhy4 en en en en):+: xrepeat 2 (transpose 5 (rhy4 en en en en)):+:
     xrepeat 4 (rhy4 en en en en):+: xrepeat 4 (transpose 5 (rhy4 en en en en)) :+:
	 xrepeat 4 (rhy4 en en en en):+: xrepeat 2 (transpose 7 (rhy4 en en en en)) :+:
	 xrepeat 2 (transpose 5 (rhy4 en en en en)):+: xrepeat 4 (rhy4 en en en en)) :+: slapbass2 n1

rns = xrepeat 2 (rhy4 en en en en):+: xrepeat 2 (transpose 5 (rhy4 en en en en))
rns1 = rns :=: (rest sn :+: rns)
	 
test8 = test7 :=: test4

test9 = steeldrums (xrepeat 2(rhy4 dqn en dqn en) :+: xrepeat 2(tempo 8 (lturn 2)) :+: transpose 7 (tempo 8 (lturn 3)) :+:
      transpose 5 (tempo 8 (lturn 3)) :+: xrepeat 2(tempo 8 (lturn 3)))
	  
test10 = test9 :=: (xrepeat 4 wnr :+: test7)

rc :: Int -> (Music a -> Music a) -> Music a
      -> Music a
rc 0 fn m = rest 0
rc n fn m = m :+: rc (n-1) fn (fn m)

test11 = rc 2 (\x -> transpose 5 x :=: x) (test4)

test14 = tempo 2 (rc 4 (\x -> transpose 5 x :=: x) (test4))

test12 = test9 :=: (xrepeat 4 wnr :+: test7) :=: (xrepeat 8 wnr :+: test11)

rhy4r d1 d2 d3 d4 = tempo (1/d1) n4 :+: tempo (1/d2) n3 :+: tempo (1/d3) n2 :+: tempo (1/d4) n1

test13 = rhy4r en dqn en dqn

maj m = m :=: transpose 4 m :=: transpose 7 m

inv1 = test4 :+: steeldrums (transpose 12 (transpose 5(test13))) :+: test11
	 :+: rc 2 (\x -> transpose 5 x :=: x) (steeldrums (transpose 12 (transpose 5(test13) :=: test13))) :+: test14
	 :+: tempo 2 (xrepeat 2 (steeldrums (transpose 19 test13))) :+: tempo 2 (xrepeat 2 (steeldrums (transpose 17 test13)))
	 :+: tempo 2 (xrepeat 2 (transpose 5 (test4) :=: test4)) :+: test4 :+: steeldrums (maj (c 4 wn))
	 
play1 = test9 :=: (xrepeat 4 wnr :+: test7) :=: (xrepeat 8 wnr :+: inv1)

--play1 is the full composition here.