Unfortunately, I do not have enough idea of asm, but I was able to implement at least a CC 120 (for a chosen midi channel), which reloads the same preset, which internally resets the registers. Maybe it is useful for someone to manually delete the hanging tone. At least you have to add following code in these files:
sid_midi.inc (insert before CC 123 detection: –> ;; check if All Notes Off (CC#123 == 0))
;; #######################################################
;; # CC 120 reload preset
;; #######################################################
;; check if CC 120 (CC#120)
movlw 0x78
cpfseq SID_MIDI_PARAMETER1, BANKED
rgoto SID_MIDI_CC_NoInitPreset
movf SID_MIDI_PARAMETER2, BANKED
bz SID_MIDI_CC_NoInitPreset
SID_MIDI_CC_InitPreset
goto CS_MENU_MS_NotifyInitPreset
SID_MIDI_CC_NoInitPreset
;; #######################################################
;; # END MODIFICATION
;; #######################################################
cs_menu_ms.inc (insert before program change routine -> ;; This function is called to forward a Program Change event to the control surface)
;; #######################################################
;; # init/reload preset routine
;; #######################################################
;; --------------------------------------------------------------------------
;; This function is called to forward a Init Preset event to the control surface
;; Input:
;; o midi channel in SID_CURRENT_CHANNEL
;; o patch number in SID_MIDI_PARAMETER2 of INDF0 lower value
;; --------------------------------------------------------------------------
CS_MENU_MS_NotifyInitPreset
;; request patch send to SIDs with matching channel number
SET_BSR SID_BASE
clrf PRODL ; PRODL used as counter
CS_MENU_MS_NotifyInitPresetL
;; calc pointer to channel entry
lfsr FSR0, CS_MENU_SID_M_CHN
movf PRODL, W
addwf FSR0L, F
;; check if channel number matches
movf INDF0, W
xorwf SID_CURRENT_CHANNEL, W, BANKED
andlw 0x0f
bnz CS_MENU_MS_NotifyInitPresetLN
;; get patch number matches (in this case don't change the patch)
movlw (CS_MENU_SID_M_PATCH-CS_MENU_SID_M_CHN) & 0xff
addwf FSR0L, F
andlw 0x7f
;; copy INDF0 to SID_MIDI_PARAMETER2 and masked 0x7f
movf INDF0, W
andlw 0x7f
movwf SID_MIDI_PARAMETER2
;; store patch number
movff SID_MIDI_PARAMETER2, INDF0
;; skip if patch change already requested
movlw (CS_MENU_TX_M_CTR-CS_MENU_SID_M_PATCH) & 0xff
addwf FSR0L, F
BRA_IFSET INDF0, 7, ACCESS, CS_MENU_MS_NotifyInitPresetLN
;; request patch change
movlw 0x81
movwf INDF0
CS_MENU_MS_NotifyInitPresetLN
incf PRODL, F
BRA_IFCLR PRODL, 2, ACCESS, CS_MENU_MS_NotifyInitPresetL
return
;; #######################################################
;; # END MODIFICATION
;; #######################################################
I know, it’s not the best solution (I miss my assembler depth … actually I just wanted to refresh the SR ). However, you must be aware that this will cause any changes to the preset to be lost. ..most of the code was taken from the program change routine. This CC is useful for me, after the 6581 was used and the SID is still audible after use. I can then trigger this CC to end the hanging sound.
Greetings, rio