How to port some DAC samples of sonic 3 to sonic 1?

Discussion in 'Discussion and Q&A Archive' started by FireRat, Mar 27, 2010.

Thread Status:
Not open for further replies.
  1. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    I need port some DAC samples to sonic 1. I tried to port the 3 files of dac of sonic 3 driver for esrael, and fail; and i dont know of samples offsets. How to can port?
     
  2. Mikel

    Mikel Science is true power! Member

    Joined:
    Oct 5, 2007
    Messages:
    19
    Location:
    Oklahoma
    Ok, here's what you need to do:


    If you are editing the Sonic 1 Sound Driver through Puto's disassembly, you need to use something like this for porting Sonic 3 DAC samples:



    dw DAC_Sample1 ; Kick sample
    dw (DAC_Sample1_End-DAC_Sample1)


    dw 0004h ; Pitch = 17h


    dw 0000h


    dw DAC_Sample2 ; Snare sample


    dw (DAC_Sample2_End-DAC_Sample2)


    dw 0004h ; Pitch = 1h


    dw 0000h


    dw DAC_Sample3 ; Timpani sample


    dw (Dac_Sample3_End-DAC_Sample3)


    Sample3_Pitch:


    dw 000Bh ; Pitch = 1Bh


    dw 0000h


    DAC_Sample1: binclude "Samples/DAC1.bin"


    DAC_Sample1_End:


    DAC_Sample2: binclude "Samples/DAC2.bin"


    DAC_Sample2_End:


    DAC_Sample3: binclude "Samples/DAC3.bin"


    DAC_Sample3_End:



    If you are still getting errors, let me know.
     
  3. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    Ok i have this disassembly but the sonic 3 driver, uses more samples in a single file. How to extract the samples?
     
  4. Irixion

    Irixion Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    670
    Location:
    Ontario, Canada
  5. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    Last edited by a moderator: Mar 28, 2010
  6. c1owd

    c1owd Previously 'CarrascoZX0' Member

    Joined:
    Dec 13, 2008
    Messages:
    364
    I use this. ;)


    Good luck...
     
  7. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    ..While I use this. =P


    EDIT: With the additional routines I wrote to use more than 20 samples =P
     
    Last edited by a moderator: Mar 28, 2010
  8. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    Ok. To write MY samples i need to record in WAV?
     
  9. c1owd

    c1owd Previously 'CarrascoZX0' Member

    Joined:
    Dec 13, 2008
    Messages:
    364
    That's nice. :p

    You can do "WAV", or "raw."


    I believe the format has to be 8-bit unsigned, mono, 11025Hz.


    But you should try using these samples that Andlabs ripped from ROMs. :)
     
  10. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    "From SonicRetro" Important to this topic I guess.


    The samples as CarrascoZX0 said, must be a raw/wav pcm sample, 8-bit, mono, and either:


    22,050Hz ($05 Pitch)


    16,000Hz ($09 Pitch)


    11,025Hz ($13 Pitch)


    I think you could have the rates even smaller if you wanted to, but the quality loss wouldn't be worth it, most DAC drivers are operated using the Z-80 and are often read in banks, meaning that the samples cannot be too big (I'm asuming the size is "7FFF" bytes in total, though I haven't really checked if this can be twice the amount "FFFF"). However compressing the samples is also an important aspect which will change the size of the sample (Obviously), depending on what driver you use, for example, the driver CarrascoZX0 is using, requires that the samples must be compressed, using this compressor. If you're using the driver I am, then the samples are uncompressed so you do not need to worry about that.


    There are pros and cons between using the compressed driver & the decompressed driver


    Compressed Driver:


    PROS: The size of tha samples are much shorter, so you could fit more samples on the rom without reaching your limit.


    CONS: You have to compress a sample each time if you wanna use it, and there's a slight quality loss.


    Decompressed Driver:


    PROS: The quality of the sample is at it's fullest, and you do not need to worry about compressing it.


    CONS: The size of the samples can be very big, and if you're careless enough to have too many useless samples, you'll end up taking up your rom space.
     
  11. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    Ok. Actually are 3 samples of sonic 3 recorded in wav with pitch $13, mono and 8-bit unsigned and conpressed with jman'compressor decompressor. This is ok?
     
  12. EMK-20218

    EMK-20218 The Fuss Maker Exiled

    Joined:
    Aug 8, 2008
    Messages:
    1,067
    Location:
    Jardim Capelinha, São Paulo
    He can do only RAW. IF he uses the wave format, he will hear a unfortunate noise at the begin of the sample sound, because the wav files has a header inside, while the RAW are header-less.


    Just for record, the S1HL driver is a FAKE-Z80 sound driver wich is written for prevent wasting of the 68k memory. Lots of unuseful 68k stuff there has been disabled, so the sample sound quality is considerable better than the Sonic 1's default. But not perfect as the uncompressed ones. For easy samples management I FULLY recommend the Sonic 2 Clone Driver because the S1HL driver works with aligned banks of samples, so your romfile will grew A LOT after using it AND you CANNOT add include or incbin after the samples, or your romfile will be larger than a 3,50MB file size.


    In the Clone Driver you will get easy samples management, so I recommend it on your case. To obtain the S3 samples, you must get the s3 samples in wav format that is on the forums (I don't remember if they had been posted here on SSRG). But they are in the wav format, so you will need to remove the wav header from every sample file for get it being perfectly played on your hack.
     
    Last edited by a moderator: Apr 6, 2010
  13. amphobius

    amphobius spreader of the pink text Member

    Joined:
    Feb 24, 2008
    Messages:
    970
    Location:
    United Kingdom
    *swoosh*
     
  14. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    This is my final ask why i not speak good the english sorry. The sonic 2 clone driver is the driver of sonic 2? or is S1HL?
     
  15. Spanner

    Spanner The Tool Member

    Joined:
    Aug 9, 2007
    Messages:
    2,570
    The Clone Driver is Sonic 1's sound driver with Sonic 2 music and sound effects.
     
  16. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    Ok. Where is the download? (sorry for this stupid question)
     
  17. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
  18. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    Thanks
     
  19. EMK-20218

    EMK-20218 The Fuss Maker Exiled

    Joined:
    Aug 8, 2008
    Messages:
    1,067
    Location:
    Jardim Capelinha, São Paulo
    Hm, sorry for ask. But, this question has now been solved!?!?

    I think that it seems to be a Yes.
     
  20. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    Yes, Solved xD
     
Thread Status:
Not open for further replies.