Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Sound/Sound.h
- Revision:
- 22:028f1627c262
- Parent:
- 14:9cfe0041cc4e
- Child:
- 30:08cc4ec58d07
--- a/Sound/Sound.h Sat May 23 14:40:40 2020 +0000 +++ b/Sound/Sound.h Sat May 23 16:12:52 2020 +0000 @@ -2,33 +2,47 @@ #define SOUND_H #include "mbed.h" -//#include "LUTs.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/Destructor - Sound(); - - ~Sound(); +/**Constructor */ +Sound(); + +/** Destructor */ +~Sound(); //Variables -int waveform; -int frequency; +int waveform; //waveform number select +int frequency; //frequency of note -//Functions +//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; -double i_d; - - +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 \ No newline at end of file