Author Topic: Extracting gm.dls samples for tiny demo trackers  (Read 18759 times)

0 Members and 1 Guest are viewing this topic.

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Extracting gm.dls samples for tiny demo trackers
« Reply #20 on: May 03, 2007 »
Sounds like a mission :)

Jim
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Extracting gm.dls samples for tiny demo trackers
« Reply #21 on: May 14, 2007 »
I already did my tests with playsound and directsound, and I'll be using directsound, I'm finding it very powerful (as it should be) and I have coded a basic player and working on a tracker.

Player features:
- 4 sound channels (can be expanded to 8 channels)
- 8 gm samples
- 32 rows per page
- 8 pages
- 32 postions for pattern order
- Player runs in real time, yeah I can easily add synch with intro effects.

There's no fx added yet, only volume control for each sample.

It's very very simple player, but it can able to produce some sort of music ;) , oh yeah and very tiny - around 650~700 bytes for player and music data.
Challenge Trophies Won:

Offline taj

  • Bytes hurt
  • DBF Aficionado
  • ******
  • Posts: 4810
  • Karma: 189
  • Scene there, done that.
    • View Profile
Re: Extracting gm.dls samples for tiny demo trackers
« Reply #22 on: May 14, 2007 »

There's no fx added yet, only volume control for each sample.

It's very very simple player, but it can able to produce some sort of music ;) , oh yeah and very tiny - around 650~700 bytes for player and music data.


Try adding reverb or any fx and see what size your exe jumps to - my guess is you'll be >1k.

Well done on producing all that!

Chris
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Extracting gm.dls samples for tiny demo trackers
« Reply #23 on: May 15, 2007 »
Quote
Well done on producing all that!
Thanks, just looking to what you already did, make me motivated to code my own!

Quote
Try adding reverb or any fx and see what size your exe jumps to - my guess is you'll be >1k.
Ok, I'll see what I can do...

Btw, do I really need to add midi notes (change frequency) for the samples, you know, I'm not a musician and I don't know if I *must* add this...  ???
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: Extracting gm.dls samples for tiny demo trackers
« Reply #24 on: June 22, 2012 »
Excuse the necro-posting, but I've been playing around with GM.DLS and using Jim's example program as a reference.

I noticed a little problem when processing extra elements in GM.DLS RIFF file. Sometimes the payload (data) for an entry is marked as having an odd number of bytes. In this case, the data is padded with an extra byte in the DLS file. This was causing me a few problems, which I resolved by changing the 'dlist' method slightly:

I changed

      riff = (unsigned int *)((unsigned char *)riff + 8 + *(riff+1));

to

      unsigned int dataSize = *(riff+1);
      if (dataSize % 2 != 0) dataSize++;
      riff = (unsigned int *)((unsigned char *)riff + 8 + dataSize);

It then takes into account the extra padding byte and enables you to process any of the elements without issue. Just for reference, the issue I experienced was due to the uneven ICOP entry in the INFO lists.

I thought that this may prove helpful to someone at some point. Depending on how deep I end up delving with this, I may have a C# application similar to Blackpawn's at some point. If so, I'll post a link to it on the forum.
raizor

Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: Extracting gm.dls samples for tiny demo trackers
« Reply #25 on: June 23, 2012 »
I had a little trouble tracking down the PDF specs document for DLS files (lots of dead links). I've attached it to this post.
raizor

Challenge Trophies Won: