<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_mathml.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="id48043140">
  <name>Producing Drum Sounds and Displaying the Drum</name>
  <metadata>
  <md:version>1.1</md:version>
  <md:created>2007/12/19 19:03:03.909 US/Central</md:created>
  <md:revised>2007/12/19 20:12:40.738 US/Central</md:revised>
  <md:authorlist>
      <md:author id="tanwee">
      <md:firstname>Tanwee</md:firstname>
      
      <md:surname>Misra</md:surname>
      <md:email>tanwee.misra@rice.edu</md:email>
    </md:author>
      <md:author id="kriti">
      <md:firstname>Kriti</md:firstname>
      
      <md:surname>Charan</md:surname>
      <md:email>kriti@rice.edu</md:email>
    </md:author>
      <md:author id="jchow">
      <md:firstname>Janice</md:firstname>
      
      <md:surname>Chow</md:surname>
      <md:email>jchow@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="tanwee">
      <md:firstname>Tanwee</md:firstname>
      
      <md:surname>Misra</md:surname>
      <md:email>tanwee.misra@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="kriti">
      <md:firstname>Kriti</md:firstname>
      
      <md:surname>Charan</md:surname>
      <md:email>kriti@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="jchow">
      <md:firstname>Janice</md:firstname>
      
      <md:surname>Chow</md:surname>
      <md:email>jchow@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>Drum display</md:keyword>
    <md:keyword>Drum sounds</md:keyword>
    <md:keyword>Google SketchUp</md:keyword>
  </md:keywordlist>

  <md:abstract>This module discusses our approach to play the hit drum's sound and display it's image on the animated interface.</md:abstract>
</metadata>
  <content>
    <section id="id-13913816962">
      <name>Producing Drum Sounds and Displaying the Drum</name>
      <para id="id48047517">Once we have determined which drum has been hit, we play the appropriate sound and display the corresponding image. The drum sounds and images are preloaded in separate .mat files at the beginning of the program using the load command to expedite execution.</para>
      <para id="id48047528">
        <code>load drumsounds</code>
      </para>
      <para id="id48047536">
        <code>load drumpics</code>
      </para>
      <section id="id-568198782037">
        <name>Drum Sounds:</name>
        <para id="id48047550"><code>drumpics.mat</code> was created by importing drum samples in the wav format using <code>wavread()</code> and <code>wavadd()</code>. <code>wavread(‘wavfile’)</code> is a Matlab function that stores wav files as an Nx2 matrix. <code>wavadd(sound1,sound2)</code> is a function that we created to allow the simultaneous play of two different sounds. For example, if both the snare and the crash cymbal were hit at the same time, we zero pad the shorter matrix and combine them as one sound matrix. In the main program, the Matlab function <code>soundsc(sound, fs)</code> plays the corresponding sound file, where ‘fs’ is the sampling rate. Our wav files were sampled at 22 kHz to allow for smaller sound variables without affecting the sound quality too much. All of our drum samples were obtained free online from a Yamaha 9000 drum kit. </para>
      </section>
      <section id="id-739226867771">
        <name>Drum Pictures:</name>
        <para id="id48047619"><code>drumsounds.mat</code> was created by importing jpeg files using the <code>imread() </code>Matlab command to store the images as variables. The images were created from Google SketchUp, a free 3D modeling program available online. Different views were created to simulate the feel of animation.</para>
        <figure id="id48047646"><media type="image/jpg" src="graphics1.jpg">
            <param name="height" value="144"/>
            <param name="width" value="262"/>
          </media>
        <caption>Main view</caption></figure>
        <figure id="id48045453"><media type="image/jpg" src="graphics2.jpg">
            <param name="height" value="135"/>
            <param name="width" value="248"/>
          </media>
        <caption>Crash cymbal and snare were hit</caption></figure>
      </section>
    </section>
  </content>
</document>
