Fastled firework code modification help please

Greetings,

I have found 2 really cool 1 dimensional Firework codes that look really awesome but I need some help adapting them for my purpose please.

Ultimately I want to be able to choose a random position on my led strip and "explode" a random colored firework from that position. I want to be able to scale the maximum width of the firework so it doesn't

it seems that the code i am playing with started here:
http://www.anirama.com/1000leds/1d-fireworks/

but the code I want to convert it to looks more like this:

Unfortunately Daves version is way out of my league and I have no idea how to get that working with fastled.

Any ideas how to modify this to better suit my concept?

Thanks in advance.

This is what I have so far... just a single color explosion going off at a known position. I am only using explodeLoop0 to try to get an understanding of how to scale the size etc but im getting lost.

#include <FastLED.h>
#define NUM_LEDS 196
#define DATA_PIN 4
#define COLOR_ORDER GRB 
#define LED_TYPE WS2812B
#define NUM_SPARKS NUM_LEDS / 2
CRGB leds[NUM_LEDS];
float sparkPos[NUM_SPARKS];
float sparkVel[NUM_SPARKS];
float sparkCol[NUM_SPARKS];
float gravity =-.0019;
float dying_gravity = gravity;
float c1 = 127;
float c2 = 50;
float flarePos;

void setup() {
  delay(1000);
  FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
}

void loop() {

  flarePos = 160;//random(60,150); // NUM_LEDS/2);
  explodeLoop0();
  delay(1000);
  
//  delay(10);
//  flare();
//  explodeLoop1();
//  delay(10);
//  flare();
//  explodeLoop2();
//  delay(10);
//  flare();
//  explodeLoop3();
//  delay(10);
//explodeLoop4();
//  delay(10);
}

