Luke Cartwright / Mbed 2 deprecated ELEC2645_Project_el18loc_nearlythere

Dependencies:   mbed

Sound/Sound.h

Committer:
lukeocarwright
Date:
2020-05-26
Revision:
30:08cc4ec58d07
Parent:
22:028f1627c262
Child:
31:cfdb014ff086

File content as of revision 30:08cc4ec58d07:

#ifndef SOUND_H
#define SOUND_H

#include "mbed.h"

/**Sound class
 * @author Luke Cartwright, University of Leeds
 * @brief fetches data from wavetables and
 * @itterates through to next samples
 * @date May 2020
*/

class Sound
{
public: //----------------------------------------------------------------------
/**Constructor */
Sound();
   
/** Destructor */ 
~Sound();
    
//Variables
int waveform; //waveform number select
int frequency; //frequency of note
    
//Methods

/**Main sound function
* @Takes in waveform type and frequency.
* @ Outputs Unsigned int of wavetable value.
* @ (Self itterates)
*/
 uint16_t sound_main(bool initial, int waveform, int frequency); //runs main sound function


private: //---------------------------------------------------------------------
//Variables
uint16_t i; //itterator as an uint
double i_d; //itterator as a double

//Functions
/**Iterator function.
* @Itterates through wavetable values.
* @Outputs Next i value for sound_main function.
*/
uint16_t wavetable_itt(uint16_t i, int frequency); //itterates wavetable
};
#endif