Code Monkey home page Code Monkey logo

Comments (14)

cstereo avatar cstereo commented on May 23, 2024 1

from z88dk.

cstereo avatar cstereo commented on May 23, 2024 1

from z88dk.

suborb avatar suborb commented on May 23, 2024

@zx70 this change makes sense from a code perspective - but what are the effects on wav file generation for other targets?

from z88dk.

cstereo avatar cstereo commented on May 23, 2024

I have almost no knowledge of this project so it is just a guess. From what I have seen this problem shoud arise for all target computers requiring to generate a 44.1KHz wav file (flag mc_options audio=1 and 22 =0) using raw2wav. Digging a little more, I see that is corresponds to around 20 targets.

from z88dk.

zx70 avatar zx70 commented on May 23, 2024

I'm aware this WAV encoding mode is sometimes misunderstood by the SW programs
Nevertheless it is a perfectly valid one.
I chose it because it permits a very high compression rate and it is usually working in most of the configurations, this is (was) especially useful to create 44100 audio sources and burn a CD.

In my past experiments I haven't met stability issues, but I noticed that some audio editor didn't like this audio format.
It is perfectly fine to fix it if we're inserting a glitch ourselves, though. Most of the targets include a "volume" option to address possible issues in the audio transfer of conversion, does the DAI target have it?

By the way I'm more than happy to help investigating on it, probably the first thing to check is whether Audacity (being a key reference for the digital audio stuff) would like this workaround.

EDIT: we should also check what happens on Audacity customizing the "audio import" options

from z88dk.

zx70 avatar zx70 commented on May 23, 2024

Thank you for clarifying. For reasons not related to this project I missed the core problem of the values in the negative side of the waveform overflowing!

It definitely must be fixed, I'm surprised it was never spotted

from z88dk.

zx70 avatar zx70 commented on May 23, 2024

I think the problem is solved, that little bit of noise was added to solve an issue on 2 emulators for the zx spectrum, a "too clean" waveform was confusing them, but I don't remember the exact behaviour.

To me is was reasonable to forecast a similar problem hitting other emulators and I chose to make the change global. It impacted probably the DAI only, because it was creating a wave audio at its maximum possible volume.

I'm changing both appmake.c (disabling the noise insertion when an overflow must be prevented) and dai.c with a new "loud" appmake option.
We have space for improvements, if you would be available to test it, we could pull in a "fast" and a "dumb" mode

from z88dk.

cstereo avatar cstereo commented on May 23, 2024

from z88dk.

zx70 avatar zx70 commented on May 23, 2024

There's an added option (-Cz--loud) to set the volume to 99%. The default audio level output is now at about 70%, it is hopefully good for most of the hardware configurations to send the audio output to a tape recorder or an amplifier.
I'm going to insert this same option in the ONDRA target as well.

The "dumb" option is simply a shortcut to pass a binary file to appmake (usually including a loader block and a code block together with extra information for the emulator) and create a wave without expecting a z88dk built program.
We can probably forget about it, I see the ".dai" files are rather simple.

By "fast" I refer to shortening a little the audio periods and push the original loader to its limits, sometimes the loading time can be reduced of an interesting amount without hardware or software changes. It can give good results with some software driven loader. Sometimes the "long pulse" can't be altered but the short one allows quite a bit of tweaking, in example.

from z88dk.

cstereo avatar cstereo commented on May 23, 2024

from z88dk.

zx70 avatar zx70 commented on May 23, 2024

I hope the nightly build will help us. If everything goes well we should have a fresh build tomorrow morning (nightly.z88dk.org), it will deliver a portable build for Windows too.

I've already introduced a '--fast' option in the DAI target. You're right, I know very little of it, but I istinctively avoided changes on the leading and trailing pulses. I've been cautious, so the little speed-up would save, if it works, only 10 seconds every 1.5 minutes of a standard loader.
Building appmake is not difficult at all, you could experiment with it directly, I think.

I'm quite ashamed for the nast bug, luckily in most of the affected targets it was showing up only with the --loud option. Other ones weren't affected at all.

from z88dk.

cstereo avatar cstereo commented on May 23, 2024

from z88dk.

zx70 avatar zx70 commented on May 23, 2024

The compression. A normal non lossy dictionary based or even RLE compression will give better results than mp3 . Gzip or pkzip should reduce a 5mb wave file to 100k.

from z88dk.

cstereo avatar cstereo commented on May 23, 2024

from z88dk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.