Audio-Driven Laser Tetris Final Project Report Group 16: Cameron Lewis Xin (James) Sun TA: Kyeong-Jae Lee 6.111: Introductory Digital Systems Laboratory May 18, 2006 Abstract The purpose of this project is to demonstrate an advanced version of the classic arcade game Tetris. Our version boasts a much more dynamic and random game-play experience than conventional implementations. Users manipulate the falling objects as in the traditional version, but the entire game is also driven by music and projected onto a large screen using a laser raster system. The audio-based elements of the game operate in the following manner: the drop rate of the game pieces is controlled by music frequencies and magnitudes. The audio input to the system is connected to the AC97 audio decoder on the Labkit, which digitizes the analog signals and pass them into the FPGA for processing. The video components consist of two display elements. First is the VGA monitor displaying the Tetris game window and an audio visualization. Second is the laser display, which interfaces with the core graphics output of the Tetris game by a separate laser controller module. That module’s task is to rapidly modulate the output of the laser at appropriate times as to create a low resolution, scanning raster image of the Tetris playing field. 1Table of Contents I. Background Overview 3 II. Module Descriptions and Implementations 3 • Audio Unit 3 • Game Engine Unit 5 • VGA Display Unit 9 • Laser Display Unit 10 III. Testing and Debugging 12 • Game Engine and VGA Display 12 • Audio Processor and Laser Display 14 IV. Conclusion 15 List of Figures Figure 1: System Overview Block Diagram 3 Figure 2: Tetris Game Pieces 3 Figure 3: Audio Unit Block Diagram 4 Figure 4: Audio Spectrum Analyzer 4 Figure 5: Game Engine Unit Block Diagram 5 Figure 6: Minor FSM State Diagram 5 Figure 7: Major FSM State Diagram 6 Figure 8: Randomizer Waveform 6 Figure 9: Rotation Classification 7 Figure 10: Example of Rotation Sequence 7 Figure 11: Collision Detection Diagram 8 Figure 12: Collision Detection FSM Waveform 8 Figure 13: VGA Display Unit Block Diagram 9 Figure 14: Screenshot of VGA Display 9 Figure 15: VGA Timing Diagram 10 Figure 16: Laser Display Module Block Diagram 10 Figure 17: Laser Projection Assembly 11 Figure 18: Laser Display in Operation 11 Figure 19: Laser Raster Test Pattern 12 Figure 20: IR Break-Beam Pulses on Oscilloscope 15 List of Tables Table 1: Table of Counter Module Output Signals 7 2I. Background Overview This project is a dynamic rendition of the classic arcade game Tetris. A VGA monitor displays a frequency-based visualization in addition to the game itself, and the game also sends the video feed to a laser display system for synchronous projection onto a remote surface. The Tetris game responds to real-time audio input by changing the pace of falling blocks in response to the current background music. Essentially, the entire system is divided into four main components, as depicted below in figure 1: Figure 1: System Overview Block Diagram Figure 2 illustrates the seven Tetris game pieces, which are conveniently denoted by the letters they resemble, namely I, T, O, L, J, S and Z. Note that all pieces consist of four blocks. Figure 2: The seven game pieces. (Courtesy of Wikipedia) The player can manipulate these pieces with left, right, rotate, and drop maneuvers. Scores are accumulated based on certain scenarios, such as settling a piece at the bottom. The falling piece is chosen at random, and the drop rate is synced to the background music. II. Module Descriptions and Implementations Audio Unit (recorder.v, audio_processor.v, audio_fft.v, display.v) The purpose of the audio module is to perform a real-time FFT (Fast Fourier Transform) on the current audio data, extract intensities of specific frequency-ranges, and use that information to control the speed of the falling Tetris blocks in the main game. This was designed to create the effect of a “responsive” game environment where the current background music has a direct effect on the game play, where Tetris pieces fall faster during intense bass notes. This feature has been implemented in many innovative audio visualization packages such as those used in modern software-based media players. The block diagram of the Audio Unit is shown on the next page in figure 3: 3Debouncer / Synchronizer Figure 3: Audio Unit Block Diagram In our implementation, the audio unit interfaces with the CoreGen FFT module and computes a 1024 point FFT. The magnitudes of the 16 lowest frequency ranges are displayed as bars of varying height on the VGA display, and the intensity of the frequency bucket covering the range 47-94Hz (low frequencies) is used to trigger changes in block drop speed. The way this works is relatively simple. If the magnitude of the frequency range described above exceeds a specific threshold, then the system flashes an LED on the Labkit and sends a faster game “pace” setting to the main Tetris engine. The 16 bar spectrum analyzer shown below depicts the current FFT results in real-time. A red line on the left marks the threshold level which much be exceeded to trigger an “audio event” which affects game speed. Figure 4: The audio spectrum analyzer. Frequency range is 0-752 Hz. Verilog module integration organization is quite straightforward. The module recorder.v contains all the AC97-specific interface modules which are instantiates to create the low level audio IO connections. The module audio_processor.v deals with instantiation of the 1024 pt FFT as well as frequency extraction and spectrum analyzer data formatting/scaling. The module audio_fft.v is the FFT module created by Coregen. Finally, the module display.v is a shared resource between the VGA system and the audio system, and is used to display both the Tetris game and the spectrum analyzer on the VGA display screen. 4Game Engine Unit (minorfsm.v, majorfsm.v, cdfsm.v, etc.) Figure 5: Game Engine Unit Block Diagram Figure 5 above illustrates the inner workings of the Game Engine Unit. Individual modules are discussed in more detail below. Some modules that have been instantiated many times
View Full Document