Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HelpFile improvement: How to write the gui part of a desc file? #325

Open
madskjeldgaard opened this issue May 20, 2019 · 2 comments
Open

Comments

@madskjeldgaard
Copy link
Contributor

Hi everyone

I've come across a problem and I'm not able to find the appropriate help file to help me along.

I'm specifically interested in how the automatic gui is generated from my desc file, or rather: What I can write in my desc file to affect how it looks/feels.

I recently added a MKtl description for the device "shanwan_ps3" here. If you open up that one as a virtual device like this:
c = MKtl('controller', "shanwan_ps3"); c.gui;

You will get a super weird gui where the buttons somehow have become really bad number sliders. This is probably my fault but I'm not totally sure how to fix it or generally make the gui parts of my desc files better. It would be really cool if anyone has time to write just a few lines of help about how to deal with this (or perhaps point me in the direction of the appropriate help file if it's already written somewhere). Thanks! Keep up the great work!

@LFSaw
Copy link
Member

LFSaw commented May 21, 2019

you might want to look at desc file for a similar controller... the layout for each element is determined by its elementType, the position by a separate key called style:

This creates a button in row 1.5, column 5

// ...
(
key: \bt,
elementType: \button, 
spec: \midiCC, 
\ioType: \inout,
\key: \fire,
midiNum: 42,
style: ( row: 1.5, column: 5 )
),
// ...

This creates 4 pads in row 2 with specifically set midiNum:

// ...
(
key: \bt,
shared: ('elementType': 'pad', 'spec': 'midiNote', \ioType: \inout),
elements: [1, 5, 89, 43].collect{|num, i|
	(
		key: (i+1).asSymbol,
		groupType: \noteOnOffBut,
		midiNum: num,
		style: ( row: 2, column: i )
	)
}
),
// ...

@madskjeldgaard
Copy link
Contributor Author

Okay, sorry. I made a mistake and wrote elementType: Button with a capital B in it which made these weird sliders. Okay, so then all I need to worry about in terms of gui layout is the style parameter. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants