MPU 401 MIDI

DOS specific questions.
angros47
Posts: 1637
Joined: Jun 21, 2005 19:04

MPU 401 MIDI

Postby angros47 » Jul 04, 2014 18:46

Try this:

Code: Select all

#lang "qb"

'Change this to your midi port
CONST midiport = &H330

'Put mpu into UART mode
OUT midiport + 1, &H3F
'If error
IF INP(midiport) <> &HFE THEN END

'Send data here

FOR i = 1 TO 127
OUT midiport, &HC0 'Set program
OUT midiport, 0 
OUT midiport, i   'program



OUT midiport, &H90 'Note on, channel 0
OUT midiport, 64  'Note number
OUT midiport, 64    'Velocity

SLEEP

OUT midiport, 64 'Note on, velocity 0 = note off.
OUT midiport, 0
NEXT


'Reset MPU (Exit UART Mode)
OUT midiport + 1, &HFF


I tried it in qbasic under dosbox, it works (at least, in dosbox for windows: dosbox for linux does not emulate MPU 401 unless a midi device is present).

Return to “DOS”

Who is online

Users browsing this forum: No registered users and 3 guests