-
Notifications
You must be signed in to change notification settings - Fork 0
/
freq.h
36 lines (31 loc) · 1.2 KB
/
freq.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef FREQ
#define FREQ
#include "raylib.h"
#include "note.h"
#include "util.h"
#define SEMITONE 1.05946 // Moving up a semitone scales the frequency by this factor
#define C4 261.6 // In Hz
// Pitch modifiers refer to the following expressive controls:
// pitch bend, gliss, dive, vibrato, autogliss;
// which can alter the pitch of the currently played note.
float get_note_freq(int note, int octave); /* Get frequency of note at octave, without any pitch modifiers. */
/* Get frequency of note at octave, with pitch modifiers.
NOTE: this does not account for autogliss. */
float get_actual_freq(int note, int octave);
void update_pitch_bend();
bool is_autoglissing();
void update_gliss();
void update_dive();
void update_vib();
void update_autogliss();
/* Returns a table of frequencies for each note in the notetable, accounting for pitch modifiers.
Unlike get_actual_freq(), this accounts for autogliss.
NOTE: ths can be used in solo mode, but you should only trust the entry given by get_cur_note(). */
float *get_cur_actual_freqs();
float get_bend_modifier();
float get_gliss_modifier();
float get_vib_modifier();
float get_dive_modifier();
float get_autogliss_modifier();
void reset_freq_modifiers();
#endif