-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.cpp
More file actions
107 lines (93 loc) · 2.7 KB
/
Main.cpp
File metadata and controls
107 lines (93 loc) · 2.7 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*
==============================================================================
This file was auto-generated!
It contains the basic startup code for a Juce application.
==============================================================================
*/
#include "../JuceLibraryCode/JuceHeader.h"
#include "Launchpad.h"
void drawSweep(Launchpad *launchpad);
//==============================================================================
int main (int argc, char* argv[])
{
Launchpad launchpad;
// test changing file 2
Logger::outputDebugString("!!Hellow World!!");
Logger::outputDebugString("Default Layout");
launchpad.print_keys();
launchpad.set_map_XY();
Logger::outputDebugString("XY Layout");
launchpad.print_keys();
launchpad.set_map_DrumRack();
Logger::outputDebugString("DrumRack Layout");
launchpad.print_keys();
if(launchpad.isOutputOpen())
{
launchpad.resetLaunchpad();
/* launchpad.set_map_XY();
launchpad.turnOnAllLow();
launchpad.turnOnAllMed();
launchpad.turnOnAllHigh();
launchpad.resetLaunchpad();
launchpad.setKey(0, 0, Launchpad::LaunchpadKey::Green, true);
launchpad.setKey(0, 7, Launchpad::LaunchpadKey::Green, true);
launchpad.setKey(7, 0, Launchpad::LaunchpadKey::Green, true);
launchpad.setKey(7, 7, Launchpad::LaunchpadKey::Green, true);
launchpad.resetLaunchpad();
launchpad.setKey(0, 0, Launchpad::LaunchpadKey::Green, false);
launchpad.setKey(0, 7, Launchpad::LaunchpadKey::Green, false);
launchpad.setKey(7, 0, Launchpad::LaunchpadKey::Green, false);
launchpad.setKey(7, 7, Launchpad::LaunchpadKey::Green, false);
launchpad.writeBufNow();*/
launchpad.resetLaunchpad();
// for(int i = 0; i < 8; i++)
// {
// for(int j = 0; j < 8; j++)
// {
// launchpad.setKey(i, j, Launchpad::LaunchpadKey::Amber, false);
// }
// }
// launchpad.writeBufNow();
while(1)
{
drawSweep(&launchpad);
}
launchpad.resetLaunchpad();
}
return 0;
}
void drawSweep(Launchpad *launchpad)
{
for(int i = 0; i < 8; i++)
{
for(int j = 0; j < 8; j++)
{
launchpad->setKey(i, j, Launchpad::LaunchpadKey::Red, false);
}
launchpad->writeBufNow();
}
for(int i = 0; i < 8; i++)
{
for(int j = 0; j < 8; j++)
{
launchpad->setKey(i, j, Launchpad::LaunchpadKey::Green, false);
}
launchpad->writeBufNow();
}
for(int i = 0; i < 8; i++)
{
for(int j = 0; j < 8; j++)
{
launchpad->setKey(j, i, Launchpad::LaunchpadKey::Red, false);
}
launchpad->writeBufNow();
}
for(int i = 0; i < 8; i++)
{
for(int j = 0; j < 8; j++)
{
launchpad->setKey(j, i, Launchpad::LaunchpadKey::Green, false);
}
launchpad->writeBufNow();
}
}