Skip to content
Snippets Groups Projects
IEMEnergyVisualizer.js 37.91 KiB
let rms = [];

function drawDots() {
  for (let i = 0; i < 426; ++i) {
    let rmsScaled = map(rms[i], 0, 0.3, 0, 1); // Scaling may need to be adjusted if the animations are not visible enough, or if the animations are too strong.
    if (rmsScaled > 0.0001) { // threshold may need to be adjusted if the animations are not visible enough, or if the animations are too strong.
      particles.push(new Particle(width * x[i], height * y[i], rmsScaled*0.04, rmsScaled*0.04)); // Scaling may need to be adjusted if the animations are not visible enough, or if the animations are too strong.
    }
  }
}

const x = [0.976837135372,   0.0176268989539,  0.0114620757904, 0.0425955768578,  0.0239748770185,
           0.0425955768578,  0.0114620757904,  0.0176268989539, 0.00898705943039, 0.0182393276191,
           0.0624823073865,  0.0564490684749,  0.0857138680378, 0.0680714117668,  0.0857138680378,
           0.0564490684749,  0.0624823073865,  0.0182393276191, 0.00898705943039, 0.0549277866063,
           0.0633968749299,  0.105272683358,   0.0990875104171, 0.126749830193,   0.109828406044,
           0.126749830193,   0.0990875104171,  0.105272683358,  0.0633968749299,  0.0549277866063,
           0.0066450866111,  0.0382124684888,  0.0995159205824, 0.106813924508,   0.146452759215,
           0.139888298574,   0.166130750986,   0.149739455508,  0.166130750986,   0.139888298574,
           0.146452759215,   0.106813924508,   0.0995159205824, 0.0382124684888,  0.0066450866111,
           0.0538865598943,  0.0842470933795,  0.143138870768,  0.148899304816,   0.186356734406,
           0.17922479165,    0.204178050048,   0.188169363721,  0.204178050048,   0.17922479165,
           0.186356734406,   0.148899304816,   0.143138870768,  0.0842470933795,  0.0538865598943,
           0.00556936527831, 0.101655062499,   0.129899315655,  0.186075587996,   0.18995242712,
           0.225239822512,   0.217381304828,   0.241142570784,  0.225398694725,   0.241142570784,
           0.217381304828,   0.225239822512,   0.18995242712,   0.186075587996,   0.129899315655,
           0.101655062499,   0.00556936527831, 0.0539483461671, 0.150379310274,   0.175458917057,
           0.228530428903,   0.230199896392,   0.263303336737,  0.254581950175,   0.277226376315,
           0.261650599941,   0.277226376315,   0.254581950175,  0.263303336737,   0.230199896392,
           0.228530428903,   0.175458917057,   0.150379310274,  0.0539483461671,  0.0185240147501,
           0.104991233116,   0.200380042338,   0.221128400298,  0.270653805968,   0.269817878464,
           0.300710706892,   0.291008810418,   0.312596919597,  0.297107894226,   0.312596919597,
           0.291008810418,   0.300710706892,   0.269817878464,  0.270653805968,   0.221128400298,
           0.200380042338,   0.104991233116,   0.0185240147501, 0.0713094686559,  0.159616717136,
           0.251862194241,   0.267038704855,   0.312555664464,  0.308946567427,   0.337598208198,
           0.326813961101,   0.347396673982,   0.331924447242,  0.347396673982,   0.326813961101,
           0.337598208198,   0.308946567427,   0.312555664464,  0.267038704855,   0.251862194241,
           0.159616717136,   0.0713094686559,  0.133791013281,  0.218670509029,   0.304895353833,
           0.313258617005,   0.354314949745,   0.347700037709,  0.374082468379,   0.362127773281,
           0.381749950523,   0.366233107219,   0.381749950523,  0.362127773281,   0.374082468379,
           0.347700037709,   0.354314949745,   0.313258617005,  0.304895353833,   0.218670509029,
           0.133791013281,   0.211277101547,   0.282753790535,  0.359392451655,   0.359801780205,
           0.395986826186,   0.386173294117,   0.410265948498,  0.397064885707,   0.415767920549,
           0.400151436198,   0.415767920549,   0.397064885707,  0.410265948498,   0.386173294117,
           0.395986826186,   0.359801780205,   0.359392451655,  0.282753790535,   0.211277101547,
           0.310191545576,   0.351933162011,   0.415099088002,  0.406633830933,   0.437608666519,
           0.424447576794,   0.446241125641,   0.43172868175,   0.449552474751,   0.433786032779,
           0.449552474751,   0.43172868175,    0.446241125641,  0.424447576794,   0.437608666519,
           0.406633830933,   0.415099088002,   0.351933162011,  0.310191545576,   0.43287305282,
           0.425408274968,   0.471606235875,   0.453681232285,  0.479205405555,   0.462594568361,
           0.482093844459,   0.466214799003,   0.483199330226,  0.467235936689,   0.483199330226,
           0.466214799003,   0.482093844459,   0.462594568361,  0.479205405555,   0.453681232285,
           0.471606235875,   0.425408274968,   0.43287305282,   0,                0.56712694718,
           0.501363937464,   0.528393764125,   0.500842500609,  0.520794594445,   0.50067992028,
           0.517906155541,   0.500614023784,   0.516800669774,  0.500595447386,   0.516800669774,
           0.500614023784,   0.517906155541,   0.50067992028,   0.520794594445,   0.500842500609,
           0.528393764125,   0.501363937464,   0.56712694718,   0,                0.689808454424,
           0.577272097811,   0.584900911998,   0.548001655455,  0.562391333481,   0.538766384547,
           0.553758874359,   0.53501482174,    0.550447525249,  0.533956595054,   0.550447525249,
           0.53501482174,    0.553758874359,   0.538766384547,  0.562391333481,   0.548001655455,
           0.584900911998,   0.577272097811,   0.689808454424,  0.788722898453,   0.65061925637,
           0.640607548345,   0.595042984058,   0.604013173814,  0.576916765366,   0.589734051502,
           0.569505700234,   0.584232079451,   0.56741145068,   0.584232079451,   0.569505700234,
           0.589734051502,   0.576916765366,   0.604013173814,  0.595042984058,   0.640607548345,
           0.65061925637,    0.788722898453,   0.866208986719,  0.719624420925,   0.695104646167,
           0.641865780572,   0.645685050255,   0.61519687401,   0.625917531621,   0.604177573724,
           0.618250049477,   0.601054438989,   0.618250049477,  0.604177573724,   0.625917531621,
           0.61519687401,    0.645685050255,   0.641865780572,  0.695104646167,   0.719624420925,
           0.866208986719,   0.928690531344,   0.783522739718,  0.748137805759,   0.688397728557,
           0.687444335536,   0.653678670622,   0.662401791802,  0.639126303759,   0.652603326018,