Archive for March, 2010

I had almost uploaded MidiToWAV version 2, but all final moments, I found BASS.DLL. And it changed my mind.
It can connect MIDI device much faster than what I did (actually, BASS does not connect to the device) and as you already know, that can replace your SoundFont. This makes the MIDI sounds much better. Therefore I want to use it in my program.

There was a problem I encountered now.
There is nothing to do for end-users, but for programmers.
BASS_ChannelPlay(chan, FALSE);
FALSE, it means that it will not loop. But it does, after all. It seems to ignore it if timer is running.
If anyone knows how to stop the loop MIDI playback, I would like to know it. Cpp, Pascal, C # … Any code is appreciated.
What I can see is that I need something like very precise timer.

There was another problem.
You must have SoundFont. If you have a newer PC and your soundcard is not Creative Labs, you may not have it. But there are many websites offering free SoundFont. Just download it and load into MidiToWav. You do not need to install and do this and that. Without such a hassle. If you have a sound card, it works.
Since BASS does not use hardware, MidiToWav does not do that either.

I tested the New Audio components, and it was Huuuuuum. It’s hard to say. It is very strange thorny or trigger sound when I play. Quite annoying. But it worked very well to encode the WAV file to another.
So I will include WAV file encoder with MidiToWAV.
If you’re wondering, I still cannot record sound with New Audio components. I gave up.

There is one more thing I must write.
As you can see previous posts (MidiToWAV), I used the SKIN, but in the meantime, SKIN manufacturer updated its components and it began to stop working in my program. So I decided not to use these things.
It looks good but functionality… Nothing but heavy.

Anyway, it’s a bit delay for a new version. :)

miditest.png (17 KB)

MIDITEST is a program that can play MIDI files and use the SoundFont in your system and even replace it with another if you want it.
You must have at least DirectX3 or newer. People tend to have much newer nowadays. If you have Windows7, you have DirectX11.

I found BASS.DLL (http://www.un4seen.com/) handling MIDI decently and in addition it can read and play SoundFont.
Actually, it was an example program with some programming language in the package I downloaded from the BASS website and I modified a bit. It is what you have here.
Since the original files were open source, so you have them too, I think. I just put a few buttons, and wrote a few lines of code – really just a few lines.
You can either download the software files or source code in Delphi. You can download both if you wish, of course.

When you start this program, you see the SoundFont your computer is set to. If you cannot see it, your computer does not use it at all. If you have a newer computer, it’s so sadly. But you can do it with this program.
The SoundFont is quite large if you want a good sound. And I would not include it in this package. Fortunately, BASS website is such that you can download it for free.

These files will not be updated in the future.

miditest Exe (323 KB / includes everything you need)

Hashes

MD5: DD1A5C88E5768D6C3026D947A4220B05
SHA1: C4F65604A27021249E611A5D2D4D8E655DBDE20B

miditest Source (136 KB / includes everything you need to compile with Delphi)

Hashes

MD5: F2026F54D38CBB487722761E2E24C9D7
SHA1: 66B960368AA35AC9401383186EC862878087096A