Author Topic: C# GM.DLS Parser (with source)  (Read 9377 times)

0 Members and 1 Guest are viewing this topic.

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
C# GM.DLS Parser (with source)
« 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.
« Last Edit: June 24, 2012 by Raizor »
raizor

Challenge Trophies Won:

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: C# GM.DLS Parser (with source)
« Reply #1 on: June 24, 2012 »
Awesome stuff!! K++ of course :)
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: C# GM.DLS Parser (with source)
« Reply #2 on: June 24, 2012 »
Thanks Ferris. Got looping working now too. Will post an update later.
raizor

Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: C# GM.DLS Parser (with source)
« Reply #3 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.
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: C# GM.DLS Parser (with source)
« Reply #4 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:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: C# GM.DLS Parser (with source)
« Reply #5 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.
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: C# GM.DLS Parser (with source)
« Reply #6 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:

Offline mrmudlord

  • ZX 81
  • *
  • Posts: 18
  • Karma: 1
    • View Profile
Re: C# GM.DLS Parser (with source)
« Reply #7 on: October 15, 2012 »
Already have some ideas for this, like a synth based on GM.DLS samples.

Nice parser btw, have some karma.

Offline upaddy

  • ZX 81
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
Re: C# GM.DLS Parser (with source)
« Reply #8 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.

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: C# GM.DLS Parser (with source)
« Reply #9 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?
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline AberAber

  • ZX 81
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
Re: C# GM.DLS Parser (with source)
« Reply #10 on: May 01, 2015 »
The source is still missing the required files so is not useful :(