Formatting Screen Information: Number of Digits Changes

Hey :slight_smile:

Yay I got a new power suplly for my Organelle and now it behaves 100% normal. Happy about that, thought I had gotten a broken one, but it was luckily an easy fix :slight_smile:

Anyway, working on something where I have more than 1 parameter on a single line. Its all nice but the problem is the display “jumps” around alot, when you for example change from a 2 digit number to a 3 digit number on the first parameter. Its not a problem for the first parameter on the line, but the second value on that line, will move around every time you change the first parameter from a 2 digti number to a 3 digit number for example.

Example:
CutOff-120…On/Off-1
CutOff-40…On/Off-1
CutOff-4…On/Off-1

I know it doesnt look like much, but on the small display it can become rather confusing when the value are jumping around all the time.

So do anyone have any idea how to force pd/organelle to always show 3 digits?
001
012
124
etc…

I think that would solve it in an easy way.

Have a nice evening.

Oh that was fast :slight_smile:

Yeah I see , I need to take it a step down to do that.

All though I am thinking it might be possible by making the individual digits into individual messages, then make them into a list Then make a function that checks if the list is 3 digits long. If only 2 numbers in the list, then insert a zero as the first number, then split the list up again…But not sure if its possible but going to try tomorrow, I think.

Thanks :wink:

1 Like

@chrisk

Ahhh, found a much easier way, I think. Didnt test in in practice, but it looks promising:

07

This is awesome :slight_smile:

This make having 2 parameters on a line a lot more tidy :slight_smile:

Okay so tested it this morning it works, you can have 3 fixed digits on the display, so the values will be fixed to a certain place on the display… To a certain point, if you got below -99 it will add an extra digit and if you go above 999 it will add n extra, but all low numbers like 9, 12, 77 will be represented as 009, 012, 077.

Loos like this, nice and tidy with 2 parameters on a single line, no jumping lines :slight_smile:

Sorry picture is taken form my old Iphone4.

IMG_0174

Next thing would be to figure out how to make empty spaces, so the top line menu can be position the like rest :slight_smile:

be aware because the screen display is sent via pd messages, there are some some limitations (as messages cannot contain arbitrary data, e.g. multiple spaces)
this is why i don’t do the screen display this way in orac.

also its why @oweno suggestion to use the new ‘graphics api’ is important, as gPrintln allows you to print at exact positions (this also makes it a bit more efficient since you dont need to keep sending things like text labels) …
generally id recommend moving to the graphics api, its more flexible, and one your used to the coordinate system , as easy to use as the old screen lines


@oweno / @chrisk , what we probably should do in next ‘firmware’ update is create a gPrintln variation, thats takes a standard printf string, so you can do things like /gPrintln 0 0 “pitch %03.4f” 440.0

Yeah I could try that, but I am foreseeing lots of work figuring out how to do that which I dont want to spend right now. I think this works well, only problem is the spaces for the menu line, which is only a very small issue… I am sure this can be sorted with some trickery by packing more symbols together in a clever way, before sending it to the display.

Okay just tested it looks pretty simple actually :slight_smile:

I can draw text, but I guess i need to check an example or two to find out how to add numbers to the display. I tried adding a "small-$1 to draw a number next to the text, but I got som white squares instead. Anyway, back to testing :slight_smile:

Edit:

  • Got it. Yeah this is much easier and looks better. Thanks for the pointers :wink:

Ahh, to beo honest after trying a few hours last night I did not manage to get several names and numbers on the display.

As I understand it, it seems that I have to clear the display befor writing new stuff to it. But the problem I experience is that when I clear one message it clears the whole display, so any parameters all ready written to the diplay will be deleted when you clear it to write something new to it.

How do you guys handle that?

It would be uper cool if you could only clear a part of the screen, where you previously had written to, like for exanple type in the same x y position for the clear function so it only clears that part of the screen.

But maybe I am missing something here?

you can achieve this using the gFillArea message and setting the color to 0 (black)

Ahh, yes, that will probably do it. I tried with the gprint first but that didnt work well.

Thanks :slight_smile: