Music Matching - Make Your Xenium LEDs DANCE!
AND MAKING YOUR OWN COLORS - WOW!----------------------------------------------
For those that are musicians, here's an easy guide to get you started (although you should know all this!)
Example Time Signature:
4/4 (you have 4 beats per measure)
Example Beats Per Minute:
60 (in 60 seconds, you'll have 60 beats)
MATH:
60 Seconds in 1 Minute / Beats Per Minute = Seconds per beat
Beats per measure * Seconds per beat = Seconds per measure
For the above example:
60s / 60BPM = 1 Second per beat
4/4 Time Signature = 4 beats per measure, so 4 beats per measure * 1 Second = 4 Seconds per measure
Referring back to our chart, 4 seconds = 40000 count
Therefore, a Full Measure = 40000
Whole Note =
Full Measure =
40000Half Note =
Full Measure / 2 =
20000Quarter Note =
Full Measure / 4 =
10000Eigth Note =
Full Measure / 8 =
5000Sixteenth Note =
Full Measure / 16 =
2500Thirty-secondth Note =
Full Measure / 32 =
1250Now, let's see what happens in 4/4 time with 80 BPM?
60 / 80 = .75 (it takes 3/4 of a second to go through 1 measure)
4 beats in a measure * .75 = 3 seconds to play a measure, or 30000 count
Whole Note: 30000
Half Note: 15000
Quarter Note: 7500
Eigth Note: 3750
16th Note: 1875
32nd Note: 937.5 (oh oh... you can round up or down... Your call)
What about the NOTES THEMSELVES?!Well, here's a tough one for you to go with... You have 7 notes, but only 6 available colors on the chip. So what do you do?
Three options:
Option A - Use OFF as a color, but it's pretty ugly
Option B - One color gets to be two notes.. Sometimes it might not be what you want...
Option C - CREATE YOUR OWN COLORS!!!!
Wait? SAY THAT AGAIN!You can't create your own color! Ahhhh, but you can trick your eye into thinking that you're looking at a different color.. The highest possible speed (at this time) that you can display Xenium LEDs is approximately 1/10,000th of a second...
THAT'S FAST!
How would I do this? THAT SOUNDS SO COOL!!!!!!
Well, simple, but we need to clear some things up:
The total count for your mix should never exceed 200 (each individual component should not be more than 100)If I wanted to make a very dim RED, I would use this code:
CODE
1 1 0F
100 0 0F
Try it out! You'll see the RED appears to be very dim, but in truth, it's Red and Off alternating extremely quickly, with Red being on only 1/10000th of a second, and the LED being off for 10 milliseconds
Try out
CODE
25 1 0F
100 0 0F
Hmm, the Red is a bit brighter than the last one, but it's not blinding, wow! That's amazing!
BUT WAIT, THERE'S MORE.....You can use this same technique to
CREATE YOUR OWN COLORS... THAT'S RIGHT...
MAKE UP NEW COLORS AS YOU PLEASE!Some ideas: Mix with WHITE to soften a color
Mix your own batch: Combine three or more colors (remember, keep the total count less than 200) to come up with some unique colors
Example color:
CODE
25 4 0F
100 7 0F
It's a light blueish purple... I mixed White and Blue
CODE
50 4 0F
150 3 0F
This gives you a Blue-Amber mix (off-white). But wait, is't that the same thing as:
CODE
25 4 0F
75 3 0F
or
CODE
1 4 0F
3 3 0F
Yeah - but would you want to repeat that a few thousand times to make 1 second or whatever you need? You can use small numbers if that's all you have, but if you're incorporating it into something long, then the bigger the count, the better (it just means LESS work for you and the chip).
And yes, you can even fade these out... Same principle applies, except that the TOTAL count of your mix is the value you will have to use...
From yesterday's example:
100 1 0F
1 2 0F
99 1 0F
2 2 0F
98 1 0F
3 2 0F
97 1 0F
4 2 0F
96 1 0F
5 2 0FNotice that I had 100 as my initial color value to fade... Well, my mix color would need to add up to 100 on its own.
With a color transition, I would use:
20 1 0F
80 2 0F
1 2 0F
20 1 0F
79 2 0F
2 2 0F
19 1 0F
79 2 0F
3 2 0F
19 1 0F
78 2 0F
4 2 0F
18 1 0F
78 2 0F
5 2 0FKeep in mind that between each OFF point I use, I can still only subtract 1 from the TOTAL. If I subtract 1 from each, my fade out will go much faster - which can be a different effect if you want.
I decided to alternate... The first time the color shows, it's full, the next time (after an OFF), I subtract 1 from a single color, then OFF, then I subtract 1 from the other color, and repeat.
Yes, eventually 1 color will have faded to 0 before the other.. That's okay!
If you want to be proper, you need to keep the same
RATIO between the mixed colors... Instead of subtracting 1 from each color every other time, I would make sure my ratio was the same...
Example:
Initial color is 20:80 Red:Green, so it's a 1/4 mix.
20 1 0F
80 2 0F
1 2 0F
20 1 0F
79 2 0F
2 2 0F
20 1 0F
78 2 0F
3 2 0F
20 1 0F
77 2 0F
4 2 0F
20 1 0F
76 2 0F
5 2 0F
19 1 0F
76 2 0F
6 2 0FNotice that I only subtracted from the Green for the first few times, why? Well:
20 * 4 = 80
19 * 4 = 76
So, I subtract from the 80 only until I am at 76, and then I subtract from my Red, and make it 19.
If my Red is at 18, that means my Green is at 72, so, I now subtract from my Green until I am at 72, then I subtract from Red.
Really, it's all up to you in the end - Your effect!
It can be a pretty awesome effect - fading out your own custom colors... It's a little more work, though.
Some things to remember:
RGB (Red, Green, Blue) - these colors are your primary colors.. Mixing them up can get you any color you want, so I would only deal with 1, 2, 4 (R, G,

. You can mix with 7 (White) if you want to soften a color... But, nothing's stopping you from mixing the other colors - play around!