MIDI test code

Description of your first forum.
Post Reply
User avatar
drone84
Posts: 9
Joined: Sat Apr 13, 2019 2:05 pm
Location: On Earth

MIDI test code

Post by drone84 » Sat Jun 08, 2019 9:43 pm

Hi, if you want to use the MIDI you can use this bits of code. It using the MIDI MPU-401 as an UART with the MIDI baud-rate.
THe code will read the Byte from the MIDI in port and sent them back on the MIDI out port

Code: Select all

                setas
                LDA #$FF        ; reset the  MPU-401 module
                STA MIDI_MPU_COMMAND
                LDX #100
                JSL ILOOP_MS
                LDA MIDI_DATA  ; get the 0xFE out of the way after the reset if on the module was in MIDI mode
                LDA #$3F        ; set the module in UART mode
                STA MIDI_MPU_COMMAND
                LDX #100
                JSL ILOOP_MS
                LDA MIDI_DATA  ; get the 0xFE out of the way
                LDX #100
                JSL ILOOP_MS
Loop_MIDI       ; this code will acte as a MIDI thru
                LDA MIDI_MPU_STATUS
                CMP 0
                BNE Loop_MIDI     ; no data received
                LDA MIDI_DATA    ; read the byte retrieved
                STA MIDI_DATA    ; dent it on the midi output
                BRA Loop_MIDI

Result :




If you have e rev B like me you will need to do e small modification in your cable (or on the motherboard connector). the 5V needed for the MIDI out is on the wrong pin (1) and need to be on the pin (4). Luckily its the pin just next to it.

Image

You will need this function for the delay, I haven't measured the timing so it's probably mot a "ms" loop delay.

Code: Select all

ILOOP           NOP
                NOP
                NOP
                NOP
                NOP
                NOP
                NOP
                NOP
                NOP
                NOP
                RTL

ILOOP_1         JSL ILOOP
                JSL ILOOP
                JSL ILOOP
                JSL ILOOP
                JSL ILOOP
                JSL ILOOP
                JSL ILOOP
                JSL ILOOP
                JSL ILOOP
                JSL ILOOP
                RTL

ILOOP_1MS       JSL ILOOP_1
                RTL

ILOOP_MS        CPX #0
                BEQ LOOP_MS_END
                JSL ILOOP_1MS
                DEX
                BRA ILOOP_MS
LOOP_MS_END     RTL
Give me anything with electronic and I will make it crash/bug
bzuidgeest
Posts: 41
Joined: Wed May 01, 2019 6:51 pm

Re: MIDI test code

Post by bzuidgeest » Tue Jun 11, 2019 9:15 am

What is the green add-on board in the top-left next to the midi. Seems to be in the audio path. Can't remember if I have seen that on the other device photo's out there...
User avatar
PJW
Posts: 24
Joined: Wed Apr 24, 2019 12:44 am

Re: MIDI test code

Post by PJW » Tue Jun 11, 2019 1:31 pm

It's on my board as well, so it's common to the Revision B boards. I'm don't know what it is either (I've tried searching on the part numbers on the board and its chip with no luck). I figure it is some sort of line-out buffer/filter/amp, because it is right next to the line-out ports in the back.
bzuidgeest
Posts: 41
Joined: Wed May 01, 2019 6:51 pm

Re: MIDI test code

Post by bzuidgeest » Wed Jun 12, 2019 11:37 am

I already suspected this to be on all rev B's. In audiophile land sometimes, things like op-amps are socketed so they can be replaced by "better" ones. I do not expect steff to be catering to that crowd. And steff seems to be to much of a perfectionist to leave such an obvious botch on there ;). So I got curious.
Post Reply