A MIDI piano synthesizer that implements the Karplus Strong physical modeling algorithm.
Dependencies: mbed USBDevice PinDetect
Constants.h@13:bb0ec927e458, 2016-04-17 (annotated)
- Committer:
- asuszek
- Date:
- Sun Apr 17 21:35:23 2016 +0000
- Revision:
- 13:bb0ec927e458
- Parent:
- 6:688698f814c0
- Child:
- 15:aa5a4c350251
Implemented basic Karplus Strong. The sample rate had to be halved in order to process the algorithm for each sample without crashing.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
asuszek | 2:e21bd39bdf46 | 1 | |
asuszek | 2:e21bd39bdf46 | 2 | #ifndef AS_CONSTANTS_H |
asuszek | 2:e21bd39bdf46 | 3 | #define AS_CONSTANTS_H |
asuszek | 2:e21bd39bdf46 | 4 | |
asuszek | 6:688698f814c0 | 5 | //#define DEBUG |
asuszek | 6:688698f814c0 | 6 | #define USE_PWM true |
asuszek | 2:e21bd39bdf46 | 7 | |
asuszek | 2:e21bd39bdf46 | 8 | /* A namespace for all global constants. |
asuszek | 2:e21bd39bdf46 | 9 | * Access using C::VAR_NAME |
asuszek | 2:e21bd39bdf46 | 10 | */ |
asuszek | 2:e21bd39bdf46 | 11 | namespace C { |
asuszek | 2:e21bd39bdf46 | 12 | |
asuszek | 13:bb0ec927e458 | 13 | const int SAMPLE_RATE = 22050; |
asuszek | 2:e21bd39bdf46 | 14 | const int MAX_POLYPHONY = 4; |
asuszek | 2:e21bd39bdf46 | 15 | const int MIN_FREQUENCY = 110; |
asuszek | 13:bb0ec927e458 | 16 | |
asuszek | 13:bb0ec927e458 | 17 | const float STRING_DAMPING = 0.7; |
asuszek | 13:bb0ec927e458 | 18 | const float STRING_DAMPING_VARIATION = 0.3; |
asuszek | 2:e21bd39bdf46 | 19 | |
asuszek | 2:e21bd39bdf46 | 20 | } // namespace C |
asuszek | 2:e21bd39bdf46 | 21 | |
asuszek | 2:e21bd39bdf46 | 22 | #endif |