Playing a single MIDI note

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
Posts: 1
Joined: Sat Mar 15, 2008 9:20 pm

Playing a single MIDI note

Post by mpnqb » Sat Mar 15, 2008 9:28 pm

Does anyone know how to do it without having to create a MIDI file with one note?

Better yet, what is there out there that plays MIDI files that can integrate well with RelLib? Is DirectQB better than RelLib for this kind of thing?

Some of you may know me for EnSpireMe, the first Qbasic GUI with dithering. This time around, I'm working on a game, and I need something good for sound.

The game is currently untitled, however it involves dogs and is a sidescrolling platformer. I was actually going to build it using basiegaxorz for the Sega Genesis, but I kept forgetting how to do everything after I took breaks. Besides, I'm better with qbasic anyway :D

Posts: 49
Joined: Sun Nov 20, 2005 5:41 pm
Location: Wisconsin

Post by BDZ » Sun Mar 16, 2008 4:27 pm

I don't know how to play one midi note. However, Qmidi seems pretty good as a library for playing midi files. The compact version doesn't add much code, and I tested it in a rather intensive application and I didn't see any performance impact.

I don't don't know about RelLib though, so I can't say how well Qmidi would work with it.

User avatar
Posts: 97
Joined: Mon Mar 17, 2008 11:14 am
Location: Estonia, Rapla

Post by TmEE » Mon Mar 17, 2008 11:26 am

The answer is direct I/O ( Port $330 or $300 ) along with General MIDI specification. Works in XP too, but the drums are out of sync usually (some XP MIDI emulation issue).

Here's a tracker I made in QB45 (plus a little bit of ASM) that works on MIDI : (its very old version though, 0.4 is current but around 300% better but not publically available as its used for commercial stuff........)

IF there's interest, I can let you use the MIDI playback code... This tracker is actually part of my sound engine for Sega Mega Drive / Genesis, but it works on MIDI so it could be used for QB45 stuff as it is written in it :)
Mida sa loed ? Nagunii aru ei saa :P

Post Reply