X-Git-Url: https://git.sesse.net/?p=pitch;a=blobdiff_plain;f=notes.h;fp=notes.h;h=d5c178ac68beff74b035f9491694d5bbc66e3553;hp=0000000000000000000000000000000000000000;hb=f08b6405c3248dc9c4852bf93d82f87a8c45a179;hpb=c5673c13b754f921853701cf47b6195e357ed2ab diff --git a/notes.h b/notes.h new file mode 100644 index 0000000..d5c178a --- /dev/null +++ b/notes.h @@ -0,0 +1,33 @@ +#ifndef _NOTES_H +#define _NOTES_H 1 + +#include + +#include "config.h" + +struct note { + char notename[16]; + double freq; +}; + +#if TUNING == WELL_TEMPERED_GUITAR +static note notes[] = { + { "E-3", BASE_PITCH/4.0 * (3.0/4.0) }, + { "A-3", BASE_PITCH/4.0 }, + { "D-4", BASE_PITCH/4.0 * (4.0/3.0) }, + { "G-4", BASE_PITCH/4.0 * (4.0/3.0)*(4.0/3.0) }, + { "B-4", BASE_PITCH * (3.0/4.0)*(3.0/4.0) }, + { "E-5", BASE_PITCH * (3.0/4.0) } +}; +#else +static note notes[] = { + { "E-3", BASE_PITCH/4.0 * pow(2.0, -5.0/12.0) }, + { "A-3", BASE_PITCH/4.0 }, + { "D-4", BASE_PITCH/4.0 * pow(2.0, 5.0/12.0) }, + { "G-4", BASE_PITCH/4.0 * pow(2.0, 10.0/12.0) }, + { "B-4", BASE_PITCH/2.0 * pow(2.0, 2.0/12.0) }, + { "E-5", BASE_PITCH/2.0 * pow(2.0, 7.0/12.0) }, +}; +#endif + +#endif /* !defined(_NOTES_H) */