-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.h
43 lines (37 loc) · 1.54 KB
/
main.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
37
38
39
40
41
42
43
#ifndef _H
#define _H
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
typedef enum {MODE_RAW = 0, MODE_VGM, MODE_NGP} psgmode_t;
typedef enum {WAIT_N = 0, WAIT_NTSC, WAIT_PAL} wait_t;
float * cos_lut;
float * sin_lut;
float * window_lut;
psgmode_t mode;
float overlap;
unsigned int freq_step;
unsigned long samplerate_in;
unsigned int freq_res;
float attenuation_lut[16];
unsigned int updates_per_frame, update_rate, psg_channels, fps;
unsigned int sim;
extern psgmode_t mode;
extern char * modestr[3];
unsigned long file_length;
int parse_args(int argc, char * argv[]);
int load_wav(const char * filename, float ** result);
int gen_sim(const unsigned int frame_size, const unsigned long frame_count, char channels,
unsigned int const * frequencies, unsigned int const * volumes);
int make_LUTs(unsigned long window_size);
void lowpass(float * in_buffer, float * out_buffer, float cutoff, float sample_rate, unsigned long length);
void highpass(float * in_buffer, float * out_buffer, float cutoff, float sample_rate, unsigned long length);
int out_vgm(unsigned char ** out_buffer, unsigned int const * frequencies, unsigned int const * volumes,
unsigned long frame_count);
int out_raw(unsigned char ** out_buffer, unsigned int const * frequencies, unsigned int const * volumes,
const unsigned long frame_count, const unsigned int n);
int out_ngp(unsigned char ** out_buffer, unsigned int const * frequencies, unsigned int const * volumes,
const unsigned long frame_count);
#endif