static      up
blank.gif (811 bytes)
2c
m.gif (1431 bytes) piano.gif (2664 bytes) palmer.gif (3094 bytes)
pianoti.gif (2844 bytes)
blank.gif (811 bytes)
down
blank.gif (811 bytes)
home

 


In Passages in Modern Sculpture (RK) read pp. 0-67. Using DBN, create an image in the cubist spirit of "The Guitar" (p. 51). You should use at least 5 'command' definitions.

// a piano, in the cubist style.

paper 20

// the piano strings
command strings H1 V1 H2 V2 H3 V3
{
   line H1 V1 H2 V2
   line H2 V2 H3 V3
   line H3 V3 H1 V1
}
pen 38

repeat f 20 0
{
   strings 20 0 (f*6) 0 (f*50) 100
}

// the sheet music
command music s
{
   repeat a 0 100
   {
      set [a s] a
   }
}

repeat m 1 5
{
   music (28+m*4)
}

// the white keys
command wkeys L D R U
{
   line L D R D
   line L U L D
   line R D R U
   line R U L U
}

pen 0
wkeys 10 10 18 20
wkeys 17 10 25 22
wkeys 24 10 32 24
wkeys 31 10 39 26
wkeys 38 10 46 28
wkeys 45 10 53 30
wkeys 52 10 60 32

// the black keys
command bkeys x y h w
{
   repeat A 0 20
   {
      pen (100-(4*A))
      line x (y+A) (x+w) (y+A)
   }
}

bkeys 20 23 10 8
bkeys 35 23 10 8
bkeys 50 23 10 8
bkeys 65 23 10 8

// the piano body
load dbngraphics.dbn
circle 30 70 35 100

// and when you're done playing, you lower the 
// cover of the piano.

command cover
{
   repeat e 0 100
   {
      pen 80
      line 10 e 25 70
   }
}
cover