Skip to content

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

Open

Description

@madskjeldgaard

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!

Activity

  1. LFSaw commented on May 21, 2019

    @LFSaw
    Member

    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 )
    	)
    }
    ),
    // ...
  2. madskjeldgaard commented on May 23, 2019

    @madskjeldgaard
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions