[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RT.SYNTH -- anybody tried it?



sicklittlemonkey wrote:
 Linards Ticmanis wrote:

Or just try a single PRINT PEEK(49200) before booting a game. Chances
are that it will sound markedly different.


I had wondered about this before, but not tested it. Your Ultima
anecdote is interesting. Have you verified that this always happens?
What audible difference does it make to say, a simple tone, or the
Apple beep?

For a symmetrical squarewave sound like a beep, there is essentially
no difference (since only the first and last transitions would be
different from the other initial speaker state).

For more complex, assymetrical sounds, the difference would depend
on the degree of assymetry of the waveform and the degree of "drive
assymetry" of the speaker output circuitry.  (See my response to
Eric's post.)

Michael J. Mahon wrote:

Actually, it's converting duty cycle (in the sample period) into
amplitude, which is the equivalent of averaging over all 23 1MHz
bi-level samples.


Can you define duty cycle in this context? I guess I'm imagining
'degenerate' cases where the same number of "on" cycles is counted in
each sample period, and so the resulting waveform is a flat line. (I.e.
silence.) 'Thought experiments' like that leave me puzzled as to how
directly translating frequency/duty cycle to amplitude results in a
valid waveform. But of course, I'm no Einstein. ;-)

It is not unusual for successive samples at 44kHz to be identical for
waveforms consisting of low frequency squarewaves.  Consider this
example:

Speaker waveform
1:   +--------------------------+                          +-----
     |                          |                          |
0:---+                          +--------------------------+

   :    8    :    10   :    9    :    0    :    0    :    4    :  (10)
Sample values (ten-cycle sample interval)

Note that the sample values are a good approximation to the speaker
waveform, even though in this example, I've made the speaker waveform
quite fast relative to the sampling, but the information of the
waveform is well-preserved.

In the special case where the speaker pulses are synchronous with
the sampling interval, as for DAC522, the situation is:

Speaker waveform
1:     +-----+             +------+            +-------+
       |     |             |      |            |       |
0------+     +-------------+      +------------+       +---------

   :    6    :     0   :    6    :    1    :    6    :    2    :
Sample values (ten-cycle sample interval)

Now, group the samples in pairs and sum them

   :    6   (6)    0   :    6    (7)  1    :    6    (8)  2    :

and you can see that the sample values accurately reflect the widths
of the speaker pulses (6, 7, and 8 cycles).  Since playing back the
original (ungrouped) samples has exactly the same averaging effect
as grouping and summing, the waveform represented by the pulse-width-
modulated ultrasonic pulse train is perfectly reproduced.

No, each reference complements the state of the speaker toggle, with
the initial state undefined.  So each reference causes the level to
switch from 0 to 255 or from 255 to 0, depending on its current level.

I realise the speaker driver has an on/off state which is toggled (cone
flexed/relaxed) but I didn't express myself very well. What I was
trying to say is that it is the number of transitions ($C03x accesses)
which should be counted, not the number of times the speaker is "on".
Perhaps this is what Linards meant anyway.

No, the transitions will take care of themselves if the state of the
speaker is sampled fast enough.  Of course, the state of the emulated
speaker is determined by acting on the transitions, but what the ear
can hear is the average effect of speaker state as caused by the
transitions.

-michael

Music synthesis for 8-bit Apple II's!
Home page:  http://members.aol.com/MJMahon/

"The wastebasket is our most important design
tool--and it is seriously underused."