0,++yPos,2,1,controlIdx++);
0,++yPos,3,1,controlIdx++);   addWidget(this,new ComboBoxWidget("Velocity curve",p, new SoundModel(p,snd,2,57,5),new ProgSender(snd,12,1,3), new String [] {"Normal", "Freerun", "Reset", "Reset-Freerun"}), 0,++yPos,1,1,controlIdx++);  addWidget(this,new CheckBoxWidget("Time Track", p, new SoundModel(p,snd,1,57,6),new ProgSender(snd,12,2,0)), 1,yPos,1,1,-1);   addWidget(this,new CheckBoxWidget("Sustain Pedal", p, new SoundModel(p,snd,1,57,7),new ProgSender(snd,12,2,1)), 2,yPos,1,1,-1);   addWidget(this,new ScrollBarWidget("Level",p,0,99,0, new SoundModel(p,snd,7,58,6),new ProgSender(snd,12,2,2)), 0,++yPos,3,1,controlIdx++);   addWidget(this,new ScrollBarWidget("Velocity modulation",p,-99,99,0, new SoundModel(p,snd,8,59,6,-99),new ProgSender(snd,12,2,3)), 0,++yPos,3,1,controlIdx++);
    public envelopePanel(String name, Patch p, int snd, int Func, int msByte, int msBit) {        super(name);        int ofs = (msByte-53)*8 + msBit;        int controlIdx=0, yPos=0;        // 76.	Sound pitch env attack	        12	0	0	0	99	7	53:0-52:2        // 77.	Sound pitch env decay	        12	0	1	0	100	7	53:7-53:1        // 78.	Sound pitch env sustain	        12	0	2	0	99	7	54:6-54:0        // 79.	Sound pitch env release	        12	0	3	0	99	7	55:5-54:7        // 80.	Sound pitch env delay	        12	1	0	0	99	7	56:4-55:6        // 81.	Sound pitch env sustain decay	12	1	1	0	99	7	57:3-56:5        // 82.	Sound pitch env trig type	    12	1	3	0	3	2	57:5-57:4        // 83.	Sound pitch env time track	    12	2	0	0	1	1	57:6        // 84.	Sound pitch env sustain pedal	12	2	1	0	1	1	57:7        // 85.	Sound pitch env level	        12	2	2	0	99	7	58:6-58:0        // 86.	Sound pitch env velocity mod	12	2	3	-99	199	8	59:6-58:7        addWidget(this,                    new EnvelopeWidget("Envelope", p,                            new EnvelopeNode[] {                                new EnvelopeNode(0, 100,                                        new SoundModel(p,snd,7,56,4+ofs),                                        0,0,null,                                        1,false,                                        new ProgSender(snd,12,1,0),null,                                        "Delay",null),                                new EnvelopeNode(0,99,                                        new SoundModel(p,snd,7,53,ofs),                                        99,99,null,                                        0, false,                                        new ProgSender(snd,12,0,0),null,                                        "Attack", null),                                new EnvelopeNode(0,99,                                        new SoundModel(p,snd,7,53,7+ofs),                                        0,99,                                        new SoundModel(p,snd,7,54,6+ofs),                                        50, false,                                        new ProgSender(snd,12,0,1),                                        new ProgSender(snd,12,0,2),                                        "Decay", "Sustain"),                                new EnvelopeNode(50,50,null,                                        0,99,                                        new SoundModel(p,snd,7,57,3+ofs),                                        0, false,                                        null, new ProgSender(snd,12,1,1),                                        null, "Sustain decay"),                                new EnvelopeNode(0,99,                                        new SoundModel(p,snd,7,55,5+ofs),                                        0,0,null,                                        0, false,                                        new ProgSender(snd,12,0,3),null,                                        "Release", null),                            }),                            0,++yPos,2,1,controlIdx++);    }