Tutorial 8: Creating Synthesizer: Apiit
Tutorial 8: Creating Synthesizer: Apiit
* To see the demo file, open T7-synthesizer.swf, you can hear the sounds of the piano by pressing the key z, x, c, v, b, n, m, q, w, e, r, t, y, u, i s, d, g, h, j, 2, 3 5, 6 and 7 or click the white key or black key. 1. 2. 3. 4. Open the file T7-synthesizer.fla. You can see there are two layers of frame named Piano and PianoDetail. Create two new layers and named them as WhiteKeys and BlackKeys. Open the library (Ctrl+L). With the WhiteKeys layer selected, drag 15 WhiteKey buttons from the library onto the Stage. Use the Align panel (Window>Align) to line up and distribute the keys. With the BlackKeys layer selected, drag 10 BlackKey buttons from the library onto the Stage. Use the Align panel ( Window>Align) to line up and distribute the keys. Place the BlackKey buttons over the WhiteKey buttons as they appear on a piano keyboard. Make the arrangement as shown in Picture 1.
5.
1 white key
st
APIIT
6.
Now see the library. You can see that all sound files have been imported to flash for you. In the library, right click each sound file and choose Linkage. In the Linkage Properties dialog box, click Export for ActionScript. Write the sounds name in the Identifier text box. Click OK. Point to the first white key on the left hand side, press F9 and type the following scripts:
7.
8.
Point and select the first black key, press F9 and type the following scripts:
9.
Try to figure out the scripts for the rest of the keys. Make sure the keys will produce the appropriate sound and key on the computer keyboard. To make sure the key expression correspond with the piano keys, use the arrangement shown in Picture 2.
APIIT
Picture 2 10. Play the movie. Test your keyboard either click the buttons or press the appropriate keys on your keyboard. Make some music! That's all, run your movie and check it all works. If not go back though this tutorial and check you have not missed anything,
THE END
APIIT