Cabbage Logo
Back to Cabbage Site

SCREEN_WIDTH and SCREEN_HEIGHT not passed to csound?

I’m trying to access SCREEN_WIDTH and SCREEN_HEIGHT in csound… but it doesn’t seem that they are there. I can see my own cabbage macros, they appear as strings. For example:

  Smsg = sprintf(" !!! My Test : %s\n", "$RED_KNOB")
  prints Smsg

Shows the expected output with my cabbage macro included… but

  Smsg = sprintf(" !!! My Test : %s\n", "$SCREEN_WIDTH")
  prints Smsg

!!! My Test : $error

Any suggestions?

I’ll take a look. Most likely a bug, but the Csound macro system seems to change quite a bit too, so who knows. It was working right?

That’s a great question… honestly I’m not sure. :rofl: I hadn’t been using them lately, but I vaguely remember doing some tests and proof of concepts with macros getting passed through, and I know I had an idea to make use of the screen boundary macros, but I don’t think I ever actually did. It was so long ago…

Oh, btw… I do use those macros ALL the time in the cabbage section, it’s just now I’m looking to try to have widgets that are aware of the screen boundaries… I’m trying to animate screen elements to fade in or slide in rather than just appear :exploding_head:

Here’s an example… it’s a bit large:

Your GUIs are really interesting. You get Cabbage to behave like a somewhat half decent GUI toolkit! I’m impressed!

1 Like

That’s the best compliment I could receive, thanks! The goal of my project was exactly that… to develop a sort of toolkit on top of cabbage that is easy to use but very flexible and powerful! :nerd_face:

I just made a few changes in the git repo that fix some include errors for windows users, with the exception of having to replace the symlinks with actual copies of ./includes and ./plants directories for Effect or Instruments (I don’t know how to make something in git that works as symlinks for both win and lin/osx) :blush:

I don’t remember what your main OS is, but if you had issues with that it’s been “fixed”.

My goal with having those screen macros available is to make the “FX Panel” on the right side automatically be aware of the form width, so that it can place itself just off screen, plus it can then calculate where to move to based off that. Currently I have to provide start and end x/y coords to the UDO custom for each instrument to match it’s form size.

I’ll take a look when i can. I just got lumped with an entirely new module to teach this semester, which starts in 2 weeks :flushed: So when I get a week or two’s worth of lectures prepared I’ll take a closer look at what’s going on here :wink:

Awesome, thanks. I don’t mind waiting for it… but I definitely appreciate the heads up so I don’t stall hoping for a fix any day.

I have a few other aspects of the project I can shift focus to for now… such as filters, I really want to get those opcodes and widgets in. I love them and am obsessed with putting them everywhere in my signal chain! :exploding_head: