Once the radio buttons were shown to be a way to pick the MIDI controller to be adjusted, a demo of a method to make the adjustments was attempted. The objective was to use the mouse so that it could be moved to adjust the value and click to set the controller value. I also wanted the option of changing the controller value in real time as the value was changed.
As it turned out, it will be a simple matter to implement…. next time.
A touch area is drawn on the screen. When the mouse pointer is over this area it can be moved left or right to adjust a value between 0 and 127. When the value is set, a click of the mouse button will cause the MIDI CC value to be set and sent to the NTS-1.
Also above the touch area, holding down the mouse button will change the CC value in real time as the mouse is slid left or right. I have been referring to this object as a slide( for lack of a better work).
The ATR has the working demo and .Included files. The #Dn: most likely need to be changed before compilation.
You can run SLIDE.APP from the Diamond desktop. Move the mouse over the slide. Press and hold the button to change the value as the mouse is moved. Press Q to quit demo.
In the source code below that line 150 - 180 draws the slide area. Having it look like a musical staff was quite unintentional.
The code to use the slide is within the event loop but not part of DIAMOND's EVENT call. Line 220 -460.
Lines 220 - 350 checks to see if the mouse is within the slide area.
If not the program jumps to perform the EVENT call at line 470 - EL1.
Line 360 -370 sets the SCREENX value to an output value of 0-127.
Line 390-400 displays the value of the slide
Line 410 gets CLICK , 420 if 0 then go back and check if still in slide area.
Line 430 show slide value in value(this is were the MIDI CC command will be sent)
Line 440 force the CLICK VALUE to 1, it could be 2,3 if double clicked.
Line 450 keep checking until mouse is outside slide.
10 ;SLIDER INPUT DEMO
20 ; MOUSE INPUT BY CREATING TOUCH AREA.
30 ;K. PACKARD 3/23/2023
40 *= $2000
50 .OPT NO LIST
60 .INCLUDE #D1:DMACRO01.M65
70 .INCLUDE #D2:SHOWINFO.JSR
80 .INCLUDE #D1:BYTE2DEC.JSR
90 QICON .BYTE 0,60,102,102,102,108,54,0
0100 VAL .BYTE 0
0130 INIT 0
0140 INSTALLICON 0,10,10,1,8,QICON
0150 PLOTBOX 32,130,159,150,2,1
0160 PLOTLINE 32,135,159,135,2,1
0170 PLOTLINE 32,140,159,140,2,1
0180 PLOTLINE 32,145,159,145,2,1
0190 JSR SHOWINFO_JSR
0220 ; CHECK SLIDER ROUTINE
0230 LDA SCREENY ;MOUSE Y POS
0240 CMP #130 ;ABOVE GO EL1
0250 BCS LOC1
0260 LDA SCREENX
0270 JMP EL1
0290 CMP #150 ;BELOW GO EL1
0300 BCC LOC2
0310 JMP EL1
0330 LDA SCREENX ;MOUSE X POS
0340 CMP #32 ;RIGHT GO EL1
0350 BMI EL1
0360 CLC ;MOUSE OVER SLIDE
0370 SBC #31 ;LOCATION TO VALUE
0380 STA VAL
0390 JSR BYTE2DEC ; SHOW SLIDE VAL
0400 SYSDRAW B2DSTRING,30,120,0
0410 LDA CLICK
0420 BEQ ELOOP ;MOUSE BUTTON UP
0430 SYSDRAW B2DSTRING,30,40,0
0440 LDX #1
0450 STX CLICK
0460 JMP ELOOP
0470 EL1 EVENT ;DIAMOND EVENT LOOP
0480 LDA EVENTTYPE
0490 BEQ ELOOP ;NOEVENT
0500 CMP #1 ;ICON EVENT
0510 BNE ELOOP
0550 *= $02E0
0560 .WORD START