64 pxl matrix help

I posted earlier about the blaster install I am working on. I finished it up today, and the 64 pxl matrix isn’t working at all.

I have it wired up to data 2 and led- 4. here is the blade config:

BladeConfig blades[] = {
{ 0, 
	SubBlade(9, 9, WS281XBladePtr<10, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >()), /* muzzle */
	SubBlade(0, 8, NULL), /* barrel */
	WS281XBladePtr<64, blade4Pin, Color8::GRB, PowerPINS<bladePowerPin4> >(), /* accents */
CONFIGARRAY(presets) },
};

and here is an example style: (came with the fonts, not sure what it was written for)

// accents
  StylePtr<Layers<
    Black,
    TransitionEffectL<TrConcat<TrDelay<0>,White,TrFade<200>,Rgb<180,120,0>,TrFade<300>>,EFFECT_FIRE>,
    TransitionEffectL<TrConcat<TrDelay<0>,DeepSkyBlue,TrFade<200>,Blinking<Black,Blue,100,500>,TrFade<300>>,EFFECT_STUN>,
    LockupTrL<Layers<
      TransitionLoopL<TrConcat<TrInstant,White,TrFade<50>,Red,TrFade<150>>>>,TrInstant,TrConcat<TrInstant,Rgb<50,0,0>,TrFade<400>>,SaberBase::LOCKUP_AUTOFIRE>>>(),
},

Anything look wrong? or does a matrix work differently?

Ah, perhaps it is this?
WS281XBladePtr<64, blade4Pin, Color8::GRB, PowerPINS<bladePowerPin4> >(),
bladepin4

Because I have it on data 2, it should be blade2Pin ?

edit: Yes! That was it! It now works.

so - Next question is how to get started making animations for it? Not detailed animations like a person running or anything, but more like a vu meter bouncing, a single moving pixel, breathing, etc. while idle?

Depends, were you thinking of ways to draw stuff or ways to code stuff?
Or ways to use the style code for grids?

One option would be to break it up into 8 subblades and then assign similar, but not identical 2d styles to each one, which might look kind of cool, but it’s also a bit limiting because it means you won’t have the option to do things any other way.

Thats a good question. I am a simple man, perhaps just style code to do cool things?

One issue I have is what is pixel 1? Here is the matrix, it is 4x16:


I connected my data to the upper Din. But there is a lower Din as well, huh? Bi-directional?

Is there a way to figure out what my 1st pixel is? If its in the middle, can a style be defined that isn’t starting in a strange spot.

Alternately - I know you mentioned here (and before in my other thread) about programming for the matrix to make it act like a display. How would this be done? I am not too much of a programmer, but I have muddled thru so far to get the results I want.

Hopefully there is some sort of documentation which specifies the order of the pixels.
I would assume that you can use either one of the DIN and DOUT pins, but again, documentation…

4x16 should be easier to deal with, as you onlly need four subblades. I know from my quad-blade that you can do some cool things with fire and stripes that way. (See my K4 config file for examples.)

One alternate way to figure out in which order the pixels are configured would be to use the length finder. It lights up one LED at a time and speaks the number, and you can use the variance variable, using color change on the serial monitor to change which led is actually lit up.

Making it work like an actual display will require a fair bit of coding. I have a bunch of code that can be re-used, but that code currently assumes SPI output, and it would need some new stuff to allow neopixel matrices to be used. Not super hard, but probably easier if I do it… and then you still have to create animations for it, which takes some work too.

A simpler option when it comes to coding is probably to just code your own style template. Basically you need a run() functoin (which gets called once per frame) and a getColor() function (which gets called once per pixel) then you just have to write some code that returns whatever colors you want.

Unfortunately, no. No documentation that I can find. It seems like it may have been geared toward CFx, here is what shtok wrote in various places on facebook, etc.

Continuing to develop new styles of the classic 10-bargraph display, with introducing a first ever RGB pixel 10-segments bargraph in aluminum casing back in 2019, and now a first ever with highest resolution RGB pixel matrix bargraph display, which fits in same 20-pin DIP socket and can be positioned reversed without fear of reverse polarity and frying the pixels. Can be easily controlled by Plecter Labs CFX Grafx feature for crazy animations and still can work as a regular pixel strip array with other sound boards like Proffieboard, Verso, Golden Harvest etc. to add amazing animation patterns to your neopixel saber.

