Can a blade have a hard color change?

I’ve made a Tron Disc using the Proffie v2.2 and ProffieOS. I have a single strip of NeoPixels running the inner and outer rings of the disc. I’d like to see if there is a way to have a hard color change in the middle, so the outer ring and inner ring have different colors. But I haven’t been able to determine how to do that with the style editor. I would need to indicate the exact number of pixels for the beginning (inner) part of the blade and the end (outer) of the blade. Is this something that is possible? And, if so, how would I set that up in the style editor?

Thanks,
Daniel

There are plenty of ways to achieve this, some of which would require some trial and error ( as in try a number, test, see results, modify number , test again etc…)
Without seeing a drawing of exactly how you’ve run the pixel strip, it’s a bit of a guessing game. It would seem logical that the distance between the 2 diameters would require some “hidden” pixels to traverse inside the disc from one circle to the other. That section could be helpful as the exact middle pixel could be approximated as “close enough” giving you the desired result of half-and-half. But, precision is not impossible.
Options:

  1. Use LengthFinder<> to find the exact LED number(s) of where the inner ring ends and the outer ring begins.
    Easy to setup and use, using this blade style feature in a preset would provide you the exact pixel number(s) you want to know. More info here:
    How many leds does my blade have? · profezzorn/ProffieOS Wiki · GitHub

  2. Simply use SmoothStep or LinearSection in the style to split the blade into areas of different colors. Something like this,( where of course the colors could be more interesting animations or colorcyle effects for example)
    Style Editor

StylePtr<Layers<
  Black,
  AlphaL<Blue,LinearSectionF<Int<0>,Int<32768>>>,
  AlphaL<DeepSkyBlue,LinearSectionF<Int<32768>,Int<32768>>>>>()
  1. (What I would probably do) Use SubBlades to literally split the strip into 2 discrete blades (using the number of pixels you found in option 1). This way, you could apply different colors, speeds, effects, on or off states, timings…literally everything separately to the 2 rings.
    More SubBlades info here:
    SubBlade · profezzorn/ProffieOS Wiki · GitHub

For fun, here’s an example of some blade styles I made based off the film for idling or poweron and then when the disc is first powered on and then begins spinning. Something like this could be applied to one of or both rings, and edited to your liking in either case.

// Tron Disc inner ring
StylePtr<Layers<
  Pulsing<RotateColorsX<Variation,Rgb<0,20,140>>,RotateColorsX<Variation,Rgb<20,100,240>>,1500>,
  TransitionEffectL<TrConcat<TrInstant,HumpFlicker<White,RotateColorsX<Variation,Rgb<50,220,250>>,50>,TrFade<500>>,EFFECT_CLASH>,
  TransitionEffectL<TrConcat<TrInstant,Black,TrDelay<4000>>,EFFECT_BOOT>,
  TransitionEffectL<TrConcat<
TrInstant,    Black,
TrDelay<1000>,Black,
TrInstant,   AlphaL<RotateColorsX<Variation,Rgb<20,100,240>>,SmoothStep<Int<4681>,Int<-1>>>,
TrDelay<500>,AlphaL<RotateColorsX<Variation,Rgb<20,100,240>>,SmoothStep<Int<9362>,Int<-1>>>,
TrDelay<500>,AlphaL<RotateColorsX<Variation,Rgb<20,100,240>>,SmoothStep<Int<14043>,Int<-1>>>,
TrDelay<500>,AlphaL<RotateColorsX<Variation,Rgb<20,100,240>>,SmoothStep<Int<18724>,Int<-1>>>,
TrDelay<500>,AlphaL<RotateColorsX<Variation,Rgb<20,100,240>>,SmoothStep<Int<23405>,Int<-1>>>,
TrDelay<500>,AlphaL<RotateColorsX<Variation,Rgb<20,100,240>>,SmoothStep<Int<28086>,Int<-1>>>,
TrDelay<500>,       RotateColorsX<Variation,Rgb<20,100,240>>,TrFade<1000>>,EFFECT_BOOT>>>(),
  // Outer ring
StylePtr<Layers<
  Mix<SwingSpeed<400>,
  	ColorCycle<Rgb<0,100,140>,0,1,Pulsing<RotateColorsX<Variation,Rgb<0,100,140>>,RotateColorsX<Variation,Rgb<20,200,240>>,500>,70,4000,500>,
  	HumpFlicker<RotateColorsX<Variation,Rgb<100,220,250>>,RotateColorsX<Variation,Rgb<20,100,140>>,10>>,
  TransitionEffectL<TrConcat<TrInstant,HumpFlicker<White,RotateColorsX<Variation,Rgb<100,220,250>>,50>,TrFade<200>>,EFFECT_CLASH>,
  TransitionEffectL<TrConcat<TrFade<75>,White,TrDelay<25>,White,TrFade<50>,Stripes<2000,1,Rgb<0,40,80>,Rgb<20,200,240>>,TrDelay<125>,Stripes<2000,-500,Rgb<0,40,80>,Rgb<20,200,240>>,TrFade<100>>,EFFECT_IGNITION>,
  InOutTrL<TrInstant,TrFade<500>>>>()

