A MIDI piano synthesizer that implements the Karplus Strong physical modeling algorithm.

Dependencies:   mbed USBDevice PinDetect

Committer:
asuszek
Date:
Sun Apr 17 22:27:08 2016 +0000
Revision:
16:b25ca34a705f
Parent:
15:aa5a4c350251
Child:
18:26d93c5b9bb6
Added pluck damping for shaping spectral content. It now sounds pretty dang good.

Who changed what in which revision?

UserRevisionLine numberNew 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 15:aa5a4c350251 18 const float STRING_DAMPING_VARIATION = 0.35;
asuszek 15:aa5a4c350251 19 const float CHARACTER_VARIATION = 0.5;
asuszek 16:b25ca34a705f 20 const float PLUCK_DAMPING = 0.5;
asuszek 16:b25ca34a705f 21 const float PLUCK_DAMPING_VARIATION = 0.25;
asuszek 2:e21bd39bdf46 22
asuszek 2:e21bd39bdf46 23 } // namespace C
asuszek 2:e21bd39bdf46 24
asuszek 2:e21bd39bdf46 25 #endif