Re: Band-limited AY emulation



A936@xxxxxxxxxxx wrote:
W Marsh wrote:

* The AY emulator itself generates two outputs for each sound channel -
a buffer containing the state of the "wave", either high or low, and
another buffer containing the volume levels. The sound is then rendered
into an output buffer using band-limited steps at change points in the
high/low buffer, and modulated with the volume level buffer. I think
this is essentially the approach used with this library:
http://www.slack.net/~ant/libs/#Blip_Buffer. A nasty problem with this
occurs when the channel volume registers are manipulated at a high
speed, as then THOSE frequencies become high enough to cause aliasing.
Perhaps this could be corrected by also using a band-limited step for
the volume envelopes, and making sure not to create a terrible aliasing
monster when everything is modulated together (less bandwidth for each
output 'signal', perhaps).


I agree with the direction you're headed in.  The right kind
of signal shaping should mimic what the hardware does.

I would suggest computing the total output as a result of all
wave/volume effects on all channels and add them up to get
the total volume the ay chip is actually outputting.  Have the
new value stored in NEWVAL, say, and the previous value in
PREVAL. Then output the bandlimited step response modulated
by the difference (NEWVAL-PREVAL).

This makes sense to me.

The bandlimited step response should mimic the Spectrum's
audio output circuitry.  The output circuitry is probably
effectively a cascade of two low pass filters (one for the
RC components and one for the speaker).  Compute
a unit step response for such a cascade filter and this
should be the bandlimited step response you can use.

That also makes sense. I wonder if the information about these components is available anywhere. I don't really know anything about electronics - would the filter essentially be a capacitor arrangement? I can imagine that there are existing DSP techniques used to model this sort of thing that I could find. I will have a look if this ever gets beyond the musing stage.


Have a "steady state output value" for the output of the
AY module, say AYOUT.  When a changed volume occurs,
the AY module indexes through the bandlimited step
response at the sample rate, adding the step response
to AYOUT to get the resulting output waveform.  At
the end of the step resonse, the transient bandlimited
step response will have settled at its final value.  Add that
final value to AYOUT and terminate the bandlimited step
response for the volume change that occurred some time
earlier.  Your sample rate and frequency of AY chip volume
changes will determine how many indices are travelling
through the recorded bandlimited step response at any
one time.

Ah, yep - this is a clearer way of saying what I was confusingly trying to explain earlier. I'm glad you've described it this way - much clearer, and good to hear it coming from somebody who knows what he's talking about!


I think you should still be oversampling and applying an
output low pass filter well away from the 11khz or so
bw that the Spectrum hw has.

Hm, I see. I worry that after all of the effort, this potentially more accurate emulation would end up sounding nearly the same.


Mainly a vote of confidence in your idea as this is pretty
much what you suggested :))

Thanks, you've convinced me that this would probably work. I wonder if it's actually worthwhile though. I think I need to get my hands on a second hand Speccy and compare existing AY emulators (perhaps they're quite adequate anyway), and generate some preliminary audio tests myself.
.




Relevant Pages

  • Re: Response Filter losing data when response is buffered
    ... I simplified the filter's Write sub to the following and still had ... When I detect in the buffer I know I've received the ... you used a certain Custom Response Filter to add ... > some certain html code into the response stream. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Band-limited AY emulation
    ... > * The AY emulator itself generates two outputs for each sound channel - ... > another buffer containing the volume levels. ... The bandlimited step response should mimic the Spectrum's ...
    (comp.sys.sinclair)
  • Re: Why Redraw of the whole page when paginating?
    ... I don't think there will have much difference between the FireFox or IE's ... behavie on handling buffered web page response. ... data and enable output buffer, both firefox and IE will provide blank ... So far I can't get some other options for the buffered web pages, however, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: GET webpage pix into image control via ITC (VB6)
    ... Hi, J French, and thanks for the response! ... How do I tell where the end of the file data really is at in the buffer, ... get the binary file in just one gulp, the resultant picture file could not ... > Do While Not bDone ...
    (microsoft.public.vb.general.discussion)
  • Re: Do Events
    ... The default setting in>= IIS 5.0 is the buffer all the response text, ... meaning that no response is sent to the client until all the server-side ... > generated which are displayed within the browser and saved to a database. ... > the entire script. ...
    (microsoft.public.inetserver.asp.general)