-
Notifications
You must be signed in to change notification settings - Fork 0
/
ofApp.h
69 lines (52 loc) · 1.49 KB
/
ofApp.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
#include "ofMain.h"
class ofApp : public ofBaseApp{
private :
const float FREQUENCE_ECH = 44100.; //< La fréquence d'échantillonnage utilisée par la carte son.
float volume = 0.3; //< L'amplitude des signaux (dans l'inerval [0 : 1]
float freq = 440.; //< La fréquence du signal
int formeOnde = 0; //< Paramètre de forme d'onde
int brillance = 1; //< Paramètre de brillance
float t = 0;
float phi = 0;
float deltaPhi = 0;
float DeltaT = 1 / FREQUENCE_ECH;
float phaseAdd;
public:
ofApp() : TAILLE_BUFFER(512)
{
signal = new float[TAILLE_BUFFER];
sigFT = new float[TAILLE_BUFFER];
}
~ofApp()
{
delete[] signal;
delete[] sigFT;
}
void setup();
void update();
void draw();
void keyPressed (int key);
void keyReleased(int key);
void mouseMoved(int x, int y );
void mouseDragged(int x, int y, int button);
void mousePressed(int x, int y, int button);
void mouseReleased(int x, int y, int button);
void windowResized(int w, int h);
void dragEvent(ofDragInfo dragInfo);
void gotMessage(ofMessage msg);
void audioOut(float * input, int bufferSize, int nChannels);
void cbAudioProcess(float * s, int nbEch);
void cbFT(float * s, float * sFT, int nbEch);
ofSoundStream soundStream;
int mouseX;
int mouseY;
int TAILLE_BUFFER;
float *signal;
float *sigFT;
float x_1 = 0;
float x_2 = 0;
float y_1 = 0;
float y_2 = 0;
float filter(float x);
};