That sounds great, I wouldn’t mind if you coded it. :wink:
If you want to sink time into it, and I love making animations and the like!

that sounds quite hard, actually, lol.

I will start with trying to figure out which is pixel one…

For some magical reason, pixel 1 is the top left. So, hooray!

Without motion, I could not tell what pixel 2 and on are.

Pixel 1 is marked by this small symbol in one of the corners, the other follow horizontally then down to the next row, then horizontally to the left, then down again and so forth:

matrix first pixel

4 Likes

Thank you! Mine happened to be the upper left once installed. Hopefully that helps in making animations.

1 Like

So I did.
I have not tested it yet, but some basic instructions can be found here:

Now, after that you need to figure out how to operate a color display, which is brand new and not a well trodden path yet. Generating animations is going to be a matter of making a bunch of PNG files or mp4 files, and the converting them to PQF. Proper documentation does not exist yet, but I think what you would need should hopefully be written down somewhere in this thread:

If not, I can help with that.

This piece of code can of course also be used for regular blades, I mean, it’s just a 1x144 display, right?

Wait. So if I read this ight, we can make a 1x144 mp4, convert to PQF, and it “plays” on a blade if so desired?
I have pseudo-rhetorical questions, as in no answer is expected right now, but hopefully someday there’s documentation explaining them:

What’s the syntax for a “display style” in the preset, just DisplayStyle<DISPLAYNAME>, and then it shows the PQF?
Does it loop?

Yes.

DisplayStyle<> is a style template that returns COLOR, so it can be used anywhere in the style, but is probably most useful if used as the base layer.
There are also some parameters for rotation, mirroring and zig-zag layouts.

PQF has GOTO in it. If you want it to loop, you put a goto at the end to the beginning. The mp4 → PQF conversion tool does that by default if you give it a single file, but you can also give it a file like this:

The display code also renders layers, so you probably want a looping base PQF, then you can play non-looping effects on top of it for clashes and stuff.

PQF and color displays isn’t quite as crazy as the style code, but it’s not exactly simple either…

Amazing!

I read through that thread again, so I think I am on my way.

While I download unbuntu, I started on the config.

I have this just before CONFIG_PRESETS

#ifdef CONFIG_STYLES
	InMemoryDisplay<4, 16, 3> my_small_display;
	StandarColorDisplayController<4, 16> my_small_display_controller(&my_small_display);
	NAME_INSTANCE(my_small_display, MYDISPLAY);
	
#endif

Where InMemoryDisplay<4, 16, 3> 4 is the height and 16 is the length? Maybe I have that reversed. What is the “3”? I think I saw somewhere you said its the layers?

Either way - with a fresh proffieos, my test config compiled with no errors.

I will start off with a simple image animation. One question. where do I put the pqf files once I have them? Does my config need to have a file path to them?

Yeah, it’s the number of allowed layers.
Each layer takes a little bit of memory, but other than that there is no overheat unless those layers are actually used. Three seems like a fairly reasonable starting point.

No, it works similarly to sound files. It will search for them in the font path and pick them up and use them automatically. Note that what it looks for is an SCR file. The SCR files are short text files which can specify which PQF file to play for each layer on the display. You can find some information about SCR files here:

You can also find a complete example, but made for a larger display here:

Bringing this back as I am trying to program the 69 pixel shtok blade plug. I was able to get SubBladeWithList up and running, and regular blade styles work. I was not able to get any pqf files up and running since I was getting consistent failed to parse line: loop start or Failed to read PAM header. If anyone has got this working and can send me a 9x9 pqf file, I can see if display style is reading the in memory display properly. My saber is trying to play something but I actually do not have an scr file on the SD card. Any insight would be appreciated.

23:15:28.945 → ProffieOS Documentation: Serial Monitor Commands

23:15:36.325 → EVENT: Power-Pressed#1 millis=192929

23:15:36.325 → EVENT: Power-Pressed millis=192929

23:15:36.490 → EVENT: Power-Released#1 millis=193088

23:15:36.490 → EVENT: Power-Released millis=193088

23:15:36.490 → EVENT: Power-Shortclick#1 millis=193088

23:15:36.490 → EVENT: Power-Shortclick millis=193088

23:15:36.490 → Ignition.

23:25:38.885 → File not found.

23:25:38.885 → File not found.

23:25:38.885 → Playing Graflex3/9x9/idle.scr

