function draw(p, p5, context) {
const { strokeWeight: sw } = settings;
const { data, maxs, current } = context;
p.background(0);
const maxY = p.height / 2.25;
const a = 1 / data.length;
const r = current / max(maxs);
let pow = 1.25;
let powMax = p.pow(1, 1 / pow);
data.forEach(d => {
d.forEach((v, i) => {
let n = p.map(i, 0, d.length, 0, 1);
let pv = p.pow(n, 1 / pow);
let x = p.map(pv, 0, powMax, 5, p.width - 5);
let y1 = p.map(v, 0, 1, 0, maxY);
let y2 = r * y1;
let y = (y1 + y2) / 2;
let h = p.map(i, 0, d.length, 0, 360);
let s = 100;
let b = p.map(p.sqrt(v), 0, 1, 25, 100);
p.strokeWeight(p.map(r, 0, 1, sw.min, sw.max) + p.map(n, 0, 1, 1, 0));
p.stroke(h, s, b, a);
p.line(x, p.height / 2 + y, x, p.height / 2 - y);
});
});
p.noStroke();
p.fill(0, 0, 100);
p.text(`FPS: ${Math.round(p.frameRate())}`, p.width - 5, 5);
p.text(`LVL: ${Math.min(99, Math.round(100 * r))}`, p.width - 5, 15);
}