STsound / YM2149 programming

Advanced game related topics
The Real KrazyK
User
User
Posts: 12
Joined: Thu Dec 18, 2003 1:17 pm
Location: UK

STsound / YM2149 programming

Post by The Real KrazyK »

Hi All,
Being a ex Atari ST coder (GFA, STOS, 68000) i would love the chance to play all my chip tunes within PB. I know there are a lot of very talented ppl here so how about one of you genii taking a look at this soundserver c++ code:
http://www.gamedev.net/reference/articl ... le1348.asp and see if this can be developed into a dll for use with PB :?:
It would make an old ST fan (i'm sure there are more of us in here) to do remakes of our old demos.
I know I could easily convert my YM files into mp3 or mod and use the native or fmod playback routs but given the level of talent in here i'm sure someone would take up the challenge.

How about it :?:
:D
User avatar
Danilo
Addict
Addict
Posts: 3037
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Post by Danilo »

On the link you provided is only a sound server, but not the
toolkit/library to play your YM files.

Here some code to play a sound buffer with DirectX, but useless
if you dont have the YM-Toolkit:
Play sound buffer with DirectSound 8
cya,
...Danilo
...:-=< http://codedan.net/work >=-:...
-= FaceBook.com/DaniloKrahn =-
The Real KrazyK
User
User
Posts: 12
Joined: Thu Dec 18, 2003 1:17 pm
Location: UK

Post by The Real KrazyK »

Thanks Danilo,

Try this source in the link here:

http://www.lynn3686.freeserve.co.uk/dow ... 26src2.zip

It's a remake of an old ST intro using the public soundserver source with all the relevant file (I believe).
I appreciate your help with this and would be very interested to see if anyone could figure this out. Obviously the author may need some credit as well. I've already contacted him but have had no reply yet.

TRKK
KarLKoX
Enthusiast
Enthusiast
Posts: 677
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

Hi The Real KrazyK ! I don't understand exactly your request : you want to code your own YM emulator in pb or just only want a way to play YM files from a dummy app ? If it is the second choice, i wrote a plugin for Foobar2000 wich can replay YM file 1:1 (it use the Saint emulator sound engine), if you want to playback those files within PB, let me one day or two and i ll see what i can do.
I ve also coded another plugin playing sc68 files (almost all Atari musics uses this format) but it needs a lot of work to get something usuable (at the moment). If i have some spare time, i ll update it too.
See you soon :)
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
The Real KrazyK
User
User
Posts: 12
Joined: Thu Dec 18, 2003 1:17 pm
Location: UK

Post by The Real KrazyK »

Hi KarLKoX,

Thanks for the reply, it's the second choice that I am interested in, to replay YM files in PB. The Saint emulator sound is exactly what I was looking for :D . Do you think you could adapt your code for PB :?:

Regards

TRKK
KarLKoX
Enthusiast
Enthusiast
Posts: 677
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

I ve take my old source code and realize that, as it is a plugin, there is no sound mixing manager, it was the job of the player so it will take a little more time to get something.
but don't be frightened, i ve added it yesterday and could hear sound (using winmm, not directx) :lol:
Now, i'll turn it into a simple api (done) and make a simple player in PB (done). I need to fix a glitch in the beginning playing of the sound, add pause/resume/seek (perhaps FFT support if i ve time to let the user to code visual effects) and you ll have something usuable.
6UsOOn :wink:
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
The Real KrazyK
User
User
Posts: 12
Joined: Thu Dec 18, 2003 1:17 pm
Location: UK

Post by The Real KrazyK »

KarLKoX,
You're The Man, FFT support would be brilliant too 8) That would be the icing on the cake as far as this ST fan is concerned. I look forward to trying it out when you have the time to finish it.
Thanks for your time and effort with this - much appreciated. :D

TTRK
KarLKoX
Enthusiast
Enthusiast
Posts: 677
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

WIP :
-----
- Pause/Resume/Seek added,
- SetVolume Added,
- YM Music Informations added (title, artist, author, duration, songtype, replayer),
- Added a monoToStereo function,
- Added a simple Delay to enhance the Stereo wide,
- Added a filter to place the sound at the left/right rear,
- Added a very simple LowPass Filter for good drums&beat.

Todo :
-----
- FFT : don't know what to do, use the FFTW library or adding my own code ... mmmhhh FFTW provide some usefull things (but will grow the dll size :roll: )
- a simple spectrum analyzer,
- the 50 ms glitches in the beginning of the sound : even zeroing the buffer, this glitches occurs ...
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
The Real KrazyK
User
User
Posts: 12
Joined: Thu Dec 18, 2003 1:17 pm
Location: UK

Post by The Real KrazyK »

How large is the .dll at the moment :?: I use PEBundle to incorporate all .dlls etc into one packed file so i'm not too concerned about the size.
http://www.softpedia.com/public/cat/5/2/5-2-32.shtml
Hope you figure out the 50ms sound blip.

TRKK
The Real KrazyK
User
User
Posts: 12
Joined: Thu Dec 18, 2003 1:17 pm
Location: UK

Post by The Real KrazyK »

Hi KarLKoX,
I was just wondering if you had made any progress with the YM player since christmas. Does it play digi-drum tunes too :?:
Looking forward to trying it out. :)

TRKK
KarLKoX
Enthusiast
Enthusiast
Posts: 677
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

Hi ! And sorry for not answering earlier. :oops:
Here, you have all you want to play YM files as well as digidrums :)
Here are the limitations :

- YM_SetVolume doesn't work with YM_FFT() activated, if you want to set the volume, stop the song, set it and then, play the song,
- The FFT Spectrum is very bad : i don't know if it is what i do when i get the fft data or when i display them (i am very bad at gfx coding).

I provide the binaries and the sourcecode of both the YmPlugin dll and the PureBasic player.
Don't forget to mail me if you fixes these pb ;)
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
The Real KrazyK
User
User
Posts: 12
Joined: Thu Dec 18, 2003 1:17 pm
Location: UK

Post by The Real KrazyK »

BIG thanks for the reply. :D, This will help a lot with my demo programming, i'll try it out later.

Did you implement ymMusicLoadMemory as well as ymMusicLoad :?:
This would be very useful as we could then include the YM file(s) in our exe.
Great job. Thanks again

TRKK
KarLKoX
Enthusiast
Enthusiast
Posts: 677
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

- Added support for loading from a memory pointer : YM_Load api changed, pass the pointer of data as a second parameter and it's length in byte as the thirs parameter. If you don't want to load from the memory, just put 0 for the 2nd and 3rd parameter.
- Fixed a bug with the FFT (one song crashed for an obscure reason).
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
User avatar
Epyx
User
User
Posts: 44
Joined: Fri May 09, 2003 10:54 am
Location: Germany
Contact:

Post by Epyx »

Good Job KarLKoX, is there a chance that you add support for Future Composer files? fc is a old Amiga format and Leonards STSound95 plays both ym and fc

Greets Epyx
If you can't make it good, at least make it look good.
Bill Gates
The Real KrazyK
User
User
Posts: 12
Joined: Thu Dec 18, 2003 1:17 pm
Location: UK

Post by The Real KrazyK »

Hi KarLKoX,
How are you progressing with the YM player code, did you manage to add fc file support for Epyx :?:
I've managed to pack all my YM files (2000+) into one file, I just need the time to make an index for them now. Looking forward to trying the new version of your player :D

TRKK
Post Reply