Modality-toolkit icon indicating copy to clipboard operation
Modality-toolkit copied to clipboard

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

Open madskjeldgaard opened this issue 6 years ago • 2 comments

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!

madskjeldgaard avatar May 20 '19 17:05 madskjeldgaard

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 )
	)
}
),
// ...

LFSaw avatar May 21 '19 12:05 LFSaw

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!

madskjeldgaard avatar May 23 '19 18:05 madskjeldgaard