VOGONS


First post, by Mu0n

User metadata
Rank Member
Rank
Member

shot in the dark here, but with this very well made spec sheet:
https://docs.dream.fr/pdf/Serie2000/SAM_Datas … ets/SAM2695.pdf

does anyone have any remote experience at programming C in DOS so that I could send some bytes at a specific address? I'm not against using asm, but that adds a bit of an entry barrier for me as I'm more familiar with 6502 and 68000.

I want to send a MIDI command to a wavetable header. I'd test it out with the S2 Dreamblaster daughter board that connects to any old sound card wave header. The same little gizmo works as intended on both my 486's SB16 regular sound card, and my WeeCee wavetable header.
I just need help in these areas:

1) a no-nonsense C compiler that doesn't require a PhD to install and needs 28 libraries to be linked up for hello world to work
2) a way to use tools to find out the exact address of that wavetable header

if I can just send these 3 bytes

0x90 0x48 0x64

to the right pin/address, it will feel like a monumental win and will actually help me develop MIDI tools for other systems that use the same dream 2695 MIDI chip that's ubiquitous.

1Bit Fever Dreams: https://www.youtube.com/channel/UC9YYXWX1SxBhh1YB-feIPPw
AnyBit Fever Dreams: https://www.youtube.com/channel/UCIUn0Dp6PM8DBTF-5g0nvcw

Reply 1 of 6, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie

It's just general midi, yeah? So 99% of the time that means you want to talk to a MPU-401 UART, which by default means a data port at 330h and a status port at 331h. You get data to/from those ports by using the x86's "in" and "out" opcodes.
There's a quick primer at this link, with sample C code at the bottom: http://midi.teragonaudio.com/tech/mpu.htm
The exact syntax might depend on which compiler you use though.

Reply 3 of 6, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie

POKE is for accessing memory. For writing to ports you want to use OUT.

Reply 4 of 6, by Mu0n

User metadata
Rank Member
Rank
Member

I tried OUT in QBasic, it didn't work.

so I moved on to Borland C++ 3.1, and after I finally remembered that inp and oup were in conio.h, I was able to compile this main function, but it still doesn't work (the program runs, but is totally silent. I've tested midi output with other programs like megamid right before running my program, midi output is fine). Maybe you can spot a mistake in my simple one 'note on' midi command?

1Bit Fever Dreams: https://www.youtube.com/channel/UC9YYXWX1SxBhh1YB-feIPPw
AnyBit Fever Dreams: https://www.youtube.com/channel/UCIUn0Dp6PM8DBTF-5g0nvcw

Reply 6 of 6, by Tiido

User metadata
Rank l33t
Rank
l33t

This will make some sound in QB45 :

DECLARE SUB WaitMPU ()

CONST MPU% = &H330

OUT MPU% + 1, &H3F 'UART reset command

WaitMPU '---instrument
OUT MPU%, &HC9
WaitMPU
OUT MPU%, 16 'Whistle
WaitMPU '---volume
OUT MPU%, &HB9
WaitMPU
OUT MPU%, 7
WaitMPU
OUT MPU%, 127
WaitMPU '---pan
OUT MPU%, 10
WaitMPU
'OUT MPU%, 0 'LEFT
OUT MPU%, 64 'CENTER
'OUT MPU%, 127 'RIGHT
WaitMPU '---note on
OUT MPU%, &H99
WaitMPU
OUT MPU%, 40
WaitMPU
OUT MPU%, 127
PRINT "tone is playing"
SLEEP
WaitMPU '---note off
OUT MPU%, &H89
WaitMPU
OUT MPU%, 58
WaitMPU
OUT MPU%, 127

SUB WaitMPU

FOR i% = 0 TO 2000 'change to proper MPU401 ready bit wait
a% = INP(MPU%)
NEXT i%

END SUB

T-04YBSC, a new YMF71x based sound card & Official VOGONS thread about it
Newly made 4MB 60ns 30pin SIMMs ~
mida sa loed ? nagunii aru ei saa 😜