Set/Reset multiple progress bars on HUD

Hey,

I have a HUD with multiple ‘Progress Bars’. Although I can set percent for anyone of them, I’d like to be able to set them all to a value and be able to reset them all to zero. Could some one please help?

Thank you in hope.

P.S. I tried ‘Get All Actors Of Class’ but the dropdown box option does not provide a ‘Progress Bar’ option.

P.P.S. If anyone can answer, then please do so. A little more information for you…

I am currently putting together a HUD that has multiple progress bars on for displaying MIDI data. There are in total ‘16 (Tracks) x 10 (Octaves) x 12 (Notes)’, 1920 in total. It took me ages to create the associated variables, e.g. varTrackX_OctaveY_NoteZ as there is no search and replace facility available. I was very chuffed when the naming was completed. I know how to reference each one individually (e.g. set percent), however, I’d like to have a bulk command to change all progress bars to a value and likewise, reset them all to zero. Try as I have, I cannot seem to do this. I thought is would be as easy as ‘Get All Actors Of Class’, however, the dropdown box for this function does not contain ‘Progress Bar(s)’ as an option, which is a great shame. Would any of you happen to know if there is a way to do this, please? In addition, is there a way to make up a variable name via string manipulation and then use a for loop to pipe the data from the midi event to HUD variables? E.G. varTrackX_OctaveY_NoteZ, where X, Y & Z are passed via the midi event, thus variable string or name would equal “varTrack”&X&"_Octave"&Y&"_Note"&Z? I am using blueprints to do this by the way.

Won’t you please please help me?!?

If all the progress bars are in the same widget, you can do this in its graph:

If you have multiple widgets, you just need to create and keep the array elsewhere, master widget or HUD blueprint.

Nice one ‘Everynone’, that’s a start point, thank you.

There’s 1920 of them in total. Is there a sleak way to make the array based on putting together the variable name, e.g. varTrackX_OctaveY_NoteZ, where X, Y & Z are passed via the midi event, thus variable string or name would equal “varTrack”&X&"_Octave"&Y&"_Note"&Z?

I thought I misread that. But you actually have 1920 hand-made widgets? Chuffed you say? How long did it take?!

Can you roughly describe what you are trying to make? There has to be a way to automate it.

You can spawn widgets dynamically and add them to containers and arrays, set macros, constructors, templates and so on. You surely do not have all of them on screen at the same time. And most of them are quite similar, right? Can they be grouped logically?

Yes ‘Everynone’, 1920 of the f**kers. It was sould destroying, lol. It took many many nights and what made it worse, UE4 tended to crash a few times on pasting var names. Anyway, it’s an experience I won’t repeat again in a while, in fact not at all =].

OK, here goes, I have a MIDI player that has cartridges (e.g. The Beatles, TV & Film Themes, etc); Each cartridge has a number of tunes. This works fine. So the idea is to send the MIDI event data to the ‘hudMIDI’…
The data produced is:-
Track Number: 0-15
Octave: 0 - 10
Note: 1 -12 (C-Bb)
Velocity: 0-127 (This is basically the volume of the note, which I’ll map via a clamp node, i.e. 0-127 mapped to 0.0 to 100.0 for progress bar percent.

This is the first step to graphically display MIDI output on the screen. The next step thereafter is the fun bit, where objects in the scene can have the properties changed on the fly to the MIDI output signals, e.g. scale, visibility, position, rotation, etc.

They’re all similar, please see attached screenshot.

Thank you for your help Dude, really appreciated =]

The widget is a Spectrum Analyzer. Something like:

And you’ll need 16 of these at a time?

Hey Everynone,

Yes, it is similar, however, on the hudMIDI, the velocity dictates the percentage of the progress bars.

Like the surrounding frame, I will sort out the aesthetics when I get the damned thing working =].

So, I whiped this out:

spectral.png

This is how it looks with every vertical bar set to random percentage. It uses 10x less progress bars, too. You get access to the individual elements by index rather than name (no need to rename anything, although you can, of course).

I’ll post the setup in a bit.

I used 3 widgets:

  • Progress Bar:

bar_fill.png ← Fill bar_back.png <–Backdrop
I used 2 images, one for the backdrop and one for the fill of the progress bar.
This should allow you to fill the progress bar smoothly and still have those chunks.

  • AnalyzerWindow:

