Jump to content


Photo

emulating / simulating a soundchip


  • Please log in to reply
10 replies to this topic

#1 DidiThePig

DidiThePig

    GMC Member

  • GMC Member
  • 14 posts

Posted 05 November 2011 - 07:38 PM

Hello

I am dreaming about emulating/simulating a soundchip...


( For those who don't know what soundchips are, they basically were tiny synthesizers integrated inside 80's and early 90's game consoles and they generated music sounds during the game like you would play on a piano while reading sheets. )


I though about simply loop-playing tiny waveform samples and vary sound-playing-speed to have different notes. But unfortunatly GM can't vary sound-playing-speed... So, looks like it won't be possible with a simple gml script, maybe I'll have to create an extension (I don't know anything about extensions yet).

I guess this would be quite a big work, but most of all I wonder how to. So let's share ideas.


Nowadays, many people create tracks trying to imitate this nice retro chiptune sound. But it's a real shame, a huge bandwith waste for our websites, and a non-sense to me, to have several 2MB mp3/ogg files of some tracks we made sound exactly like it would have sounded on a SEGA GameGear 20 years ago, while at this time those tracks would have been only a few bytes in the game's rom since it just contained the music sheet for the soundchip to play it. :rolleyes:


PS :
I know about dlls which permit to play mods, and mods can sound very similar to soundchips while keeping quite small, but I want to avoid dlls so my projects can later be converted to other platforms when I'll get GMStudio.
I don't want to use midi files neither, they don't sound "8bit" at all !

Edited by DidiThePig, 05 November 2011 - 07:42 PM.

  • 0

#2 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14385 posts
  • Version:GM:Studio

Posted 05 November 2011 - 07:43 PM

I want to fly without wings too... You need a dll for that
  • 1

#3 theg721

theg721

    G Dawg

  • GMC Member
  • 1959 posts
  • Version:GM8

Posted 05 November 2011 - 08:29 PM

I want to fly without wings too... You need a dll for that


He doesn't need a dll, but he will need midis (and what's bad about them?).
  • 0

#4 DidiThePig

DidiThePig

    GMC Member

  • GMC Member
  • 14 posts

Posted 05 November 2011 - 09:17 PM

He doesn't need a dll, but he will need midis (and what's bad about them?).

I don't want to use midi files because they sound different from a computer to another one depending on the sound card and the soundbank, and they don't sound like old console games at all. But I am ok with using midi files as sheet, and having midi files tracks played by a soundchip simulation, the problem is then I would have to write a script to dissect info from midi files while it would be far easier to just use a table as sheet.

I thought about extensions because I had a look at gmpokey and it generates sound without a dll.
But I just downloaded Extension Maker and noticed that dll can be included inside extensions... In deed, it seems to me that extensions and libraries won't let me do anything more than gml does since they are in gml, unless I add a dll and I don't want to. :\

Edited by DidiThePig, 05 November 2011 - 09:22 PM.

  • 0

#5 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14385 posts
  • Version:GM:Studio

Posted 05 November 2011 - 09:25 PM

You need to poke the sound card with frequencies and durations. This can only be done natively.

The only method is to make a sound file (wav or mp3/ogg). But then your system is static.

On the other hand, you could have a few sample sounds and mix them in a very limited way.
  • 0

#6 DidiThePig

DidiThePig

    GMC Member

  • GMC Member
  • 14 posts

Posted 05 November 2011 - 09:37 PM

Yeah I thought about using samples, it was my first idea, but I would need to change the sample's playing speed to have different notes, and it is not possible in GM.
Or I would need a sample per note... :ermm:
  • 0

#7 Medusar

Medusar

    GMC Member

  • GMC Member
  • 1228 posts
  • Version:GM:Studio

Posted 06 November 2011 - 10:20 AM

You could use the built-in Doppler effect to change the frequency of a sample...
  • 0

#8 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 16791 posts
  • Version:GM:Studio

Posted 06 November 2011 - 10:36 AM

You could use this sweet little program to convert midi to 8-bit chiptune wav files...

http://www.geocities...B236/indexE.htm

I used it to great effect in my PIXEL Blast game recently!
  • 0

#9 DidiThePig

DidiThePig

    GMC Member

  • GMC Member
  • 14 posts

Posted 06 November 2011 - 06:02 PM

You could use the built-in Doppler effect to change the frequency of a sample...

Thanks for the idea, I did not know about this effect, I'll try. But isn't sound_3d_set_sound_velocity(snd,x,y,z) related to direct3d ? If so, it won't work on other platforms when I'll get GMStudio.

You could use this sweet little program to convert midi to 8-bit chiptune wav files...

Thanks but my goal is to avoid wav/mp3/ogg files, their "huge" size is the main reason why I want to simulate a soundchip instead, so my musics will be <2KB size instead of 2MB each.
( This program sounds really great, it should be integrated inside GM so GM plays midi files that way.:happy: )

Edited by DidiThePig, 06 November 2011 - 06:28 PM.

  • 0

#10 SyncViews

SyncViews

    GMC Member

  • GMC Member
  • 392 posts

Posted 06 November 2011 - 09:49 PM

GM doesnt have the capability for you to provide in memory sound data and play that. The best I can think of is to have your game write out a wav file (the basic uncompressed form is really simple, so you can just do it with the GM binary file functions) then have GM load that as a resource and play it. To do better than that you need a dll.
  • 0

#11 Medusar

Medusar

    GMC Member

  • GMC Member
  • 1228 posts
  • Version:GM:Studio

Posted 07 November 2011 - 02:32 PM

You could use the built-in Doppler effect to change the frequency of a sample...

Thanks for the idea, I did not know about this effect, I'll try. But isn't sound_3d_set_sound_velocity(snd,x,y,z) related to direct3d ? If so, it won't work on other platforms when I'll get GMStudio.

A DLL by definition won't work on other platforms. The 3D sound functionality may however be implemented on other platforms (though it's impossible in HTML5 at the moment). Your best guess for making your solution work cross-platform is to use native GM functions only. If you don't want to use the Doppler effect, separate samples for each and every tone is the only thing I can personally think of.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users