-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitialize.pde
More file actions
52 lines (47 loc) · 1.57 KB
/
initialize.pde
File metadata and controls
52 lines (47 loc) · 1.57 KB
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
/* @pjs preload="data/main-screen.png"; */
/* @pjs font="data/BradleyHandITC-18.ttf"; */
/* @pjs font="data/HarlowSolid-32.ttf"; */
// Initializes this program
void initialize() {
// -- Load all Data required --
fntHeading = loadFont("data/Algerian-30.vlw");
fntAuthor = loadFont("data/AgencyFB-Reg-20.vlw");
fntButton = loadFont("data/BerlinSansFBDemi-Bold-20.vlw");
bckImg = loadImage("data/main-screen.png");
// -- Initialize Variables --
msX = 0;
msY = 0;
msXold = 0;
msYold = 0;
hoverIdOld = 0;
hoverId = 50;
clickId = 0;
stateArrow = 1;
stateButtonsLeft = 6;
stateButtonsRight = 6;
// -- Initialize Signals --
plotPoints = 256;
plotMaxIndex = plotPoints - 1;
plotTstart = -0.5;
plotTstop = 0.5;
plotTrange = plotTstop - plotTstart;
plotTstep = plotTrange / plotMaxIndex;
plotFstart = -(plotPoints / (2.0*plotTrange));
plotFstep = 1.0/plotTrange;
stateDefSigNum = 4;
stateDefSig = 2;
sigLHS = new Signal(DefaultSignal.setSignal(stateDefSig));
stateDefSig = (stateDefSig + 1) % stateDefSigNum;
sigRHS = sigLHS.fft().fftShift();
sigLHSabs = sigLHS.abs();
sigRHSabs = sigRHS.abs();
// -- Initialize Plots --
plots = new Plot[4];
plots[0] = new Plot(0.02*width, 0.08*height, 0.44*width, 0.40*height);
plots[1] = new Plot(0.02*width, 0.52*height, 0.44*width, 0.40*height);
plots[2] = new Plot(0.54*width, 0.08*height, 0.44*width, 0.40*height);
plots[3] = new Plot(0.54*width, 0.52*height, 0.44*width, 0.40*height);
// -- Draw the Background, Scale it --
image(bckImg, 0, 0, width, height);
bckImg = get();
}