MCPcopy Create free account
hub / github.com/VCVRack/Befaco / processStartup

Method processStartup

src/MotionMTR.cpp:148–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146 }
147
148 void processStartup(const ProcessArgs& args) {
149 float time = startupTimer.process(args.sampleTime);
150 const float ringTime = 0.4;
151
152 if (time < ringTime) {
153 int light = floor(NUM_LIGHTS_PER_DIAL * time / ringTime);
154 setLightHSBSmooth(LIGHT_1 + 3 * light, args, 360 * time / ringTime, 1., 1.);
155 }
156 else if (time < 2 * ringTime) {
157 time -= ringTime;
158 int light = floor(NUM_LIGHTS_PER_DIAL * time / ringTime);
159 setLightHSBSmooth(LIGHT_2 + 3 * light, args, 360 * time / ringTime, 1., 1.);
160 }
161 else if (time < 3 * ringTime) {
162 time -= 2 * ringTime;
163 int light = floor(NUM_LIGHTS_PER_DIAL * time / ringTime);
164 setLightHSBSmooth(LIGHT_3 + 3 * light, args, 360 * time / ringTime, 1., 1.);
165 }
166 else {
167 startingUp = false;
168 }
169 }
170
171 void setLightRGB(int lightId, float R, float G, float B) {
172 lights[lightId + 0].setBrightness(R);

Callers

nothing calls this directly

Calls 1

processMethod · 0.45

Tested by

no test coverage detected