Thanks, this gives me a great starting point!

To be more precise about my setup, I have 24 pixels in the inner ring and 39 in the outer ring. They are actually two strips of NeoPixels (inner is skinny neopixels and the outer is regular neopixels) joined with a length of wire to traverse the distance between the inner and outer rings. So I definitely need the config to be precise.

I’m new to the whole ProffieOS and config setup, so I am still wrapping my head around how it all works. But definitely appreciate the pointers! I was sure someone had to have tackled this issue before.

I think you want to use subblade()

More questions on how this works…
My current config file is basically the default config file with an added Tron sound font I bought from JuanSith at Saberfont. :

#ifdef CONFIG_TOP
#include "proffieboard_v2_config.h"
#define NUM_BLADES 1
#define NUM_BUTTONS 2
#define VOLUME 1000
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 1.0
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#endif

#ifdef CONFIG_PRESETS
Preset presets[] = {
   { "TRON", "tracks/track4.wav",
    StyleNormalPtr<CYAN, WHITE, 300, 800>(), "cyan"},
   { "TeensySF", "tracks/venus.wav",
    StyleNormalPtr<CYAN, WHITE, 300, 800>(), "cyan"},
   { "SmthJedi", "tracks/mars.wav",
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(), "blue"},
   { "SmthGrey", "tracks/mercury.wav",
    StyleFirePtr<RED, YELLOW>(), "fire"},
   { "SmthFuzz", "tracks/uranus.wav",
    StyleNormalPtr<RED, WHITE, 300, 800>(), "red"},
   { "RgueCmdr", "tracks/venus.wav",
    StyleFirePtr<BLUE, CYAN>(), "blue fire"},
   { "TthCrstl", "tracks/mars.wav",
    StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(), "green"},
   { "TeensySF", "tracks/mercury.wav",
    StyleNormalPtr<WHITE, RED, 300, 800, RED>(), "white"},
   { "SmthJedi", "tracks/uranus.wav",
    StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(), "yellow"},
   { "SmthGrey", "tracks/venus.wav",
    StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(), "magenta"},
   { "SmthFuzz", "tracks/mars.wav",
    StyleNormalPtr<Gradient<RED, BLUE>, Gradient<CYAN, YELLOW>, 300, 800>(), "gradient"},
   { "RgueCmdr", "tracks/mercury.wav",
    StyleRainbowPtr<300, 800>(), "rainbow"},
   { "TthCrstl", "tracks/uranus.wav",
    StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(), "strobe"},
   { "TeensySF", "tracks/venus.wav",
    &style_pov, "POV"},
   { "SmthJedi", "tracks/mars.wav",
    &style_charging, "Battery\nLevel"}
};
BladeConfig blades[] = {
 { 0, WS281XBladePtr<63, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), CONFIGARRAY(presets) },
};
#endif

#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
Button AuxButton(BUTTON_AUX, auxPin, "aux");
#endif

If I change the BladeConfig part to:

BladeConfig blades[] = {
 { 0, SubBlade(0, 23, WS281XBladePtr<63, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >()),
    SubBlade(24, 63, NULL),
    CONFIGARRAY(presets) },
};

How would the presets change? Looking at what @NoSloppy did (and simply copying it for now), would I change the first entry in presets to:

{ "TRON", "tracks/track4.wav",
    // Tron Disc inner ring
StylePtr<Layers<
  Pulsing<RotateColorsX<Variation,Rgb<0,20,140>>,RotateColorsX<Variation,Rgb<20,100,240>>,1500>,
  TransitionEffectL<TrConcat<TrInstant,HumpFlicker<White,RotateColorsX<Variation,Rgb<50,220,250>>,50>,TrFade<500>>,EFFECT_CLASH>,
  TransitionEffectL<TrConcat<TrInstant,Black,TrDelay<4000>>,EFFECT_BOOT>,
  TransitionEffectL<TrConcat<
TrInstant,    Black,
TrDelay<1000>,Black,
TrInstant,   AlphaL<RotateColorsX<Variation,Rgb<20,100,240>>,SmoothStep<Int<4681>,Int<-1>>>,
TrDelay<500>,AlphaL<RotateColorsX<Variation,Rgb<20,100,240>>,SmoothStep<Int<9362>,Int<-1>>>,
TrDelay<500>,AlphaL<RotateColorsX<Variation,Rgb<20,100,240>>,SmoothStep<Int<14043>,Int<-1>>>,
TrDelay<500>,AlphaL<RotateColorsX<Variation,Rgb<20,100,240>>,SmoothStep<Int<18724>,Int<-1>>>,
TrDelay<500>,AlphaL<RotateColorsX<Variation,Rgb<20,100,240>>,SmoothStep<Int<23405>,Int<-1>>>,
TrDelay<500>,AlphaL<RotateColorsX<Variation,Rgb<20,100,240>>,SmoothStep<Int<28086>,Int<-1>>>,
TrDelay<500>,       RotateColorsX<Variation,Rgb<20,100,240>>,TrFade<1000>>,EFFECT_BOOT>>>(),
  // Outer ring
StylePtr<Layers<
  Mix<SwingSpeed<400>,
  	ColorCycle<Rgb<0,100,140>,0,1,Pulsing<RotateColorsX<Variation,Rgb<0,100,140>>,RotateColorsX<Variation,Rgb<20,200,240>>,500>,70,4000,500>,
  	HumpFlicker<RotateColorsX<Variation,Rgb<100,220,250>>,RotateColorsX<Variation,Rgb<20,100,140>>,10>>,
  TransitionEffectL<TrConcat<TrInstant,HumpFlicker<White,RotateColorsX<Variation,Rgb<100,220,250>>,50>,TrFade<200>>,EFFECT_CLASH>,
  TransitionEffectL<TrConcat<TrFade<75>,White,TrDelay<25>,White,TrFade<50>,Stripes<2000,1,Rgb<0,40,80>,Rgb<20,200,240>>,TrDelay<125>,Stripes<2000,-500,Rgb<0,40,80>,Rgb<20,200,240>>,TrFade<100>>,EFFECT_IGNITION>,
  InOutTrL<TrInstant,TrFade<500>>>>(), "cyan"},

