Code Monkey home page Code Monkey logo

Comments (3)

DirtyHairy avatar DirtyHairy commented on September 22, 2024

Interesting, I didn't even bother trying as the audio synthesis mechanism in Stella and 6502.ts is totally different: while Stella generates a PCM signal, 6502.ts drives oscillators provided by the browser as part of the WebAudio API. However, of course, you are right: the hum is there in 6502.ts, too 😏

I have logged AUxx register writes, and that's what I get after leaving the intro screen:

AUDF 0 0
AUDC 1 0
AUDC 0 0
AUDC 0 5
AUDV 0 12

(the first number is the channel index). There are no more writes after that. This suggests that Thomas' analysis from the AA thread is off, and that channel 0 indeed gets stuck at AUDF=0, AUFC=5, AUDV=12. The actual waveforms fed into the oscillators are stored as compressed 1-bit samples in src/machine/stella/tia/ToneGenerator.ts and looking at those suggests an approx. 15kHz square wave. My hearing is far from absolute pitch, but that sounds about correct 😄

Even though they look different, I think that our audio implementations share a similar origin. Our version was adapted by @mschroeder from code originally written by Adam Wozniak (see the note here), and I am pretty sure that it encodes a pre-calculated version of the very same patterns calculated in TIASnd.cxx (I think I found evidence for this on the web some time ago).

I think the reason that this is only audible with Stella on Windows may be due to resampling and due to ideosyncrasies of the audio systems on the different platforms (after all, 15 kHz is not far from the threshold of the human ear). However, I have no idea what this means for emulation accuracy. Is the underlying model in our emulators wrong? Is the signal suppressed by the charactaristics of the VCSs audio circuitry? I guess we'll find out once we implement Chris Brenner's algorithm 😈

from 6502.ts.

DirtyHairy avatar DirtyHairy commented on September 22, 2024

I just tested Vong on my Jr. and, after turning our stereo to a dangerously high level (especially with a sleeping toddler next door), I can actually hear a high-pitched hum after leaving the intro screen. It's close to the edge of my hearing, so definitely higher than what we get from Stella and 6502.ts, but still....

I guess I'll repeat this test later this week, this time connecting the audio out of my modded Jr. directly to the stereo in order to avoid any signal processing by the TV.

from 6502.ts.

sa666666 avatar sa666666 commented on September 22, 2024

This gave me an idea to try it in MAME. When I turn its software volume all the way up, I too can hear the hum. So it looks like it's being generated in MAME correctly, but in Stella and Stellerator it's much too pronounced. Anyway, like you said, its a moot point until we get to the new sound core. I just wanted it documented as a good test case for the new core.

from 6502.ts.

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.