Once you have made soundtrack, write the controlling code. Here’s a C code fragment to help get you started (check
http://www.hytherion.com/beattidp/comput/pport.htm for information on using inpout32.dll) : halloween.cpp, below. Once the sequence is started, the computer plays the soundtrack and syncs peripheral devices through the controller. In this particular setup, which uses the halloween2002.wav soundtrack mentioned above, I would explain to trick-or-treaters that they came just in time to witness an execution. After some thunder and lightning, a small motor would trigger the blade of a guillotine, built from cardboard, aluminum foil, and modular extrusion (8020, borrowed from work) to fall. As a rubber mask stuffed with a pillow fell into a basket, warm water sprayed onto the trick-or-treaters resulting in shrieks, shouts, and frantic brushing to remove the “blood.” I then offered candy from a basket with a duplicate mask stuffed with spaghetti, tomato sauce, and beets. Everyone choose the candy. While this sequence ran open loop through pre-programmed maneuvers, adding feedback to make the display responsive to sounds or motion is quite doable.