MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / GetDesiredGridColor

Method GetDesiredGridColor

Source/LinnstrumentControl.cpp:154–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154LinnstrumentControl::LinnstrumentColor LinnstrumentControl::GetDesiredGridColor(int x, int y)
155{
156 if (mBlackout)
157 return kLinnColor_Black;
158
159 if (mGuitarLines)
160 {
161 if (x % 2 == 1)
162 {
163 /*LinnstrumentColor darkColor = kLinnColor_Green;
164 LinnstrumentColor lightColor = kLinnColor_Lime;
165
166 if (x % 6 == 1)
167 {
168 darkColor = kLinnColor_Blue;
169 lightColor = kLinnColor_Cyan;
170 }
171
172 if (x % 4 == 1)
173 {
174 if (y % 4 < 2)
175 return darkColor;
176 return lightColor;
177 }
178 else
179 {
180 if (y % 4 < 2)
181 return lightColor;
182 return darkColor;
183 }*/
184 LinnstrumentColor colors[4];
185 colors[0] = kLinnColor_Lime;
186 colors[1] = kLinnColor_Green;
187 colors[2] = kLinnColor_Cyan;
188 colors[3] = kLinnColor_Blue;
189
190 int horizontalIndex = x / 2;
191 int verticalIndex = (7 - y) / 2;
192
193 return colors[(horizontalIndex + verticalIndex) % 4];
194 }
195 else
196 {
197 return kLinnColor_Black;
198 }
199 }
200
201 int pitch = GridToPitch(x, y);
202 if (TheScale->IsRoot(pitch))
203 return kLinnColor_Green;
204 if (TheScale->IsInPentatonic(pitch))
205 return kLinnColor_Orange;
206 if (TheScale->IsInScale(pitch))
207 return kLinnColor_Yellow;
208 return kLinnColor_Black;
209}
210
211int LinnstrumentControl::GridToPitch(int x, int y)

Callers

nothing calls this directly

Calls 3

IsRootMethod · 0.80
IsInPentatonicMethod · 0.80
IsInScaleMethod · 0.80

Tested by

no test coverage detected