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@14:9cfe0041cc4e, 2020-05-19 (annotated)
- Committer:
- lukeocarwright
- Date:
- Tue May 19 15:04:33 2020 +0000
- Revision:
- 14:9cfe0041cc4e
- Child:
- 22:028f1627c262
Actually make proper sound atlast. Checked Concert A against piano. included more preprocessor debug (SLOW TIME) for Debug if output check required w. printf
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lukeocarwright | 14:9cfe0041cc4e | 1 | #ifndef SOUND_H |
lukeocarwright | 14:9cfe0041cc4e | 2 | #define SOUND_H |
lukeocarwright | 14:9cfe0041cc4e | 3 | |
lukeocarwright | 14:9cfe0041cc4e | 4 | #include "mbed.h" |
lukeocarwright | 14:9cfe0041cc4e | 5 | //#include "LUTs.h" |
lukeocarwright | 14:9cfe0041cc4e | 6 | |
lukeocarwright | 14:9cfe0041cc4e | 7 | |
lukeocarwright | 14:9cfe0041cc4e | 8 | class Sound |
lukeocarwright | 14:9cfe0041cc4e | 9 | { |
lukeocarwright | 14:9cfe0041cc4e | 10 | public: //---------------------------------------------------------------------- |
lukeocarwright | 14:9cfe0041cc4e | 11 | //Constructor/Destructor |
lukeocarwright | 14:9cfe0041cc4e | 12 | Sound(); |
lukeocarwright | 14:9cfe0041cc4e | 13 | |
lukeocarwright | 14:9cfe0041cc4e | 14 | ~Sound(); |
lukeocarwright | 14:9cfe0041cc4e | 15 | |
lukeocarwright | 14:9cfe0041cc4e | 16 | //Variables |
lukeocarwright | 14:9cfe0041cc4e | 17 | int waveform; |
lukeocarwright | 14:9cfe0041cc4e | 18 | int frequency; |
lukeocarwright | 14:9cfe0041cc4e | 19 | |
lukeocarwright | 14:9cfe0041cc4e | 20 | //Functions |
lukeocarwright | 14:9cfe0041cc4e | 21 | uint16_t sound_main(bool initial, int waveform, int frequency); //runs main sound function |
lukeocarwright | 14:9cfe0041cc4e | 22 | |
lukeocarwright | 14:9cfe0041cc4e | 23 | |
lukeocarwright | 14:9cfe0041cc4e | 24 | private: //--------------------------------------------------------------------- |
lukeocarwright | 14:9cfe0041cc4e | 25 | //Variables |
lukeocarwright | 14:9cfe0041cc4e | 26 | uint16_t i; |
lukeocarwright | 14:9cfe0041cc4e | 27 | double i_d; |
lukeocarwright | 14:9cfe0041cc4e | 28 | |
lukeocarwright | 14:9cfe0041cc4e | 29 | |
lukeocarwright | 14:9cfe0041cc4e | 30 | |
lukeocarwright | 14:9cfe0041cc4e | 31 | //Functions |
lukeocarwright | 14:9cfe0041cc4e | 32 | uint16_t wavetable_itt(uint16_t i, int frequency); //itterates wavetable |
lukeocarwright | 14:9cfe0041cc4e | 33 | }; |
lukeocarwright | 14:9cfe0041cc4e | 34 | #endif |