Triggering SID refresh by an event

Hi,

I’ve been thinking a bit about how to get ride off the SID 6581 ‘hanging VCA’ bug in a different way (except of the use of a noise gate). In most cases, I only want to stop that annoying sound in an easy way at silence - so at the end of a song or a jam. At the moment I just change a preset for SID 6581 core(s) to stop the sound manually. But that is awkward.

So my question: Is it possible to trigger the SID_SR_Refresh for predefined SID ID(s) by an special CC or (or thinkable by “Midi Stop”)? maybe configured for concerned core IDs in * .asm?

Sadly, I just do not have enough knowledge of ASM and the SID engine itself, but I can understand some sources looking over it. 

E.g. I do not know how to address a SID engine directly for the case of refreshing and if that works as expected. For example, I would like to know how to select the respective SID Core (or how parameters needs to be configured for that use case), which is needed before a SID_SR_Refresh. Pls, could someone possibly point me to the right direction?

Greetings,

rio

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