EnvelopeWidget

an example of the MKS7ToneSingleEditor:

addWidget(envPane,
    new EnvelopeWidget(
        " ", // the label
        patch, // the patch
        new EnvelopeWidget.Node [] { // an array for all nodes in the envelope
            new EnvelopeWidget.Node( // the first node
                0, // min x value
                0, // max x value
                null, // ParamModel for x value
                0, // min y value
                0, // max y value
                null, // ParamModel for y value
                0, // base for y
                false, // invert x ?
                null, // ParamSender for x value
                null, // ParamSender for y value
                null, // String name x
                null // String name y
            ),
            new EnvelopeWidget.Node(
                0,
                127,
                new ParamModel(patch, 16),
                127,
                127,
                null,
                10,
                false,
                new MKSToneSender(11),
                null,
                "ATK",
                null
            ),
            new EnvelopeWidget.Node(
                0,
                127,
                new ParamModel(patch, 17),
                0,
                127,
                new ParamModel(patch, 18),
                10,
                false,
                new MKSToneSender(12),
                new MKSToneSender(13),
                "DEC",
                "SUS"
            ),
            new EnvelopeWidget.Node(
                127,
                127,
                null,
                EnvelopeWidget.Node.SAME,
                0,
                null,
                0,
                false,
                null,
                null,
                null,
                null
            ),
            new EnvelopeWidget.Node(
                0,
                127,
                new ParamModel(patch, 19),
                0,
                0,
                null,
                0,
                false,
                new MKSToneSender(14),
                null,
                "REL",
                null
            ),
        }
    ),
    0, // gridx
    0, // gridy
    3, // gridwidth
    5, // gridheight
    19 // slidernum
);
The previous constructor doesn't use xpadding and ypadding and acts as if they are set to zero like below.

 addWidget(envPane,
     new EnvelopeWidget(
          " ",  //the label
         patch,//  the patch
         EnvelopeWidgetArray,
         0,  //xpadding (space at the right and left border) and
         0//  ypadding (space at the top and bottom border) are optional.
         ),
     0,  //gridx
     0,//  gridy
     3,  //gridwidth
     5,//  gridheight
     19 // slidernum
     );
Back to sysexWidgets