Visualization: Fire Effect (simplified for WebAssembly)
| 406 | |
| 407 | // Visualization: Fire Effect (simplified for WebAssembly) |
| 408 | void drawFireEffect(float peak) { |
| 409 | // Simple fire effect without buffer |
| 410 | clearDisplay(); |
| 411 | |
| 412 | // Add heat at bottom based on audio |
| 413 | int heat = 100 + (peak * 155 * audioGain.value() * autoGainValue); |
| 414 | heat = fl::min(heat, 255); |
| 415 | |
| 416 | for (int x = 0; x < WIDTH; x++) { |
| 417 | for (int y = 0; y < HEIGHT; y++) { |
| 418 | // Simple gradient from bottom to top |
| 419 | int heatLevel = heat * (HEIGHT - y) / HEIGHT; |
| 420 | heatLevel = heatLevel * random(80, 120) / 100; // Add randomness |
| 421 | heatLevel = fl::min(heatLevel, 255); |
| 422 | |
| 423 | int ledIndex = xyMap(x, y); |
| 424 | if (ledIndex >= 0 && ledIndex < NUM_LEDS) { |
| 425 | leds[ledIndex] = HeatColor(heatLevel); |
| 426 | } |
| 427 | } |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | // Visualization: Plasma Wave |
| 432 | void drawPlasmaWave(float peak) { |
no test coverage detected