You can add them manually from the *UserCreated * tab of the palette. Renaming is optional but hey, who am I to judge :]

  • SpecAnalyzer16

Yup, it’s empty. You can fill manually (in a similar fashion as above) or do this:

The bottom (greenish) bit is how you’d access the widget data. This can be improved on many levels (like adding all the individual progress bars to an array in order to avoid casting altogether).

Even though the whole setup may not be what you had in mind, it should give you a rough idea on how to automate things a little. Any questions, don’t hesitate.

Thank you ‘Everynone’, most impressive! This helps a great deal =].

I will keep you updated as per progress…

Hey Everynone,

Before I get started on this. Is your ‘Progress Bar’ fill image ‘10 x Blue Square Blocks’?

Also, is there a way to reference literal string variables as I have made, e.g., varTrackX_OctaveY_NoteZ, where X, Y & Z are passed via the midi event, thus variable string or name would equal “varTrack”&X&"_Octave"&Y&"_Note"&Z?

Hope this message finds you well?!

There’s not really any need to set it up the way you have - you can just use a custom progress bar texture. For example, I use a progress bar to indicate ping in my server list window - which looks like this:

Ping.JPG
ProgStyle.JPG

Granted, the areas in-between won’t show on your spectrum analyser - but you can always just bias the incoming values so that they always sit inside one of the bars. This is much cheaper than what you’re trying to do at the moment -your slate draw time must be insane.

If you have a look at the first widget I posted, the progress images (fill & backdrop) are attached:

I hope that’s what you meant.

Not exactly sure what you mean but I believe you want to access the widget and pass the data. I’d create an array for any children a widget can have and access them by index (as seen in my first post). You could set up a custom event in the master widget telling children what to do, something along the lines of:

Hey ‘TheJamsh’,

It’s as hud to display all the midi notes playing, hence 1920 progress bars are used.

Thank you for your help.

Ah Everynone, ok, so you have a background frame image that contains the fill image consisting of 10x blue boxes. Whereas I have individual boxes (notes) x 11 octaves x 16 tracks. So one bar of 12 notes could represent ‘myProgressBar’?!

On your last image, the first GET node has a target:octaves. My target is for instance Track(0-15)_Octave(0-10)_Note(1-12). Could the required target be made up of a literal string, e.g. “Track” & (0-15) & “_Octave” & (0-10) & “_Note” & (1-12), where bracketed terms are produced by ‘forloops’. Hope this explains better.

Yup.

You can use *Append String *node to create a series of strings with consecutive numbers:

Untitled.png

Cool, get it now what you did with your progress bar, thank you.

Ah, but how do you get the result (Return Value) to directly reference a HUD progress bar based upon the constructed string?

A big thank you by the way =].

If there’s a way, it will be a tad hacky and most likely counter-intuitive. Why would you need to do it this way? I am under the impression that you are not tackling it right, I might be wrong, though.

You could use SwitchOnString (top):

or ever so slightly elegant *Enumerator *(bottom).

Both are rather fugly for this purpose, imho.

Maybe you could shed some light on the format the data arrives in; it would make suggesting something more constructive easier.

edit: make sure you rename the pins on the string switch node

Here’s the MIDI Octave-Note relationship:

I have stupidly (as you know) named 1920 (No, 2112, even more stupid) progress bar variables, e.g. Track(0-15)_Octave(0-10)_Note(1-12). I can individually set the percentage of the each progress bar.
As you initially mentioned I should have taken the array based approach as the midi event produces a byte value between 0-127; again stupidly I thought I’d lay the HUD out to have a logical naming system, hence I could determine each note within each octave within each track.

The MIDI event is as follows:

Where:
Type = N/A
Channel = 0-15 (i.e. Track)
Data1 = 0-127 (i.e. Note)
Data2 = 0-127 (i.e. Note Velocity)

So in essence, the latter, Data2, will map to ‘Set Progress Bar Percentage’ via a clamp node [0-127 => 0.0-1.0]. Being as the HUD variables have been created statically, I’d like to somehow reference their names automatically based upon the MIDI data produced.

Hope this explains better.

Couldn’t agree more. That would slot into your neat tables rather nicely. If I were you I’d drop the whole 2000+ named widgets approach; as TheJamsh mentioned above, the performance cost of pulling it off must be truly staggering.
Essentially, have a *CustomEvent *in the master widget and feed it Track index, Octave index and clamped percentage value for Note. Or thereabouts.