to midi1 ; (C) 2000 jfuller EDUCATIONAL ; A procedure written by J P Fuller 2000 to ; demonstrate how use 'buttons' to control MIDI procedures ; The screen window in a SVGA system set to 800 x 600 pixels ; is 400 wide by 300 high windowcreate "main "mywindow "MIDI1 10 0 300 150 [] ; Creates a sub-window called "MIDI1" ; NOTE: You can remove this window on closing with a ; windodelete "mywindow command. ; NOTE - The "[]" is a left/right square bracket. It is essential!" groupboxcreate "mywindow [ box] 10 10 275 110 ; Draws the rectangle around the main window ; NOTE: Screen co-ordinates are: x1, y1, x2, y2 (ie Horiz, Vert) buttoncreate "mywindow "A "1 25 25 10 10 [midimessage (list 192+3 104) midimessage (list 144+3 50 100)] buttoncreate "mywindow "B "2 25 50 10 10 [midimessage (list 192+3 112) midimessage (list 144+3 50 100)] buttoncreate "mywindow "C "3 25 75 10 10 [midimessage (list 192+3 122) midimessage (list 144+3 50 100)] buttoncreate "mywindow "D "4 25 100 10 10 [midimessage (list 192+3 127) midimessage (list 144+3 50 100)] buttoncreate "mywindow "E "5 150 25 10 10 [print midiopen] buttoncreate "mywindow "F "6 150 50 10 10 [midiclose] ; The lines above set up the six individual control buttons. ; The letters "A"to "F" are needed for naming purposes, ; but the names do not appear on the screen. ; The numbers "1" to "6" appear as button 'labels'. buttoncreate "mywindow "Close [Close Window] 225 125 60 10 [windowdelete "mywindow] ; This line closes the sub-window opened in the first line. staticcreate "mywindow "W [Voice 1] 45 25 80 10 staticcreate "mywindow "X [Voice 2] 45 50 80 10 staticcreate "mywindow "Y [Voice 3] 45 75 80 10 staticcreate "mywindow "Z [Voice 4] 45 100 80 10 staticcreate "mywindow "R [Open MIDI] 175 25 80 10 staticcreate "mywindow "S [Close MIDI] 175 50 80 10 ; These lines create sub-windows in mywindow and ; write the text contained between the square brackets. ; NOTE: Make sure the sub-windows are large enough to ; hold all the text, or it will simply disappear! end