Login
Search for:


Previous | Next

From: TLC (all posts)
Date: 2000-09-09
Subject: Re: Sound stuff
Hi Csabo!

> So here's my feedback on all of this:
>
> 1) Can you please post the WAV file somewhere?

I can't, since it is 22 megs long; unfortunately my current 'workplace'
has no unlimited net connection, I can only use a 56k modem :-(.

I could make a shorter wav file and post that, but probably it won't do it for you.

> 2) Can you post your new DIGI table? ;-)

I generated few tables with different division and calculated the sum of squared error of each. This table had the least sum of squared errors
(all were '5 bit' tables).

12,13,14,15,16,17,18,95
95,B3,96,97,97,B4,98,36
36,B5,B5,37,37,38,B6,B6
B6,B7,B7,B7,B7,B8,B8,B8

(All values in hex; for a '4-bit' table, just skip each second values)

> I was surprised to hear that for example $77 on $FF11 would output LOUDER
> sound than $B5 but softer than $B6. When I used to play around with this
> stuff on my real Plussy, I remember using values $90-98, and $B0-$B8 (that's
> what I saw in other people's routines...) Did I understand the above
> correctly?

I think yes. (But all this only applies, if the frq generators were set properly before, eg. as my routine did, osc1 is $03fd (can well be between $03fb and $03fd) and osc2 = $03fe).

...There should still be something strange with this sound device: when trying to derive the DC offset of for example, $77, summing the DC values of $17 and $97 (what this setting means, = 3176 + 6464 = 9460)
don't give out the value of $77 (= 9912) :-O. Also, checking a much simpler example (level($98)*2 <> level($b8)) proves that there must be some non-linearity like hell (or I'm just stupid and don't see what before my eyes is).

Too bad, it also proves that my suggestion for emulating the TED sound generator should not be accurate :-(. The principle of superposition is broken. Hmmm... But even if it is, still, it could be possible to enhance sound emulation using these values (since the response is known for 'most' possible soundgenerator states).

> TLC, did you hear my demo (DrumMix3)?

I tried to download it, but something must have gone wrong; as I load it on the Plus/4, the basic hangs as soon as it finishes loading.
Nevertheless, I also tried to load from monitor but no success (the program hanged when I started it from $1015). Could you please send it to me in an e-mail, or / and upload it to the webpage in a zipfile, to ensure that the webserver treats it as binary?

> [...] This is
> what I'm thinking: for playing samples on the Plus4 we could use 16 levels
> of volume. Traditionally(???) we use 7 or 8, right? At least I did. The
> reason of course is space. If we use a 'big' table, each 'unit' would take a
> byte. But if we stick to 4bits/'unit' then at least we could use all the
> values that the 4 bits can provide... Is this clear?

I think yes.

Most people on Plus/4 used 3-bit digi resolution so far, AFAIK (as you said, 'traditionally'). There are two reasons. The first, the TED 'has'
just three bits for volume levels (o.k. better said: 9 levels), so one thinks it can play 3 bit digis only. And the second (probably more serious) is, 3 bit digitizers were easier to build those days than 4 bit digitizers (people from NST used standard chips, no integrated A/D converters thus their 4-bit digitizer design was neither efficient nor accurate).

Most people on C64 used 4 bit digis.

The advantage of using better resolution is when your digi data is not fully explicite - I mean, if your digi routine mixes more waves together in realtime. The best examples are the music converter routines - they must mix 3 channels (if digi is involved: 4 channels) together in realtime. So, one doesn't have to be stuck with 4 bits for simpler memory allocation, and can take advantage of the better resolution.

Or, but it's just a quick idea, it would be possible to pre-encode the wave stream for a 'logarithmic' scale, so each sample would still fit in
4 bits, but the scale of the values would be custom (finer first steps,
rougher last steps, as the TED output is). This would fit to the TED's characteristic better so would presumably sound better than normal linear scaled samples played on the TED.

> Also, I really didn't get the bit about the frq stuff. Why does it matter
> what freqency you set the two oscillators? Why/how does it affect digi
> output? I for one would appreciate if you could elaborate on this a bit.
> Thanks.

When you use the 'standard' TED digi mode for generating constant levels, e.g. setting bit7 of $ff11 high + turn on a soundgenerator + set a volume then nothing.

The oscillator setting becomes important, if you break this limit. If you check it again, the table contained references like '$1x' and the like (below $80, so the 'constant level output' bit of $ff11 is not set). In other words, the oscillators 'think' they have to work in normal mode (generating a regular TED sound, as probably your LOD player is also designed). This case, it really matters what you set previously to the osc registers.

If you set a hearable frequency (below $03fb), you'll hear a 'mixed'
(amplitude modulated) normal TED voice together with something from the digi sound you currently play (the case you asked BTW, playing normal +
digi together).

The case is the same when you set something between $03fb and $03fd -
these settings are correct, you just don't hear the TED sound since it is so high. Still, playing a digi sound using the volume register works.
The volume levels (the DC offsets) this 'mode' produces can be derived from the TED sound itselves: since it is a symmetric duty cycle (50%
high, 50% low) squarewave, its DC offset should be half the offset of the constant high level (the high level, for example one oscillator in
$ff11 bit7=1 mode generates). Thus, this trick can be used to enhance digi resolution - since the steps obtained in this 'mode' are about 50%
finer.

Finally, the $03fe setting locks up the oscillator in 'high' state.
Thus, you get the same continuous constant level in 'normal' mode, if you play with the volume bits as the regular 'digi mode' gives.
Normally, it won't have much sense to use this possibility, since you get the same DC levels in the standard digi mode anyway, but this is the TED. The TED oscillators can't be set to digi mode separately, you either set both or none (bit7). That means, you can't add for example,
osc1's fine small DC value (assume it is set to a high frq as above) to the rougher value of osc2, if it's set to digi mode (to achieve finer resolution in the higher DC level area). So, the solution is the following: one sets osc1 to a high frequency ($03fd), providing an '50%'
range resolution with osc1, and sets osc2 to $03fe, providing the '100%'
DC offset range also for 'normal' oscillator mode.

This possibility doesn't help much avoiding the TED noise, since in the full range, the resolution is the same (just see the last quarter of my table...). But it certainly improves the dynamic range - because of this
'logarithmic-like' distribution, it is also possible to play quiet, soft sounds with about the same relative noise level. Not a bad thing, if you think it over, how wide dynamic range a SID music can have, for example,
if the subject is a music converter routine...

> You suggested two possible uses for this piece of info: 1) improve
> emulators, 2) improve TED sound output. 3) is: improve a routine that
> converts PC WAV files to Plus4 playable format... That's what I'm working
> on. I should put up the source so you'd finish it for me ;-)

Me?! :-). Well, just tell me what I can help you.

> Thanks for the EXCELLENT article,

?! Would say, it does it for the moment, until somebody makes better measurements and finally the TED sound generators inside will be fully recognized - hope Richard will come up with a more adequate approach.

> and keep up the good work, buddy!!! I'm
> hoping to see an entry from you on the C=16 democompo...

Unfortunately, it's very unlikely that I'll enter it. I have lots of things to do :-(.

Best regards,

L.

Ps. Just a suggestion for your another question (playing TED voice +
digi together). If you want the digi to be not more the function of the TED sounds that it's neccessary, keep both soundgenerators on all time and turn off a voice, if it's neccessary, by writing $03fd to the appropriate frequency register. Unlike the good old 6581 SID, where you find plenty of DC on the output even if no oscillator is active (so you can play a digi using the volume register, even if you don't touch the soundgenerators), the TED won't play the digi if the sound generator is off. So, if you want to avoid these 'holes' in the digi if one or both soundgenerators are off by the moment, keep both on and generate silence by playing 'ultra-sounds' (GUS rulez, hehe ;-) ) if it's neccessary.

Copyright © Plus/4 World Team, 2001-2024. Support Plus/4 World on Patreon