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

Re: apple II 8bit sound programmers



On Tue, 31 Jan 2006, Michael J. Mahon wrote:
> Very cool, Simon.  It's remarkable how effective time multiplexing
> is in producing a multi-voiced effect!  I guess it's just like
> replacing chords with arpeggios.

So this got me thinking about ways to combine audio files "on the
fly"... two options I've come up with are:

1) Replace every second byte in file A with every second byte from file
B. This
   is quite fast, but effectively halves the sample rate of the
original files.

2) Add file A to file B on a byte-by-byte basis. This takes a lot
longer, but
   the sound quality is vastly improved.

In the second case I simply PEEKed the two corresponding bytes, added
them together, subtracted 128 and limited the new value to between 0
and 255.
This approach does cause a little clipping, but in the context of 5-bit
sound
that's quite acceptable.

Obviously in order for this to be at all useful, I'll have to come up
with an
assembly routine to do the job... the question is: do I have to resort
to
performing 16-bit addition and subtraction, or (as I suspect) is there
a better
way to handle the arithmetic with some clever bit-twiddling?
-s