Number of lines per preset in config?

I bought a Proffieboard v3.9 from TCSS and it states it’s preloaded with the default sound package and to use the config generation tool. It looks like the presets in the generator have three lines per sound font. I.e.:

{ "TeensySF", "tracks/venus.wav",
    StyleNormalPtr<CYAN, WHITE, 300, 800>(),
    StyleNormalPtr<CYAN, WHITE, 300, 800>(),
    StyleNormalPtr<CYAN, WHITE, 300, 800>(), "cyan"},

The first light saber I built a few weeks ago I bought from The Saber Armory. Having a lesser idea of what I was doing I asked them for the config file, they also stated it was loaded with “the default config” but they also provided me with one. That config only uses 1 line per soundfont. I.e.:

{ "TeensySF", "tracks/venus.wav",
    StyleNormalPtr<CYAN, WHITE, 300, 800>(), "cyan"},

This saber I’m building now also uses an illuminated switch and plugging that into the config adds a 4th line even:

   { "TeensySF", "tracks/venus.wav",
    StyleNormalPtr<CYAN, WHITE, 300, 800>(),
    StyleNormalPtr<CYAN, WHITE, 300, 800>(),
    StyleNormalPtr<CYAN, WHITE, 300, 800>(),
    StyleNormalPtr<CYAN, WHITE, 300, 800>(), "cyan"},

What’s the difference here? Does it matter how many lines there are?

Thanks

It’s based on NUM_BLADES and your BladeConfig. Each “blade” requires a style. Any LED/strip would be a “blade” if wired independently or using SubBlade.
If you have 2 “blades” you need 2 styles in every preset, etc.

1 Like

It might also be worth mentioning that styles can be broken into many lines. It’s the number of top-level commas that really matters, not the number of lines.
(a comma between < , > or ( , ) is not a top-level comma, and thus does not count.)

More information here:

1 Like

Ok, that does make sense why the illuminated switch adds an extra line per preset. But if I refresh the generator this is the default configuration, right?

Which only shows one blade. Yet the config is this:

#ifdef CONFIG_PRESETS
Preset presets[] = {
   { "TeensySF", "tracks/venus.wav",
    StyleNormalPtr<CYAN, WHITE, 300, 800>(),
    StyleNormalPtr<CYAN, WHITE, 300, 800>(),
    StyleNormalPtr<CYAN, WHITE, 300, 800>(), "cyan"},
   { "SmthJedi", "tracks/mars.wav",
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(),
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(),
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(), "blue"},
   { "SmthGrey", "tracks/mercury.wav",
    StyleFirePtr<RED, YELLOW, 0>(),
    StyleFirePtr<RED, YELLOW, 1>(),
    StyleFirePtr<RED, YELLOW, 2>(), "fire"},
   { "SmthFuzz", "tracks/uranus.wav",
    StyleNormalPtr<RED, WHITE, 300, 800>(),
    StyleNormalPtr<RED, WHITE, 300, 800>(),
    StyleNormalPtr<RED, WHITE, 300, 800>(), "red"},
    .... }

Is that right? It seems like too many lines. (even taking into account @profezzorn 's statement regarding broken into many lines).

Edit: Sorry about the screenshots, and I already shared The Saber Armory one liner…

“Style…()” is the style code, so if you have 3 blades you’ll get 3 “Style…()” instances per preset.

But in the screenshot above on the configurator settings, it’s only one blade? Is it a bug with the configurator?

The answer is that the shtokd illuminated pogo pin PCB has two circles of LEDs on it, and the default configuration makes them into two separate blades. You can see it if you look at the blade configuration a little further down:

BladeConfig blades[] = {
 { 0, WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
    SubBladeWithStride(0, 15, 2, WS281XBladePtr<16, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >()),
    SubBladeWithStride(1, 15, 2, NULL)
  , CONFIGARRAY(presets) },
};

Ah, ok, that makes sense. Thank you. I wonder if I’m missing something using the config sent to me by the saber armory. Or if it’s so minor it doesn’t matter?

I guess it’s safe for me to edit those lines out and clean it up down to one line per preset. Probably the last line with the "color"}, is the only important one.

That is entirely up to you. :slight_smile:

1 Like