Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Setting transparency and/or puck attributes for XY Pad
Avatar
Member
Members
April 2, 2018 - 9:55 am
Member Since: July 21, 2016
Forum Posts: 33
sp_UserOfflineSmall Offline

Hi all,

 

I've poured through the advanced GUI tutorials - and created tons of errors trying to find a way to make a new instance of the XY Pad in order to make it transparent, so I can overlay it on top of a grid or some other graphic. I also wanted to tweak the puck or maybe even exchange it for another .png to make it fit the GUI better, but I have no clue where to start.

 

Does anybody know if there is a way to do this - or at least can point me to a tutorial I may have missed?

Avatar
Admin
April 2, 2018 - 1:25 pm
Member Since: January 29, 2017
Forum Posts: 656
sp_UserOfflineSmall Offline

You can set the background of the XY-Pad with any PNG. I did that in the synth book for the VectorSynth and AniSynth, overlaying a grid on top of it. You just call setBackground( ) and pass it a CBitmap* - it is defined in the CView:

void CView::setBackground (CBitmap* background)

The puck is kind of interesting. Its size is based on the setting for the round-rect attribute, which rounds the corners of the XYPad outline (frame). As you make the round-rect radius larger, the puck grows in size and is not based on a PNG image. You can find all this in the draw() function for CXYPad. The puck is drawn with the primitive drawing method called ellipse( ). See line 20 of xypad.cpp (that is the line number in the latest version of VSTGUI which is 4.6).

void CXYPad::draw (CDrawContext* context)

You can definitely customize this control. If you wanted to use a PNG file for the puck, you would need to override draw( ) for sure, and you'd need to use a CustomView and a subclassed CXYPad, with a mechanism for getting the PNG into the object. 

If you export your plugin as a VST3 with RackAFX, you can find my own subclass of CXYPad in the XYPadWP.h and .cpp files. I altered it to be able to draw the pad in a diamond shape, the same as the original vector joystick on the ProphetVS and Wavestation synths. You can also find where it is instantiated as a CustomView. 

- Will

Avatar
Member
Members
April 2, 2018 - 2:53 pm
Member Since: July 21, 2016
Forum Posts: 33
sp_UserOfflineSmall Offline

Hi Will.

 

Thank you for the detailed answer!

That is a lot more of a cohesive way versus trying to do it via editing the .xml file. Though I did set the background color to transparent (by setting its rgba values from ....ff to ....00), it would be easier to just insert the bitmap directly (plus resizing won't be as nightmarish).

 

I'll have to get more familiar with subclassing, so your example derived from the VST3 export sounds perfect.

 

Thanks again!

Avatar
Admin
April 2, 2018 - 4:10 pm
Member Since: January 29, 2017
Forum Posts: 656
sp_UserOfflineSmall Offline

Actually, you can do it in XML by setting the "bitmap" attribute of the XYPad:

<view back-color="~ BlackCColor" background-offset="1, 0" bitmap="vsjstick2" class="CXYPad" default-value="0.5" font="~ SystemFont" -- blah blah blah

The bitmap here is vsjstick2 and is declared in the bitmap chunk of the XML file:

<bitmap name="vsjstick2" path="vsjstick2.png"/>

- Will

Avatar
Member
Members
April 2, 2018 - 6:23 pm
Member Since: July 21, 2016
Forum Posts: 33
sp_UserOfflineSmall Offline

That is handy! I'm comfortable messing with the .xml files, so that can make life easier.

On a semi-related note, I noticed that since I gave some controls to the XY pad, I can no longer save the settings in my DAW as a preset. I assume the DAW maybe doesn't get the parameters from the XY Pad.

 

Is there a way to set it up so parameters can be saved in an arbitrary DAW?

Avatar
Admin
April 3, 2018 - 9:33 am
Member Since: January 29, 2017
Forum Posts: 656
sp_UserOfflineSmall Offline

Which API are you talking about - VST, AU or AAX and which version of RackAFX? You might have found something that changed with the newer versions or RAFX and I'd like to look into it. Let me know... The XY parameters should get saved like everything else. 

- Will

Avatar
Member
Members
April 4, 2018 - 2:26 am
Member Since: July 21, 2016
Forum Posts: 33
sp_UserOfflineSmall Offline

Hi Will,

 

It turned out to be an error on my part. I had set up a preset dropdown, however I had not resolved the default behavior correctly. Once I temporarily commented out that part of the code it worked perfectly. Sorry - I may have created some undue concern. So far I have only been messing with developing VSTs.

 

Nevertheless, any concern I have about the API (real or imagined) I'll share it for whatever fix is needed or so I could learn from my mistakes - whichever is applicable at the time. Definitely the latter applies in this particular case.

Thanks for the help!

Forum Timezone: America/New_York

Most Users Ever Online: 152

Currently Online:
8 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Chaes: 56

Skyler: 48

Derek: 46

Frodson: 45

Peter: 43

TheSmile: 43

clau_ste: 39

Nickolai: 39

JimmyM: 33

Gwen: 32

Member Stats:

Guest Posters: 1

Members: 738

Moderators: 1

Admins: 6

Forum Stats:

Groups: 13

Forums: 42

Topics: 815

Posts: 3146

Moderators: W Pirkle: 656