This page is optimized for mobile devices, if you would prefer the desktop version just click here

0.6 The code

This module contains a description of and a link to the functions we created in Matlab to implement the drum kit.

To get a better understanding for how we implemented the drum kit, you might want to have a look at our Matlab code.

The code is available at: http://www.geocities.com/tapthat_virtualdrum/tapthat.html

Essential files:

proj_301.m- This is a wrapper function to set up video acquisition and collect frames from the camera.

detectcolor.m- This function checks for presence of the LED.

coord.m- This function finds the position of the LED in each frame, computes its velocity and hit-point.

drumdet.m- This function determines which drum was hit.

drumdisp.m- It produces the sound and displays the image corresponding to the drum that was hit.

Files for debugging and setting up the system:

adjust.m- This is mainly for the user’s convenience. It helps adjust the position of the user with respect to the drums.

checkframe.m- This can be used to verify that the color detection works properly for a particular frame.

<< Chapter < Page Page > Chapter >>

Read also:

OpenStax, Tap that: a virtual drum kit. OpenStax CNX. Dec 19, 2007 Download for free at http://cnx.org/content/col10502/1.1
Google Play and the Google Play logo are trademarks of Google Inc.
Jobilize.com uses cookies to ensure that you get the best experience. By continuing to use Jobilize.com web-site, you agree to the Terms of Use and Privacy Policy.