Re: About digitized speech
- From: zxbruno <zxspectrum128@xxxxxxxxx>
- Date: 24 May 2007 15:54:29 -0700
Take a look at this for starters:
ftp://ftp.nvg.ntnu.no/pub/sinclair/utils/spectrum/WAVPlayer.zip
Chris
I know about the WAV player, but it's very limited.
You have a problem there for a start.
Using the AY chip to play a speccy sampled sound is not going to improve its
quality. The speccy has an audio in port, yes. But it's for tape loading and
thus, is only a 1 bit port.
I understand. But I'm not trying to digitize the sound using the
speccy's audio-in port. I would like to be able to convert, let's say,
MP3 of WAV files to binary files that can be played on the speccy.
I know there are 4-bit sampled instrument trackers, but no samplers. I
know it has to be done on the PC first. Some people use Sox to
downgrade the quality, but it's too complicated for me.
I was able to figure out how to use the 'Sample Tracker'. You could
load the demos and play the digitized sound via the beeper or AY chip
(your choice). This is almost what I need, and the quality is nice!
http://tcg.speccy.cz/index.php?pg=tools-en
Quote from the person who sent the link to me:
"Run it in USR0 mode. There are a few songs at the end of the tap.
After loading, just open up your tape browser and point at "MATASONG
3", then choose "LOAD SONG" with QAOP and SPACE and then load up the
instrument samples by selecting "LOAD SAMPLES" (note: LOAD SAMPLES is
not the same as LOAD SAMPLE; obviously a bit of a user-interface error
there ). Then select PLAY to hear the AY chip rendition, which is
clearly a 4-bit jobbee. There is also a PWM player for the beeper --
just click on OUT to change to SPEAKER and hit PLAY again. I do not
believe this is how it actually sounds on a real Spectrum -- I expect
the high frequency noise is filtered out by the speaker and the driver
circuitry which acts like a low pass filter, which I don't think is
emulated by anyone now.
As for what the msx folks have been up to, here are actual recordings
from a Philips machine and AY chip playing 8-bit sampled audio encoded
by the viterbi encoder:
http://www.bluemsx.com/vg8020psg.mp3
http://www.bluemsx.com/psgenc/royksopp.mp3
And original thread to read up on the details:
http://www.msx.org/forumtopic5686.html
I've toyed a bit with writing a MOD player, after gasman provided a
stolen volume table from the ATARI ST that supplied 7-bit audio on the
AY chip, but only toyed. You can probably find the thread in here with
MOD in the title. One thing is clear: the speccy's z80 is not fast
enough to implement all the MOD features 100% with 7-bit audio, but it
might be possible to do something interesting.
Quote:
Do you know of any game or demo or someone who tried it on the speccy?
7- or 8-bit audio, no. But there are 4-bit audio sampled tunes in
several demos. The 8-bit example from the msx folks is as close as we
have for real hardware. I suppose someone could go through the
formality of actually assembling stuff to run on a real 128 so we can
say it was running on it
Quote:
The popular sound editors won't let me resample audio to those low
levels. And gasman told me about Sox, but he too had to write a custom
script to downgrade the raw sample until he reached the desired level.
Hmm, okay I thought the windows sound editors included quantizing
controls. A long, long time ago I also used SOX and converted audio
formats to raw, then hacked together a small program to requantize it,
then used SOX again to convert to whatever the destination format was.
I wrote a simple 4-bit player with audio stored on disk so there was
only a 1 second or so pause while the next part of the sample loaded.
I played these on my 2068 and the audio quality was quite good -- I
managed to fill up a few disks with various TV theme songs that I
missed since a website full of them had just appeared at that time.
But storing raw samples is very, very memory intensive and is not
practical unless you have a shitload of memory available from
something like a SD or compactflash card attached to your speccy.
Better are trackers like the 4-bit one above or possibly a MOD-like
player that plays sampled instruments at varying pitch. This way the
number of samples (number of instruments) are finite and their lengths
short.
Quote:
At the time when Robocop and Chase HQ came out, they didn't had all
the tools we have today, and they were able to make the Speccy 'talk'
with better quality. They had to prepare the sample somewhere and then
transfer it to the spectrum. I wonder how they did it.
ADCs were around and could be bought for the spectrum. But more than
likely the samples came from a PC with appropriate sampling hardware
that came with a sound card.
Quote:
I'm also looking for a simple hybrid program (basic+m.c.) that would
allow me to play the sampled data on ram. The BASIC program should ask
for the address and lenght values, use POKE to set the m.c. player
settings, and calling the player by using RANDOMIZE USR. Any ideas?
The samples will usually be played at 8kHz (8000 samples per second).
If they're 4bit and you pack two four-bit samples in a byte, this
means all of 5 seconds of audio in 40K. It's not too practical
unfortunately.
Much better would be to work with a compactflash system or work on
some kind of tracker/mod player. I would do it myself but as I have
limited time, I have to be careful what speccy-related projects I take
on or else nothing gets done, and as I've just signed up for one of
aowen's projects that takes me out for a while."
"http://www.geocities.com/aralbrec/tidbits/bsynth.zip
The zip file contains a simple program sampleconv.exe I wrote a few
years ago that converts a raw audio sample into another raw audio
sample at any lower bit resolution. It uses the minimum and maximum
sample value to determine the range before applying the quantization.
If the sample has some loud spikes this won't be very good (the
majority of the sample will be quiet and will not take advantage of
the full dynamic range) -- a better version would probably look for
these spikes, reduce the range and clip them.
Anyway it also contains some PWM beeper dac code, with the tap
included playing a short 4.7-bit equivalent guitar riff on the beeper.
The carrier frequency is at 16kHz, that's why it sounds much better
than the Sample Tracker beeper output. Some emulators don't emulate
the beeper well enough to get a clear sample, but Spectaculator (and
probably other recent emulators) will."
Some other info from Gasman that got me thinking:
"Chase HQ used the AY chip, which gives you 4-bit audio quality (sort
of). Combining video and good quality audio on a Spectrum (emulated or
otherwise) is an unsolved problem though... with an IDE interface
you're limited by the speed of the Spectrum's data bus - my routine on
the DivIDE was only playing at 5.5KHz IIRC."
Still sounds pretty incredible to me!!
/On-topic:
Besides the demos that come with the Sample tracker, there are also
russian games which include digitized music, and it seems to play for
more than 5 seconds. I have no idea how they do this. One of those
games is recent, 'Kolo-something' (forgot the name).
I have experience with Sound Forge and Goldwave. It would be great if
we could open any audio file in our favorite audio editor and convert
it to be ready to play on the Speccy in a few easy steps.
.
- Follow-Ups:
- Re: About digitized speech
- From: zxbruno
- Re: About digitized speech
- References:
- About digitized speech
- From: zxbruno
- Re: About digitized speech
- From: spike1
- About digitized speech
- Prev by Date: Re: The writing on the wall
- Next by Date: Re: The writing on the wall
- Previous by thread: Re: About digitized speech
- Next by thread: Re: About digitized speech
- Index(es):