How does the system map the style to the two different sub-blades?

Correct. The order of styles in the presets matches the order of blades in the BladeConfig. Make sure you edit #define NUM_BLADES in the CONFIG_TOP section as well to match the 2 blades.
oh, except due to the offset, your 2nd blade would be SubBlade(24, 62, NULL),
And to ice the cake, you can name the preset something like “tron” instead of “cyan”.

@NoSloppy - Thanks for the help - it seems to be working.

Currently when power is applied, but the power button hasn’t been hit, the inner ring is blue. When the power button is hit, the outer ring is turned on.

Looking at the Style you posted, it isn’t clear to me how that would be modified to have the inner ring be off until the power button is hit. Could you shed a bit of information about how that works?

Thanks again.

Oh, it looks like I didn’t have any InOutL in there to control power on/off effects.
Adding that layer like this should help lol.

StylePtr<Layers<
  Pulsing<RotateColorsX<Variation,Rgb<0,20,140>>,RotateColorsX<Variation,Rgb<20,100,240>>,1500>,
  TransitionEffectL<TrConcat<TrInstant,HumpFlicker<White,RotateColorsX<Variation,Rgb<50,220,250>>,50>,TrFade<500>>,EFFECT_CLASH>,
InOutTrL<TrWipe<300>,TrWipeIn<500>>,
  TransitionEffectL<TrConcat<TrInstant,Black,TrDelay<4000>>,EFFECT_BOOT>,
  TransitionEffectL<TrConcat<
TrInstant,    Black,
TrDelay<1000>,Black,
TrInstant,   AlphaL<RotateColorsX<Variation,Rgb<20,100,240>>,SmoothStep<Int<4681>,Int<-1>>>,
TrDelay<500>,AlphaL<RotateColorsX<Variation,Rgb<20,100,240>>,SmoothStep<Int<9362>,Int<-1>>>,
TrDelay<500>,AlphaL<RotateColorsX<Variation,Rgb<20,100,240>>,SmoothStep<Int<14043>,Int<-1>>>,
TrDelay<500>,AlphaL<RotateColorsX<Variation,Rgb<20,100,240>>,SmoothStep<Int<18724>,Int<-1>>>,
TrDelay<500>,AlphaL<RotateColorsX<Variation,Rgb<20,100,240>>,SmoothStep<Int<23405>,Int<-1>>>,
TrDelay<500>,AlphaL<RotateColorsX<Variation,Rgb<20,100,240>>,SmoothStep<Int<28086>,Int<-1>>>,
TrDelay<500>,       RotateColorsX<Variation,Rgb<20,100,240>>,TrFade<1000>>,EFFECT_BOOT>>>()

Thanks - that fixed my issue. Now to familiarize myself with the config files and play around. I assume that once a color is set, if you want different colors you have to go to a different profile via turning it off, hitting the aux button and turning it back on?

Unless you use the color change option to change the color, yes.

As profezzorn mentions above, color change is an option. In particular, if you look at those styles, they are built with RotateColorX using Variation for the colors.
That means that if you activate color change mode (read your specific chosen prop file instructions for the button combo to do so) as you rotate the hilt (or disc in this case), you will cycle through all available colors and can set it as the “new” color to use. Any place that has RotateColorsX as the color will respect the change.
Typically, when used for a saber blade, clashes, blaster deflects and so on are built to NOT follow that color change, and more just the main blase colors. Your choices may differ being a disc. Viewing the style(s) in the Style Editor, and using the right hand column to view the way it’s nested and built is most helpful to understand what can be exchanged and made to order.

1 Like

Ah, I see. Very nice. I appreciate the explanations. I was wondering where the documentation for the buttons was. In my case, the props/saber.h file.

Thanks!

2 Likes