forked from NERDDISCO/luminave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ideas.js
174 lines (144 loc) · 3.56 KB
/
ideas.js
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/*
in modv: load luminave-connector into index.js to use the color grabbing method and
change it so it can also draw stuff onto canvas so that I can see where it grabs the stuff,
maybe the number? yes that would be nice
mapping component to create a grid of fixtures and map the fixtures to a input (modV)
so that it's not required anymore to create x scenes and x animations to map x fixtures to them
-> Save the mapping into different mappings which can be added to a scene and the scene can be executed
-> clone a mapping to reuse it
save config to file and load config from file
improve the layout of the fixtures
make fixtures searchable
move json generation into worker
scene groups
* update midi-manager mapping to be an array instead of an object
-> BUT what happens with the grid?
-> we can't transform the mapping object into an array when it's changing
because of the active state of a button when it's pressed. MAYBE save the active state
into another element of the midi controller? not into the mapping itself? so
the active state can be updated individually and doesn't trigger the mapping
*/
✅ const channels = [...Array(512)].map(() => 0)
☀️ const fixtures = [{}, {}]
// effects.js
export const flash(n) => ({})
export const fade(n) => ({})
export const rgb(obj) => ({})
/**
*/
import {* as effects} from './effects'
const universums = [{
id: 'FOO',
channels: [...channels]
},
{
id: 'BAR',
channels: [...channels]
}]
// effects.flash
// effects.fade
const animations = [
{
name: 'flash and fade',
id: 'FLASH_FADE',
data: {
// (simple as possible)
keyframes: {
...flash(0, 0.5, 3),
'0': {
dimmer: 255
},
'0.25': {
color: [0, 0, 255]
},
'1': {
color: [0, 255, 0],
dimmer: 200
}
}
}
},
{
name: 'rainbow',
id: 'RAINBOW',
data: {/* animation data */}
}
]
// This is how Keytime wants the timeline / keyframes
'timeline': [{
'name': 'color',
'keyframes': [
{ 'time': 0, 'value': [0, 0, 0] },
{ 'time': 0.25, 'value': [0, 0, 0] },
{ 'time': 0.5, 'value': [255, 0, 0] },
{ 'time': 0.75, 'value': [0, 0, 0] },
{ 'time': .9, 'value': [0, 0, 0] }
]
}]
// Internally we split the keyframes into sub keyframes to have more control over them
keyframes =
[{
'0': 'keyframes0',
'1': 'keyframes0.25'
},
{
'0': 'keyframes0.25',
'1': 'keyframes1'
}]
const scenes = [{
name: 'intro scene',
id: 'INTRO_SCENE',
animations: [{id: 'FLASH_FADE', start: 0, dur: 0.2}, {id: 'RAINBOW', start: 0.4, dur: 0.5}]
}]
const seclectedFixtures = [{
id: 'FUN_GENERATION',
universum: 'FOO',
properties: {
r: {
id: 'RED',
channel: 33
},
g: {
id: 'GREEN',
channel: 34
},
b: {
id: 'BLUE',
channel: 35
}
},
scenes: [{
id: 'INTRO_SCENE',
start: [],
trigger:
'DEVICE:CHANNEL:NOTE' ,
duration: 60000
}]
}]
const midiManger = {
enabled: true,
controllers: [{
id: '489-491-491',
name: 'nanoPAD2',
input: 'nanoPAD2 PAD',
output: 'nanoPAD2 CTRL',
width: 8,
height: 2,
mapping: {
0: {
note: 35
}
}
}]
}
const timelineManager = {
playing: true,
scenes: [
'123-123-123'
],
live: true // true = add a scene and when it's done it's removed / false = add a scene and keep it after it's done
}
// @see https://github.com/NERDDISCO/VisionLord/blob/40d7495d51f2edd8d4e563f1199854cb7c86141b/src/core/BluetoothManager.js
const bluetoothManager = {
devices: []
}