23:25:39.907 → Unmounting SD Card.

23:25:43.473 → Battery voltage: 4.15

I can help you figure out the problems with cpqoi.
What file are you feeding in?
Do you have the required programs (ffmpeg, ffprobe, netpbm)?

I believe I have everything setup properly. I think have all the above installed properly. Here are the checks with versions.

*@*2 ~ % ffmpeg -version
ffmpeg version 7.1.1 Copyright (c) 2000-2025 the FFmpeg developers
built with Apple clang version 16.0.0 (clang-1600.0.26.6)
configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.1.1_1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags=‘-Wl,-ld_classic’ --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
libavutil 59. 39.100 / 59. 39.100
libavcodec 61. 19.101 / 61. 19.101
libavformat 61. 7.100 / 61. 7.100
libavdevice 61. 3.100 / 61. 3.100
libavfilter 10. 4.100 / 10. 4.100
libswscale 8. 3.100 / 8. 3.100
libswresample 5. 3.100 / 5. 3.100
libpostproc 58. 3.100 / 58. 3.100
@ ~ % ffprobe -version
ffprobe version 7.1.1 Copyright (c) 2007-2025 the FFmpeg developers
built with Apple clang version 16.0.0 (clang-1600.0.26.6)
configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.1.1_1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags=‘-Wl,-ld_classic’ --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
libavutil 59. 39.100 / 59. 39.100
libavcodec 61. 19.101 / 61. 19.101
libavformat 61. 7.100 / 61. 7.100
libavdevice 61. 3.100 / 61. 3.100
libavfilter 10. 4.100 / 10. 4.100
libswscale 8. 3.100 / 8. 3.100
libswresample 5. 3.100 / 5. 3.100
libpostproc 58. 3.100 / 58. 3.100
@ ~ % pbmtoascii -version
pbmtoascii: Using libnetpbm from Netpbm Version: Netpbm 11.2.13
pbmtoascii: Built from source dated 2025-03-01 13:08:31
pbmtoascii: Built by brew
pbmtoascii: BSD defined
pbmtoascii: RGB_ENV=‘RGBDEF’
pbmtoascii: RGBENV= ‘RGBDEF’ (env vbl is unset)

I have created scroll.mp4 and I think everything looks good, but here is the error that I seem to be getting.

@ frames9x9 % /Users/@/Desktop/ProffieOS-master/pqoi/cpqoi scroll.mp4 “pamscale -xysize 9 9” >animation.pqf
Executing: ffprobe -i “$FILE” 2>&1 | sed -n ‘s@.Video:., ([0-9.]) fps,.@\1@gp’
Executing: ffprobe -i “$FILE” 2>&1 | sed -n ‘s@.Video:., ([0-9.]) fps,.@\1@gp’
Failed to extract frame rate from video. (ffprobe not available?)
@ frames9x9 %

I have the animations broken out named frame_001.png as well. I have 118 total frames. I have tried to use the frames vs the mp4 with these results:

@ frames9x9 % /Users/@/Desktop/ProffieOS-master/pqoi/cpqoi frame_001.png >test.pqf
Executing: ffprobe -i “$FILE” 2>&1 | sed -n ‘s@.Video:., ([0-9.]) fps,.@\1@gp’
Executing: ffprobe -i “$FILE” 2>&1 | sed -n ‘s@.Video:., ([0-9.]) fps,.@\1@gp’
FPS: 0:0
Executing: pngtopam -alphapam $FILE
Failed to read PAM header.
@ frames9x9 %

I am using terminal in Mac OS 15, Python 3.13.2 with homebrew installed. I am getting zero bite files produced with the above errors.

Thanks for the help, please let me know if you need any more info.

If you run ffprobe -i scroll.mp4, what do you get?
If you run pngtopam -alphapam frame_001.png >frame_001.pam what do you get? (please post the first few lines of the output, before it turns into gobblygook.)

ffprobe -I scroll.mp4:

ffprobe version 7.1.1 Copyright (c) 2007-2025 the FFmpeg developers
built with Apple clang version 16.0.0 (clang-1600.0.26.6)
configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.1.1_1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,

pngtopam -alphapam frame_001.png >frame_001.pam:

./pqoi % pngtopam -alphapam frame_001.png >frame_001.pam
pngtopam: Unable to open file ‘frame_001.png’ for reading. fopen() returns errno 2 (No such file or directory)