Dual PCM

Discussion in 'Utilities' started by MarkeyJester, Nov 27, 2016.

  1. MarkeyJester

    MarkeyJester ! % # @ Member

    Joined:
    Jun 27, 2009
    Messages:
    2,675
    Don't worry, I'll allow discussions of converters in this thread since it's related. Likewise, it's probably vital to the success of Dual PCM, since if people have tools to help them do the work, then they can use the product in question. So if anything, it's in my best interest to have that discussion going on here. So please do continue, while I don't use the tool, its very discussion of improvements is based around the software I'm writing.

    The code is so complex and precise, that you'd be better off having two Z80 drivers, and swapping the whole thing out. But this may cause havoc with the YM2612 data if not accounted for correctly, and the location as to where the 68k will write some of the data will change (some of it is inside the instructions themselves and cannot be aligned to match between drivers).

    If it doesn't cause a headache for me, then it'll certainly cause a headache for the 68k programmer.

    In fairness, one benefit to a lower sample rate is that it keeps the ROM size down, which is the point in pitch/volume control in the first place, to allow the same samples to be used at different pitches/volumes without having to include separate samples. But, I am trying to increase the sample rate from what it is now, frankly though, even 17,000Hz is a miracle in its own right, just give me time first to find all possible ways of reducing the CPU time.

    Out of my own curiosity, what sample rate would be "acceptable" for you guys? I've always found 16,000Hz to be good enough (voice samples sound OK with it, even those that put heavy emphasis on the "S" noises), I'm still trying to get it as high as possible though, but I'm still curious into all of your views on it.

    In fact, I am due to run a few hardware tests, if you'd like, you could give me a few samples to test with, and I can give you a recording of what they'll sound like on hardware for your interest.
     
  2. Natsumi

    Natsumi Phoenix egg Member

    Joined:
    Oct 7, 2011
    Messages:
    666
    Location:
    Long and dangerous river
    Since I am not planning on using voice samples really, even something as low as 12000Hz is good enough for most if not all purposes. Some fancier sounds could still disbenefit from that, but I don't feel it to be that much of a worry. Even Ristar with its piss poor 8344Hz playback which is crackly and interrupted all the time sounds 'fine', so I think its really more about finding the best ways to present audio than just pure sample rate alone.
     
  3. Novedicus

    Novedicus Well-Known Member Member

    Joined:
    Aug 26, 2013
    Messages:
    858
    Since a project I'm programming for has quite a few voice samples, then I would say that 16,000Hz is "acceptable" if you say it is. (Though, I should probably ask BinBowie if he agrees, because it's his music EDIT: He does)

    For drum samples (except for the cymbal crash), I don't care too much if it's 16,000Hz or higher, since it isn't as noticeable to hear the quality loss than it is for voice samples, IMO.
     
    Last edited: Apr 3, 2017
  4. LuigiXHero

    LuigiXHero Well-Known Member Member

    Joined:
    Mar 22, 2014
    Messages:
    276
    Considering Super Mario 64 uses 16,000Hz for most of mario's voice samples that should be perfectly fine.
    Example
     
  5. MarkeyJester

    MarkeyJester ! % # @ Member

    Joined:
    Jun 27, 2009
    Messages:
    2,675
    Do not be fooled. The Nintendo 64 has a 16-bit audio playback, as is that sample being 16-bit. The Mega Drive's DAC port holds 8-bits, with Dual PCM supporting only 7-bit playback to avoid overflow.

    The 16-bit sample can hold an extra 8-bits of precision to the wave position, the 8-bit (or in our case, 7-bit) audio of the Mega Drive has to quantise the lower 8-bit precisions in some way to the next whole upper 8-bit/7-bit number, sounds that are clear in 16-bit, can produce noise at 8/7-bit because of this quantisation. This is the nature of quantisation, and it cannot be avoided, though there are certain techniques to "hide" it, such as dithering.

    But the point is, that sample might not sound as good when in 8-bit, I'd also be careful with using certain software for playback, like Audacity for example, any sample loaded into it is converted to 32-bit floating point for playback, and this creates the misguided conception that an 16-bit/8-bit sounds as good as it does, when it actual fact, the software may be tampering with the audio data in realtime during playback and interpolated it in some way to make it sound good (not too 100% sure about this, a few updates may have fixed this). These features are quite nice, but they make it harder and harder for oldskool audio devs to make audio fairly, for old machines of primitive technology.

    Another thing to consider, is the type of sound being played back, that sample has mario making no sharp sounds, like "S" based sounds. It's a soft "hello" with no distortion. In effect, it's an unfair test...
     
    StephenUK, EMK-20218 and ProjectFM like this.
  6. ESauce64

    ESauce64 Newcomer Trialist

    Joined:
    Feb 25, 2019
    Messages:
    2
    (Sorry if this is an easy fix or anything I'm new to all of this) I followed the guide but when I run Assemble.bat I get this error:

    C:\***\***\***\***\***\S1 HACKING STUDIO V3.0\SOURCECODE\EQUZ80.ASM(13) : Error : Label 'start' multiply defined
    start = $0
    Errors during pass 1 - pass 2 abortedCheckFix: Error, could not open s1built.bin
    Press any key to continue . . .

    I tried looking for where "start = $0" is repeated but couldn't, deleting it from Equz80.asm doesn't help because it gets replaced with a new version that contains the problem when it is being reassembled, can anyone please help me sort this out?
     
  7. MarkeyJester

    MarkeyJester ! % # @ Member

    Joined:
    Jun 27, 2009
    Messages:
    2,675
    I suspect the main source code also has a label named "Start" somewhere.

    I would assume it'll be right at the beginning, the Hivebrain 2005 disassembly (of which this driver was built on) does not have "Start" anywhere as a label, so I would assume you have added this driver to a different/newer disassembly of Sonic 1 which has "Start" as a label somewhere in the main code.

    As an alternative solution, if you cannot find this "Start" label anywhere, then open up "Dual PCM\Z80.asm", there will be a "Start:" in there somewhere, either rename it to perhaps "StartDualPCM:" or you could just outright remove it since it's technically referenced, it's up to you.
     
    AkumaYin likes this.
  8. ESauce64

    ESauce64 Newcomer Trialist

    Joined:
    Feb 25, 2019
    Messages:
    2
    Yep, it's all good now. Thanks for the help.