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.
Sound/Sound.h
- Committer:
- lukeocarwright
- Date:
- 2020-05-23
- Revision:
- 22:028f1627c262
- Parent:
- 14:9cfe0041cc4e
- Child:
- 30:08cc4ec58d07
File content as of revision 22:028f1627c262:
#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