• Welcome to Dark Bit Factory & Gravity.
 

C# GM.DLS Parser (with source)

Started by Raizor, June 23, 2012

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Raizor

Attached is a little C# based GM.DLS parser (with source). It allows you to play the various sounds in GM.DLS and see information relating to the instruments.

Feel free to do whatever you like with it (or the code).

Here's some info from the readme:

GM.DLS Parser by Raizor v0.1
-----------------------------

Quick and dirty GM.DLS parser. I created this to help me experiment with the GM.DLS file and locate the various instruments for later use in a synth.

This will scan the DLS file and read the instrument details from the data. It then cross references the instrument with the wave data pool to locate the wave file data for the instrument. It allows you to cycle through the instruments and play them. I haven't added support for looping yet or the ability to export the sounds.

Usage:

1. Click "Process" and locate your GM.DLS file.
2. Use the combo box to select an instrument.
3. Press "Play" to play the sound.

A number of instruments contain links to multiple waves. This is done as there are often several versions of a particular wave at different pitches. Each wave is marked in the DLS with a note number. This app currently only plays the first wave for an instruemnt (usually Midi Note 20).

That's it for now. Thought this may be useful to someone. I'll probably end up updating it soon to add looping playback (and maybe envelopes).

Thanks: Jim and Blackpawn for thier DLS tools which I used as a reference when making this.


EDIT:

Attached a new version that supports saving the instrument sounds to .wav files.
raizor

Challenge Trophies Won:

ferris

Awesome stuff!! K++ of course :)
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Raizor

Thanks Ferris. Got looping working now too. Will post an update later.
raizor

Challenge Trophies Won:

Rbz

Very nice, it also reminds me some experiments I did some time ago.

Attached here some examples, the idea was to convert a .xm song to be used with gm samples, it was never properly finished.
Challenge Trophies Won:

Raizor

Quote from: rbz on June 24, 2012
Very nice, it also reminds me some experiments I did some time ago.

Attached here some examples, the idea was to convert a .xm song to be used with gm samples, it was never properly finished.

Those sound pretty decent rbz. How are you handling the different pitched notes?
raizor

Challenge Trophies Won:

Rbz

At that time I was using "Direct Sound" for this player and the simple (and tiny) way to change pitch was to use dsound "SetFrequency" function, works pretty well in real time.

I was trying to change pitch directly on sound buffer but got side tracked when I started messing with soft synth.
Challenge Trophies Won:

Raizor

Quote from: rbz on June 24, 2012
At that time I was using "Direct Sound" for this player and the simple (and tiny) way to change pitch was to use dsound "SetFrequency" function, works pretty well in real time.

Ah, I never knew that existed in Direct Sound. Handy to know, thanks rbz.
raizor

Challenge Trophies Won:

mrmudlord

Already have some ideas for this, like a synth based on GM.DLS samples.

Nice parser btw, have some karma.

upaddy

Hi. Thanks for the useful tool and code.

It looks like you have forgotten to include files in "output" folder.

Chunk.cs, WaveNative.cs and WaveOut.cs

Please include them.

Regards.

UPaddy.

Clyde

I've never heard of these, but am I right, GM.DLS = General MIDI - Downloadable Samples. What's the downloadable bit about?
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

AberAber

The source is still missing the required files so is not useful :(