void flare() {
  flarePos = 0;
  float flareVel = float(random16(60, 80)) / 90;
  float brightness = 1;

    for (int i = 0; i < 5; i++) { 
      sparkPos[i] = 0; sparkVel[i] = (float(random8()) / 255) * (flareVel / 5);
      sparkCol[i] = sparkVel[i] * 1000;
      sparkCol[i] = constrain(sparkCol[i], 0, 255); } 
  FastLED.clear(); while (flareVel >= -.05) {
    for (int i = 0; i < 5; i++) {
      sparkPos[i] += sparkVel[i];
      sparkPos[i] = constrain(sparkPos[i], 0, 120);
      sparkVel[i] += gravity;
      sparkCol[i] += -.8;
      sparkCol[i] = constrain(sparkCol[i], 0, 255);
      leds[int(sparkPos[i])] = HeatColor(sparkCol[i]);
      leds[int(sparkPos[i])] %= 50; 
    }
   leds[int(flarePos)] = CHSV(0, 0, int(brightness * 255));
   FastLED.show();
   FastLED.clear();
   flarePos += flareVel;
   flareVel += gravity;
   brightness *= .99;
  }
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void explodeLoop0() {
  
  int gSparks = flarePos / 2;
  for (int i = 0; i < gSparks; i++) { 
    sparkPos[i] = flarePos; 
    sparkVel[i] = (float(random16(0, 20000)) / 10000.0) - 1.0;                                            //(float(random16(0, 20000)) / 10000.0) - 1.0;
    sparkCol[i] = abs(sparkVel[i]) * 500;
    sparkCol[i] = constrain(255, 0, sparkCol[i]);
    sparkVel[i] *= .9;//flarePos / NUM_LEDS;            //.5;                    // large numbers mean fast expansion 
  }
  sparkCol[0] = 255;
  while(sparkCol[0] > c2/128) { 
    FastLED.clear();
      for (int i = 0; i < gSparks; i++) { 
      sparkPos[i] += sparkVel[i]; 
      sparkPos[i] = constrain(sparkPos[i], 0, 100);                    //constrain(sparkPos[i], 0, NUM_LEDS); 
      sparkVel[i] += dying_gravity; 
      sparkCol[i] *= .99; 
      sparkCol[i] = constrain(255, 0, sparkCol[i]);  

      
      if(sparkCol[i] > c1) { 
        leds[int(sparkPos[i])] = CRGB((255 * (sparkCol[i] - c1)) / (255 - c1), 255, 255);
      }
      else if (sparkCol[i] < c2) { 
        leds[int(sparkPos[i])] = CRGB(0, (255 * sparkCol[i]) / c2, 0) ;
      }
      else { 
        leds[int(sparkPos[i])] = CRGB(0, 255, (255 * (sparkCol[i] - c2)) / (c1 - c2));
      }
    }
    dying_gravity *= 0.985;
    FastLED.show();
  }
  //FastLED.clear();
  //FastLED.show();
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void explodeLoop1() {
  
  int sSparks = flarePos / 2;
  for (int i = 0; i < sSparks; i++) { 
    sparkPos[i] = flarePos; 
    sparkVel[i] = (float(random16(0, 20000)) / 10000.0) - 1.0; 
    sparkCol[i] = abs(sparkVel[i]) * 500;  
    sparkCol[i] = constrain(sparkCol[i], 0, 255); 
    sparkVel[i] *= flarePos / NUM_LEDS;
  } 
  sparkCol[0] = 255; 
  while(sparkCol[0] > c2/128) { 
    FastLED.clear();
      for (int i = 0; i < sSparks; i++) { 
      sparkPos[i] += sparkVel[i]; 
      sparkPos[i] = constrain(sparkPos[i], 0, NUM_LEDS); 
      sparkVel[i] += dying_gravity; 
      sparkCol[i] *= .99; 
      sparkCol[i] = constrain(sparkCol[i], 0, 255);  
      if(sparkCol[i] > c1) { 
        leds[int(sparkPos[i])%NUM_LEDS] = CRGB(random8(180), random8(180), (255 * (sparkCol[i] - c1)) / (255 - c1));
      }
      else if (sparkCol[i] < c2) { 
        leds[int(sparkPos[i])%NUM_LEDS] = CRGB((255 * sparkCol[i]) / c2, random8(8), random8(8));
      }
      else { 
        leds[int(sparkPos[i])%NUM_LEDS] = CRGB(random8(80), (255 * (sparkCol[i] - c2)) / (c1 - c2), random8(18));
      }
    }
    dying_gravity *= .985;
    FastLED.show();
  }
  FastLED.clear();
  FastLED.show();
}
//////////////////////////////////////////////////////////////////////////////////////////////////
void explodeLoop2() {
  
  int rSparks = flarePos / 2;
  for (int i = 0; i < rSparks; i++) { 
    sparkPos[i] = flarePos; sparkVel[i] = (float(random16(0, 20000)) / 10000.0) - 1.0; 
    sparkCol[i] = abs(sparkVel[i]) * 500;  
    sparkCol[i] = constrain(sparkCol[i], 0, 255); 
    sparkVel[i] *= flarePos / NUM_LEDS; 
  }
  sparkCol[0] = 255; 
  while(sparkCol[0] > c2/128) { 
    FastLED.clear();
    for (int i = 0; i < rSparks; i++) { 
      sparkPos[i] += sparkVel[i]; 
      sparkPos[i] = constrain(sparkPos[i], 0, NUM_LEDS); 
      sparkVel[i] += dying_gravity; 
      sparkCol[i] *= .99; 
      sparkCol[i] = constrain(sparkCol[i], 0, 255);  
      if(sparkCol[i] > c1) { 
        leds[int(sparkPos[i])] = CRGB(255, 255, (255 * (sparkCol[i] - c1)) / (255 - c1));
      }
      else if (sparkCol[i] < c2) { 
        leds[int(sparkPos[i])] = CRGB((255 * sparkCol[i]) / c2, 0, 0);
      }
      else { 
        leds[int(sparkPos[i])] = CRGB(255, (255 * (sparkCol[i] - c2)) / (c1 - c2), 0);
      }
    }
    dying_gravity *= .985;
    FastLED.show();
  }
  FastLED.clear();
  FastLED.show();
}
//////////////////////////////////////////////////////////////////////////////////////////////////
void explodeLoop3() {
  
  int bSparks = flarePos / 2;
    for (int i = 0; i < bSparks; i++) { 
    sparkPos[i] = flarePos; sparkVel[i] = (float(random16(0, 20000)) / 10000.0) - 1.0; 
    sparkCol[i] = abs(sparkVel[i]) * 500;  
    sparkCol[i] = constrain(0, sparkCol[i], 255); 
    sparkVel[i] *= flarePos / NUM_LEDS; 
  }
  sparkCol[0] = 255; 
  while(sparkCol[0] > c2/128) { 
    FastLED.clear();
    for (int i = 0; i < bSparks; i++) { 
      sparkPos[i] += sparkVel[i]; 
      sparkPos[i] = constrain(sparkPos[i], 0, NUM_LEDS); 
      sparkVel[i] += dying_gravity; 
      sparkCol[i] *= .99; 
      sparkCol[i] = constrain(0, sparkCol[i], 255);  
      if(sparkCol[i] > c1) { 
        leds[int(sparkPos[i])] = CRGB(255, (255 * (sparkCol[i] - c1)) / (255 - c1), 255);
      }
      else if (sparkCol[i] < c2) { 
        leds[int(sparkPos[i])] = CRGB(0, 0, (255 * sparkCol[i]) / c2);
      }
      else { 
        leds[int(sparkPos[i])] = CRGB((255 * (sparkCol[i] - c2)) / (c1 - c2), 0, 255);
      }
    }
    dying_gravity *= .985;
    FastLED.show();
  }
  FastLED.clear();
  FastLED.show();
}
//////////////////////////////////////////////////////////////////////////////////////////////////
void explodeLoop4() {
  
  int xSparks = flarePos / 2;
  for (int i = 0; i < xSparks; i++) { 
    sparkPos[i] = flarePos; sparkVel[i] = (float(random16(0, 20000)) / 10000.0) - 1.0; 
    sparkCol[i] = abs(sparkVel[i]) * 500;  
    sparkCol[i] = constrain(0, sparkCol[i], 255); 
    sparkVel[i] *= flarePos / NUM_LEDS; 
  }
  sparkCol[0] = 255; 
  while(sparkCol[0] > c2/128) { 
    FastLED.clear();
      for (int i = 0; i < xSparks; i++) { 
      sparkPos[i] += sparkVel[i]; 
      sparkPos[i] += sparkVel[i]; 
      sparkPos[i] = constrain(sparkPos[i], 0, NUM_LEDS); 
      sparkVel[i] += dying_gravity; 
      sparkCol[i] *= .99; 
      sparkCol[i] = constrain(255, 0, sparkCol[i]);  
      if(sparkCol[i] > c1) { 
        leds[int(sparkPos[i])] = CRGB((255 * (sparkCol[i] - c1)) / (255 - c1), random8(sparkCol[i] + c2), random8(150));
      }
      else if (sparkCol[i] < c2) { 
        leds[int(sparkPos[i])] = CRGB(random16(5, 10), (255 * sparkCol[i]) / c2, random8(2)>1) ;
      }
      else { 
        leds[int(sparkPos[i])] = CRGB(random8(c2), random8(90), (255 * (sparkCol[i] - c2)) / (c1 - c2));
      }
    }
    dying_gravity *= .985;
    FastLED.show();
  }
  FastLED.clear();
  FastLED.show();
}

Are you looking for someone to write the code for you? If so let me know and I will move this to Gigs and Collaborations. You should indicate how much you are willing to pay.

Hi,
I was looking for guidance as to how to do it myself but paying someone for an hour or so could also work.

I've moved it for you.

While I'd be happy to be proved wrong I don't think this is the kind of thing where someone can give you guidance on doing it yourself without pretty much doing it for you. You need to learn the language of C/C++ to stand a chance of doing it yourself.

Thanks,
I am keen for some help on this one as it is above my skill level.