Dark Bit Factory & Gravity

PROGRAMMING => C / C++ /C# => Topic started by: Raizor on June 23, 2012

Title: C# GM.DLS Parser (with source)
Post by: Raizor on June 23, 2012
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.
Title: Re: C# GM.DLS Parser (with source)
Post by: ferris on June 24, 2012
Awesome stuff!! K++ of course :)
Title: Re: C# GM.DLS Parser (with source)
Post by: Raizor on June 24, 2012
Thanks Ferris. Got looping working now too. Will post an update later.
Title: Re: C# GM.DLS Parser (with source)
Post by: 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.
Title: Re: C# GM.DLS Parser (with source)
Post by: Raizor 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?
Title: Re: C# GM.DLS Parser (with source)
Post by: 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.

I was trying to change pitch directly on sound buffer but got side tracked when I started messing with soft synth.
Title: Re: C# GM.DLS Parser (with source)
Post by: Raizor 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.
Title: Re: C# GM.DLS Parser (with source)
Post by: mrmudlord on October 15, 2012
Already have some ideas for this, like a synth based on GM.DLS samples.

Nice parser btw, have some karma.
Title: Re: C# GM.DLS Parser (with source)
Post by: upaddy on October 19, 2012
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.
Title: Re: C# GM.DLS Parser (with source)
Post by: Clyde on October 19, 2012
I've never heard of these, but am I right, GM.DLS = General MIDI - Downloadable Samples. What's the downloadable bit about?
Title: Re: C# GM.DLS Parser (with source)
Post by: AberAber on May 01, 2015
The source is still missing the required files so is not useful :(