misc.h (309B)
- #include <math.h> // pow
- #include <stdio.h> // putchar
- // https://pages.mtu.edu/~suits/NoteFreqCalcs.html
- #define TWELTH_ROOT_2 1.059463094359
- double
- note_to_hertz(double ref_tune, int steps) {
- return ref_tune*pow(TWELTH_ROOT_2,steps);
- }
- void
- silence(int dur) {
- for(int t = 0;t<dur;t++)putchar( 0x00 );
- }