since about 4 years i’m a happy owner of an mbseq. have spent so many wonderfull hours with this machine - thanks to torsten and the whole community.
now i’ve installed an AOUT, the J5 gate outs and some DOUT drum triggers to control my analogue gear. this work fine but the gate outs handle overlapping notes in a strange way. the gate always closes when the first of two overlapping notes ends, it doesn’t wait untill the second note ends. it is not possible to play legato notes.
i’ve found no information about this problem in the forum and i’m wondering if somebody else noticed this.
it’s always a surprise to read from people who are using a MIDIbox for so long time without the need for troubleshooting!
I remember that somebody reported this issue a while ago, my statement was that it requires a notestack for proper handling, and that there isn’t enough free RAM for such a feature (it has been solved in MBSEQ V4)
But I just got an idea how to realize a minimalistic 2-level notestack which should be sufficient for this purpose.
I’m currently not able to test this (I would have to open my MIDIbox to exchange MBHP_CORE_STM32 by a MBHP_CORE).
For the case that it doesn’t work and you’ve assembly knowledge: this is the change in src/midi_evnt.inc
;; --------------------------------------------------------------------------
;; FUNCTION: MIDI_EVNT_AOUT_GatePinSet
;; DESCRIPTION: Help Function which sets a Gate Pin independent from the interface
;; IN:
;; o pin number in WREG
;; o value in MIOS_PARAMETER1
;; --------------------------------------------------------------------------
MIDI_EVNT_AOUT_GatePinSet
SET_BSR GATES
movf MIOS_PARAMETER1, F
bz MIDI_EVNT_AOUT_PinSet0
MIDI_EVNT_AOUT_PinSet1
call MIOS_HLP_GetBitORMask
#if 1
;; extension for legato handling
;; if gate was already set, save this state in GATES_LEGATO
movwf PRODL
andwf GATES, W, BANKED
iorwf GATES_LEGATO, F, BANKED
movf PRODL, W
#endif
iorwf GATES, F, BANKED
return
MIDI_EVNT_AOUT_PinSet0
#if 1
;; extension for legato handling
;; if GATE_LEGATO flag is set, clear this flag and exit
;; otherwise clear the flag in GATES (so that the pin is set to 0)
movwf PRODL
call MIOS_HLP_GetBitORMask
andwf GATES_LEGATO, W, BANKED
bnz MIDI_EVNT_AOUT_PinSet0_Legato
MIDI_EVNT_AOUT_PinSet0_NoLegato
movf PRODL, W
call MIOS_HLP_GetBitANDMask
andwf GATES, F, BANKED
return
MIDI_EVNT_AOUT_PinSet0_Legato
movf PRODL, W
call MIOS_HLP_GetBitANDMask
andwf GATES_LEGATO, F, BANKED
return
#else
call MIOS_HLP_GetBitANDMask
andwf GATES, F, BANKED
return
#endif
[/code]
Best Regards, Thorsten.
I reviewed the code and think (resp. hope) that I found the error: when checking the legato flag via AND the MIOS_HLP_GetBitORMask function has to be used to isolate the flag (the MIOS_HLP_GetBitANDMask function would isolate all other flags…)
it works, but not from the start. the legato is correct after the second loop of the track, but then the last note keeps playing when i’m stopping the sequencer. gate doesn’t close.