Dark Bit Factory & Gravity

GENERAL => Projects => Topic started by: stormbringer on October 05, 2007

Title: Paranoimia - Their Finest Hour cracktro
Post by: stormbringer on October 05, 2007
Win32 Remake of the Paranoimia cracktro on Amiga
Title: Re: Paranoimia - Their Finest Hour cracktro
Post by: Shockwave on October 05, 2007
Another perfect conversion.
I could have been watching my Amiga :)
Title: Re: Paranoimia - Their Finest Hour cracktro
Post by: Clyde on October 05, 2007
Wonderfull stuff :)
Title: Re: Paranoimia - Their Finest Hour cracktro
Post by: benny! on October 06, 2007
Awesome. Like the scrollertext !
Title: Re: Paranoimia - Their Finest Hour cracktro
Post by: taj on October 06, 2007
Stormbringer, can you point me to any reference to describe how to code an amiga synth for the pc?

Chris
Title: Re: Paranoimia - Their Finest Hour cracktro
Post by: stormbringer on October 06, 2007
Chris, there is no big secret!

Some Amiga sound formats have a replay routine that exists on PC as well. Among these formats: ProTracker and FutureComposer (libs available on DBFInteractive)

Atari ST tunes can be replayed using this excellent library: http://leonard.oxg.free.fr/

For SoundMonitor tunes (written by Brian Postma on Amiga) there is a C++ replay routine on his website here: http://www.brianpostma.com/
(although it's pretty buggy and not that well-coded). I have rewritten a C lib to replay that, I just need to take some minutes and make a nice package and release it here :)

For all the others... a bit more difficult, but not impossible. First of all in all my remakes I use a light Amiga emulator (only for the MC68000 and Paula chipset, the audio chipset on Amiga). So basically the idea is to use the emulator to run the Amiga replay routine with the original module. Slippy/Vectronix did the same for his OSME library (http://www.vectronixhq.de/?page_id=26). I do not use his library, because the original emulator he uses is very well coded and after some minutes you understand well how it works. You can find it here: http://sc68.atari.org

The original code was made create a plugin for players like WinAMP. So there is a lot of code in there that only serves this purpose: load files & replay routines and output PCM data for WinAmp & XMPlay.

So, this emulator comes with a bunch of replay binaries (the actual Amiga replay routines assembled on Amiga and expecting some parameters in the data and adress registers, usually a pointer on the module data and track number etc). The mechanism of SC68 also allows embedded replay routines, i.e. a module that has the replay routine attached to it or vice versa. That's the method I prefer, because you always know what you deal with.

Then the next step is to pack the Amiga module and it replay routine (rip the module & replay code if necessary). This is done on the Amiga (or using an emulator like WinUAE) and of course in MC68000 assembler (I use AsmOne for that). I create the binary as expected by the emulator with the correct jump/branch calls that the emulator expects for the replay routine (start, play, stop).

Then I use a small tool I wrote to wrap the binary in a structured file that SC68 expects to get hints about the module/replay routine, Amiga memory address where to map it, etc.

Since SC68 can take modules & replay routines directly from memory, I just transform the wrapped structured file into binary data that I can include in my source code. Some simple calls to the SC68 API and you are done!

Now SC68 "renders" samples in memory buffers. You need to pass these memory buffers to your audio mechanism (that you have to provide). It can be DirectX or WaveOut. Since I hate DirectX, I exclusively use WaveOut because it's available on all Win32 variations and you do not need to have the latest DirectX/DirectSound DLLs libs and other M$ crap. You just need to have a sound card in your PC with proper drivers installed.

The rest is fairly obvious I guess.

I hope this answers your question.... Of course you need to know C programming, MC68000 programming and understanding how Amiga works....

If you do not know these, I can help, especially if you want to use a specific tune in your prod (as long as the emulation works of course... this is not always the case :( )
Title: Re: Paranoimia - Their Finest Hour cracktro
Post by: taj on October 06, 2007
Thanks for the huge reply dude. I know you could have done another C64 intro in the same time! Karma++ for the interesting info. As you know Im into size coding so none of the libs are useful for me. I really wanted to understand how the sound is generated (float v int, sin v square etc). Do you have any reference on this?

Chris
Title: Re: Paranoimia - Their Finest Hour cracktro
Post by: stormbringer on October 07, 2007
I do not know how much you know about sound, but here is something you can start with: http://www.sonicspot.com/guide/synthesistypes.html

Also, I'm not a sound engineer, but an easy way to start some experiments is by doing the following:

1) setup a piece of code that plays out PCM data from a memory buffer

2) generate a sine wave in it and pay attention to this:

    a) amplitude
    b) frequency
    c) volume for the speakers (if you do not want to be deaf because of a bug with high frequencies...)

3) add some functions to modulate (change) the amplitude and frequency (you need to have something that continuouly plays the new data in the buffer)

4) experiment additive and subtractive synthesis. => simply combine using math operations different sine functions with different amplitude/frequency/modulation

there is a lot of subtractive synthesis theory on the net....

I hope this helps a bit

also I probably do not understand well your question... the Paula chipset on Amiga handled 4 channels of 8bit PCM data. Unlike the SID chip on C64, on Amiga, the players generate the synth sounds, not the Paula chipset. Pretty much like on a PC, you output PCM data, whatever it is..
Title: Re: Paranoimia - Their Finest Hour cracktro
Post by: va!n on October 12, 2007
again a nice conversion ! nice work!
Title: Re: Paranoimia - Their Finest Hour cracktro
Post by: Hotshot on October 17, 2007
I love this one and welldone

 :cheers: