On (02 Dec 94) [EMAIL PROTECTED] wrote...

 > On 01 Dec 94 22:15:17 +0000, Johnathan Taylor said:

 >> Well you should compress the 16 or 8 bits into 4bits not just chop of the
 >> lsb's

 > It depends on what the sample is.  I was referring to samples that have
 > already been compressed and stored as 2 4-bit samples per byte.  In that
 > case there's not much overhead when playing 4-bit samples compared to
 > playing 8-bit samples.

Hmm. sounds like a weird way to store a sample! Are you saying that the Sun 
sampler is only 4bits and its input is pre-compressed analoguely?

 > You are wrong.  A single OUT is all it takes.  As it's not a very well-kept
 > secret I might as well explain...

This is one time I like to be wrong;-)

 > The sound chip has two channels which look a bit like this (the other four
 > don't have an envelope generator):

 >   +----------+ [1]      +----------+     +--------+
 >   | tone     |__/___>___| envelope |__>__| volume |_____> (to output)
 >   | generator|    |     | generator|     | control|
 >   +----------+    /[2]  +----------+     +--------+
 >                   ^          |                |
 >   +----------+    |          ^                ^
 >   | noise    |____+_...      |                |
 >   | generator|              [3]              [4]
 >   +----------+

 >  [1] Tone enable switch (bit 2 or 5 of register 20)
 >  [2] Noise enable switch (bit 2 or 5 of register 21)
 >  [3] Envelope enable and type (register 24 or 25)
 >  [4] Volume level (register 2 or 5; bits 0-3 left channel, bits 4-7 right).

 > By a freak of nature, if you turn the tone and noise both off, you can get
 > the envelope generator to produce a constant high voltage level (did they
 > design this in or was it an accident?).  Therefore, by altering the volume
 > register you can output any voltage level you like.  It only takes one OUT
 > instruction to do this.

Oh that's how! Thanks:-) Assuming that this works on both generators would 
setting the amplitude regs simultainiously to different values produce an 
average DC potential not corrisponding to any of the normal 16 levels ie 
reg2=33h & reg5=44h output a value between 3 & 4? If so then it should be 
possible to simulate more resolution! Though of course the software overheads 
rise quite a bit using that method.

 > Weeelll...  :-)

I finally did it! Why do you...... <Grin>
Ingenious use of the line-interupt to time the sample-output event, that's one 
way out of the contended ram timing loops:-) An idea just came to mind that it 
may be possible to run such a player as a line-interupt service routine! That 
way you could have the sample play in the background! Assuming it can be done 
quick enough;-) Though knowing the paging overheads etc it'd probably run out 
of time between samples:( 

 > If it gets released somewhere (such as on FRED) it will become public
 > knowledge to a certain extent, so you can do more or less anything after
 > that (except sell a verbatim copy of the code and claim you wrote it, and
 > similar things that I'm sure you would never dream of...)

Heck I'd never do that! credit where credit is due is what I believe, you can 
also replace the 'credit' with blame as well if you like;-)

 > However, I dare say there's nothing terribly new in it...

There's not alot new when it comes to z80 proggin so that's now't to be down 
about:-)

 > [about WAV]
 >>> Does it have advantages over any other kind?  Is it compressed?  I

 > Why is it better than RAW if it isn't compressed?  Is it just an envelope

Yes, the header info tells the player useful things like the sample rate, 
sample width, mono or stereo, number of samples in the file and on what system 
it was created... A bit like the Archive header I've previously ranted about 
compared to a simple compressed file...

 > Correct (but it's also because I have the docs on that format, seeing as
 > I'm sitting in front of a Sun workstation).

As good a reason as any! Would you like the WAV format info just in case you 
get into that R2R DAC and start thinking about writing a universal sample 
player?;-)

Regards
Johnathan.

... My modem's made by Kellogs...it plugs into the cereal port...
--
|Fidonet:  Johnathan Taylor 2:2501/307.9
|Internet: [EMAIL PROTECTED]
|
| Standard disclaimer: The views of this user are strictly his own.

Reply via email to