2d animations
space

 

Making a Piano Keyboard in Illustrator

 

This step by step tutorial will show you how to draw a keyboard illustration using rectangles, grids, move and transform effects.

 

1. Create a New Document


Make a new document with a custom size of 600 px width and 120 px height. Name it ‘Keyboard’.

2. Create a background


Choose the Rectangle Tool and set the fill to black and stroke to none. Click once on the artboard and make a rectangle 500 px wide by 120 px height. Press OK.



Choose the black rectangle and navigate to the Transform Panel and position the lower left corner at X: 0 px and Y: 0 px.

 


Select the black rectangle and round the corners by going to menu > Effect > Convert to Shape > Rounded Rectangle. Use the same width and height of the original rectangle for the Absolute values, set the rectangle to Width: 600 px and Height: 120 px, with a corner radius of 9 px. Press OK.

 

 

 

 

 

 

 


Rename the layer “black background” and lock the layer.

 


3. Draw 52 white keys


Select the Create New Layer icon on the Layers panel and rename the layer “white keys”.

Draw the key at the left. Choose the Rectangle Tool and set the fill to white and stroke to black (1 px). Click once on the artboard and define a rectangle 9 px wide by 50 px height. Press OK.

 



Select the white rectangle and to the Transform Panel and position the lower left corner to X: 16 px and Y: 16 px.

 

 


Select the Menu > Effect > Convert to Shape > Rounded Rectangle, to round the edges of the key. Using the same width and height dimensions of the original rectangle for the Absolute values, set the rectangle to Width: 9 px and Height: 50 px, with a corner radius of 2 px. Press OK.

Select the white key and make duplicates using the menu option Effect > Distort & Transform > Transform. In the Move section, set the Horizontal to 9 px, Vertical to 0 px, number of copies to 62, and check the Preview box to confirm that the keys appear as below. Press OK.

 

 

 


Draw a rectangle to cover the rounded edges of the top of the keys. With no objects selected, choose the Rectangle Tool and set the fill to black and stroke to none. Click once on the artboard and define a rectangle 470 px wide by 5 px height. Press OK.

 



To cover the rounded edges at the top, position the strip above the keys. With the Transform Panel, set the bottom centre position to X: 250 px and Y: 62 px.

 



Lock this layer.

 


4. Draw the black keys


Open a new layer named “black keys”.

Draw the first black key.


Choose the Rectangle Tool and set the fill to black and stroke to none. Click once on the artboard and define a rectangle 5 px wide by 30 px height. Press OK.



Select the black key and use the Transform Panel to position it. Set the top centre position to X: 25.5 px and Y: 62 px.



Select the black key and access the Move options by double clicking the Selection Tool (circled in red below). Check the Preview box to see where the resulting key will be. Set the Horizontal position to 17 px and Vertical to 0 px. Click copy and the two keys will be positioned as shown below.

Result:


Select the second black key and access the Move options by double clicking the Selection Tool. Check the Preview box. Set the Horizontal position to 10 px and Vertical to 0 px. Click Copy.




Select the third black key and access the Move options by double clicking the Selection Tool. Check the Preview box. Set the Horizontal position to 17 px and Vertical to 0 px. Click Copy.


Result:



Select the fourth black key and access the Move options by double clicking the Selection Tool. Check the Preview box. Set the Horizontal position to 9.5 px and Vertical to 0 px. Click Copy.

Result:



Select the fifth black key and repeat the Move from the last step by pressing Cmd+D (Mac) or Ctrl+D (PC). The sixth key is now positioned as shown below. (If you need to access the Move options again to copy the fourth key, the Horizontal is 9.5 px.)


Choose the five black keys (shown in green below) using the Selection Tool to marquee around them. From the menu, choose Effect > Transform Effect > Transform. In the Move section, set the Horizontal to 63 px, Vertical to 0 px, number of copies to 6, and check the Preview box to confirm that the keys appear as below. Press OK.

 

 

 

 

 

 

 

 

 

 


Lock the “black keys” layer


5. Draw staff


Make a new layer named “staff”.


 


Choose the Rectangle Tool, set the fill to none and choose a neutral colour for the stroke with the stroke size set to 0.5 px. The colour used here is from the Neutrals 3 swatch library that came with CS3. Click once on the artboard and define a rectangle 470 px wide by 20 px height. Press OK.

 

 


Select the rectangle and go to menu > Object > Path > Split into Grid. Set the Number of Rows to 4, with a Gutter of 0 px. You may have to set the Number of Rows to 2 and change the gutter to 0 before you are able to set the Number of Rows to 4. Leave the Number of Columns set to 1. Press OK.

 


 


Set the centre position to X: 300 px and Y: 91 px to position the staff with the Transform Panel.



To deselect the staff, click on the artboard.

Lock the “staff” layer.

 


6. Add music


Create a new layer named “music”.



The symbols below were created using the Text Tool and the MetDemo font with a Font Size of 16 px. The fill colour is the same neutral colour as the staff stroke colour, and the stroke for the text is None. Type the symbols and notes. The letters/symbols: (colon), K, Q, and W in the MetDemo font create the treble clef, sharp symbol, and quarter and half notes.

Use the Selection Tool to choose all of the text. Choose Type> Create Outlines from the menu. Ungroup the letters with the shortcut Sh+Cmd+G (Mac) or Sh+Ctrl+G (PC), or with Object > Ungroup. Now all pieces can be selected, moved and positioned into the staff area individually, using the Selection Tool or selecting them from the layers panel.


My tune is from one of my Phantom of the Opera favorites, simplified and spread out to fill the space above the keys.
Spread the tune symbols to fill the space above the keys and the piano is ready.

 

 

 


Experiment with different color backgrounds, gradients and artistic effects. Scale the image or use portions of the keyboard to suit your print or web project.


space
space