{
const lightCount = 3
if (synth) {
let lights = []
let noteLights = []
const voiceCount = synth.MAX_VOICES
for (let i = 0; i < lightCount; i++) {
lights = [...lights, 0, 0, 0, 0, 0, 0]
}
for (let i = 0; i < 12; i++) {
const nl = noteLight(i, 0, 0, 0.6, 0.4)
noteLights = [...noteLights, nl[0], nl[1], nl[2]]
}
return renderLightShow(350, 350, lightCount, 7, (t, dt) => {
lights.fill(0)
for (let i = 0; i < voiceCount; i++) {
const v = synth.v[i]
const idx = v.chid * 6
if (idx < lights.length && v.enabled && v.chid !== 9) {
const n = v.note % 12
const o = Math.floor(v.note / 12)
lights[idx] = noteLights[n * 3] * ((2 - v.chid) + 1) / 3
lights[idx + 1] = noteLights[n * 3 + 1] * ((2 - v.chid) + 1) / 3
lights[idx + 2] = noteLights[n * 3 + 2] * ((2 - v.chid) + 1) / 3
lights[idx + 3] = 1
lights[idx + 4] = 175 + Math.cos([23-v.note % 24] / 12 * Math.PI) * (40 + (50 * (2 - v.chid)))
lights[idx + 5] = 175 + Math.sin([23-v.note % 24] / 12 * Math.PI) * (40 + (50 * (2 - v.chid)))
}
}
return lights
})
}
}