Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Voice emulation on the SMS

Reply to topic
Author Message
  • Joined: 10 Dec 2000
  • Posts: 590
  • Location: Australia and Japan
Reply with quote
Voice emulation on the SMS
Post Posted: Tue Feb 13, 2007 11:19 am
What would be the best or worse voice in a game?

Do you think with todays technology that Sega could do a better job doing a voice on the SMS?

I think Moonwalker was pretty bad.
  View user's profile Send private message Visit poster's website
  • Joined: 12 Feb 2006
  • Posts: 194
  • Location: Wales
Reply with quote
Post Posted: Tue Feb 13, 2007 11:49 am
I was quite impressed with the speech "dracula" on the title screen of.... Dracula
  View user's profile Send private message Visit poster's website
  • Joined: 17 Dec 2005
  • Posts: 510
  • Location: England
Reply with quote
Post Posted: Tue Feb 13, 2007 12:20 pm
find the miracle ball!
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13165
  • Location: London
Reply with quote
Post Posted: Tue Feb 13, 2007 12:55 pm
You could do better.

There are basically three factors in play:

1. Bit depth

For the most common form of PCM playback on the SMS, there are only 4 bits -> 16 levels. Compare to 8 bits (256 levels, acceptable quality for voices), 16 bits (65,000 levels, CD quality), 24 bits (16 million levels, for audiophiles).

2. Sampling rate

Most games' samples are at about 8kHz. Mega Drive samples are at about 16kHz, which is about phone quality. CDs are at 44kHz, and audiophiles are at about 96kHz. The reason for this is purely the volume of data involved - 8kHz 4-bit audio takes 4KB per second, so you can only get 4 seconds in a 16KB slot on the cartridge - and once you get over 16KB, you get more technical issues. Low sampling rates make the sounds more "blurry", especially voice fricatives like F and S.

3. Non-linear scale

The control you have over the output levels is not linear. Either the game can be clever and work with it, or ignore it, which doesn't destroy the audio but makes it not quite so good. Guess which seems to be the case for SMS games...


There are a few solutions (not corresponding to the above numbering):

1. Take advantage of the non-linear scale. Simple enough, but requires making a custom converter.

2. Use PWM. PWM works by flickering the output between the minimum and maximum levels really fast, with the effect that the speaker position becomes a kind of average of recent positions. Thus, you effectively get higher resolution (bit depth) output but at the cost of needing a higher sampling rate (much higher than normal). It can sound fine, though - many CD players use 1-bit PWM audio converters. Some games use PWM - eg. Alex Kidd: The Lost Stars - but the space requirements are still an issue, as your sampling rate is higher.

3. Use multi-channel non-linear PCM output. Because there are three tone channels involved in making PCM audio, you can set all three to different levels, thereby gaining more possible positions. There isn't a simple way of stating the "bit depth" obtainable - nominally 12 bits but less due to the non-linearity - but from my calculations I'd say you could do something approaching the quality of 8-bit audio. One day I'll code it up, too - no game uses it.

4. The what-if option...

It would be possible to make some add-on hardware on the cartridge that would contain its own sample banks, possibly compressed, and do the necessary work to expose a single memory-mapped register where the main CPU could read the necessary data and output it; thus, the CPU load would drop, the output rate could go up, and combining with the some of the previous quality improvements you could get something that sounded pretty good. It'd still be CPU-bound though.

CPU bound means it still requires the main Z80 CPU to be working with the sound hardware simultaneously with playing it. Because of the strict timing requirements for audio (the time between samples must be constant), that makes it hard to have any audio playing at the same time as any other action in the game. No game has yet achieved that.

4. The last "what-if" is what if Sega had enabled add-on hardware on the cartridge to output audio (as is the case with the NES and Mega Drive). Then, anything would be possible, up to and including having an attached CD player, radio, MP3 player, etc, and there would be zero CPU usage (apart from when it was controlling the device).
  View user's profile Send private message Visit poster's website
  • Joined: 31 Oct 2006
  • Posts: 95
  • Location: MN, USA
Reply with quote
Post Posted: Tue Feb 13, 2007 3:42 pm
The cartridge input idea would have made so many thing more simple.
The FM Sound Unit required external mixing.
I find it odd they didn't put the inputs in the expansion port on the SMS(granted it makes things simpler now, what with the gender adaptor).
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13165
  • Location: London
Reply with quote
Post Posted: Tue Feb 13, 2007 4:24 pm
(OT)

Wiring all three ports (expansion, cartridge, card) the same made it simpler to deal with certain things, and not having audio-in meant they could avoid including a never-used mixer device in the system. Incidentally, the Game Gear does have audio-in - for the TV adaptor - but I'm not sure if it can be used in-game, it might only work in TV mode.
  View user's profile Send private message Visit poster's website
  • Joined: 16 May 2002
  • Posts: 1164
  • Location: italy
Reply with quote
Post Posted: Tue Feb 13, 2007 6:15 pm
SEEEEEEGAAAAAAAAA

Also, why are there two points 4 in Maxim's post?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 25 Oct 1999
  • Posts: 2029
  • Location: Monterey, California
Reply with quote
Post Posted: Tue Feb 13, 2007 6:59 pm
I don't think the NES had the audio-in pins on the cartridge port, only the Famicom. That's why some of the Famicom carts with on-cart audio chips (such as Castlevania III with a VRC7 chip, I believe) had regular APU sound in the export versions.

Anyhow, one issue that I'e noticed with PCM sound (as opposed to PWM) is that it's usually very quiet, generally quieter than the music. I would guess this has to do with PWM sounds toggling back and forth from the highest and lowest volume settings, therefore generating more overall 'sound energy' (loudness being a factor of the amount of change in the position of the speaker from sample to sample over time), while PCM, though clearer, does have less 'travel' since it doesn't generally go from high to low from one sample to the next. So you're trading volume for clarity. I had figured this is probably why PWM samples were more common on the SMS -- I don't recall any Sega-produced games using PCM.

I would imagine that, while you could probably increase the bit depth of a sample by not simply repeating the sample on all three channels, and instead doing as Maxim described, this would result in even quieter samples.


Also, does anyone know if it's possible for a cartridge to send an interrupt request or something that could force the z80 to execute specific code based on a timer? As Maxim explained, most games that use voice or other sound recordings have to freeze the action to play a sample. Some games did allow a small bit of motion while a sample is played -- note in Space Harrier, the player character fall to the ground while screen if he loses a life, but this causes some breakup in the sample playback, which is not present if you play the sound from the sound test.

If there were some way to force the CPU to jump to a routine periodically to feed the next sample to the sound chip (at least 7 or 8 thousand times a second) without having to sit there and count cycles and do nothing else, it would be possible to have samples play while allowing some game action on the screen. This would still reduce the amount of cycles available to the Z80 for other things, so this would limit the complexity of games (in terms of how much can be going on on the screen at a time).

One way I thought of to do this internally, that is, without special hardware in the cartridge, would be to use horizontal blank interrupts as a timer. There are 15,720 line interrupts generated each second on an NTSC machine, so if you used that as a timer, you could play 15.7khz samples or (probably more desirable), 7.86 khz samples by playing skipping every other scanline. I don't think this is enough for PWM samples, which require more frequent updates, but it's OK for PCM. The problem with this idea is that there's no way, to my knowledge, to have the VDP trigger hblank interrupts during the vblank period, so you'd have to revert to timing those through software. So not only would you lose a quarter of your processing time, you'd lose the precious vblank period which is the optimum time to update the screen. This might work for some very simple puzzle games without a lot of screen updates or complex game logic, or a proof-of-concept demo, but is probably not practical for most games.
  View user's profile Send private message Visit poster's website
  • Joined: 31 Oct 2006
  • Posts: 95
  • Location: MN, USA
Reply with quote
Post Posted: Tue Feb 13, 2007 9:18 pm
Maxim wrote
(OT)

Wiring all three ports (expansion, cartridge, card) the same made it simpler to deal with certain things, and not having audio-in meant they could avoid including a never-used mixer device in the system. Incidentally, the Game Gear does have audio-in - for the TV adaptor - but I'm not sure if it can be used in-game, it might only work in TV mode.
Actually, the SMS in Japan has FM mixing built in. How much was changed to do that?
  View user's profile Send private message Visit poster's website
  • Joined: 01 Jan 2005
  • Posts: 360
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Wed Feb 14, 2007 12:21 am
furanku wrote
Do you think with todays technology that Sega could do a better job doing a voice on the SMS?

My theory is that CRI constructed a primitive sampler out of some scrap resistors and gave it to Sega some time around 1981. Sega has the most awful voice quality, and it goes on to the Megadrive and beyond.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 25 Oct 1999
  • Posts: 2029
  • Location: Monterey, California
Reply with quote
Post Posted: Wed Feb 14, 2007 1:09 am
idrougge wrote
furanku wrote
Do you think with todays technology that Sega could do a better job doing a voice on the SMS?

My theory is that CRI constructed a primitive sampler out of some scrap resistors and gave it to Sega some time around 1981. Sega has the most awful voice quality, and it goes on to the Megadrive and beyond.


I would imagine that in the case of games like Space Harrier, they would have been able to get access to the existing voice recording binaries from the arcade version, which were perfectly clear, and downsample them. So I'd say the awful quality had more to do with the downsampling and the player than any problem with the recording equipment.

Not sure what to say about the Megadrive era except that lo-fi samples save cartridge space, and that the MegaDrive still didn't have a sound chip capable of playing samples directly through memory (DMA) so the sound CPU was tasked with both feeding samples into the DAC and controlling the FM chips.
  View user's profile Send private message Visit poster's website
  • Joined: 25 Feb 2006
  • Posts: 548
  • Location: Belo Horizonte, MG, Brazil
Reply with quote
Post Posted: Wed Feb 14, 2007 2:24 am
Quote

3. Use multi-channel non-linear PCM output. Because there are three tone channels involved in making PCM audio, you can set all three to different levels, thereby gaining more possible positions. There isn't a simple way of stating the "bit depth" obtainable - nominally 12 bits but less due to the non-linearity - but from my calculations I'd say you could do something approaching the quality of 8-bit audio. One day I'll code it up, too - no game uses it.


I tried to do that once, but it doesn't sound very good. Maybe I'm doing something wrong?
psgsample.zip (90.24 KB)
PSG Sample Playing Test

  View user's profile Send private message Visit poster's website
  • Joined: 11 Sep 2006
  • Posts: 94
  • Location: Denver, CO
Reply with quote
Post Posted: Wed Feb 14, 2007 6:06 am
Regarding Alex Kidd: Lost Stars...
is it "I'm the Miracle Ball" or "Find the Miracle Ball"? I'm pretty sure it's "I'm", but it could be interpreted either way.
  View user's profile Send private message
  • Joined: 02 Jan 2005
  • Posts: 632
Reply with quote
Post Posted: Wed Feb 14, 2007 6:28 am
Joe Redifer wrote
Regarding Alex Kidd: Lost Stars...
is it "I'm the Miracle Ball" or "Find the Miracle Ball"? I'm pretty sure it's "I'm", but it could be interpreted either way.


It's "Find the Miracle Ball." Consult arcade version for proof.
  View user's profile Send private message Visit poster's website
  • Joined: 16 May 2002
  • Posts: 1164
  • Location: italy
Reply with quote
Post Posted: Wed Feb 14, 2007 8:36 pm
I always thought it is "Find", while tagged as "I'm" in the VGM pack iirc
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13165
  • Location: London
Reply with quote
Post Posted: Thu Feb 15, 2007 7:42 am
Heliophobe wrote
Anyhow, one issue that I'e noticed with PCM sound (as opposed to PWM) is that it's usually very quiet, generally quieter than the music

I think a lot of the quietness of PCM is due to the use of the logarithmic PSG volume scale as if it was linear; it results in the lower half of the wave being squished and the upper half being deformed somewhat in a not-very-loud way. PWM avoids that issue. I would hope some specialised encoding would make it sound louder as well as more accurate.

Wave processing is also an issue; with careful work, an 8-bit sample can sound extraordinarily clear. Based on what work I've done with samples on the SMS, even processing something into 4-bit 8kHz PCM is a struggle to make it sound acceptable, and back in the 80s I'm sure they weren't bothered to spend much on getting to any level of perfection, especially considering how much effect it'd have on sales (graphics being the way to go there).

haroldoop wrote
I tried to do that once, but it doesn't sound very good. Maybe I'm doing something wrong?

It certainly does sound odd - what's with the noise? Where did you get the lookup tables from? Is it trying to approximate 8-bit data using those tables? I think it'd be better to have it pre-processed from 16-bit audio down to non-linear 8-bit using exactly-matching tables. But good downsampling is more than just truncation or rounding...

Tom wrote
I always thought it is "Find", while tagged as "I'm" in the VGM pack iirc

Well, I had to pick one, I had a 50-50 chance... feel free to post in the GD3 corrections thread.
  View user's profile Send private message Visit poster's website
  • Joined: 01 Jan 2005
  • Posts: 360
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Thu Feb 15, 2007 8:57 pm
Heliophobe wrote
idrougge wrote
furanku wrote
Do you think with todays technology that Sega could do a better job doing a voice on the SMS?

My theory is that CRI constructed a primitive sampler out of some scrap resistors and gave it to Sega some time around 1981. Sega has the most awful voice quality, and it goes on to the Megadrive and beyond.


I would imagine that in the case of games like Space Harrier, they would have been able to get access to the existing voice recording binaries from the arcade version, which were perfectly clear, and downsample them. So I'd say the awful quality had more to do with the downsampling and the player than any problem with the recording equipment.


Actually, the arcade versions (or at least the CD soundtrack thereof) sounds so bad you could think the machine didn't have any real PCM playback capacity.
  View user's profile Send private message Visit poster's website
  • Joined: 25 Feb 2006
  • Posts: 548
  • Location: Belo Horizonte, MG, Brazil
Reply with quote
Post Posted: Fri Feb 16, 2007 2:10 am
Quote
It certainly does sound odd - what's with the noise? Where did you get the lookup tables from? Is it trying to approximate 8-bit data using those tables? I think it'd be better to have it pre-processed from 16-bit audio down to non-linear 8-bit using exactly-matching tables. But good downsampling is more than just truncation or rounding...


It was based on this article: http://map.tni.nl/articles/psg_sample.php
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13165
  • Location: London
Reply with quote
Post Posted: Fri Feb 16, 2007 10:04 am
haroldoop wrote
It was based on this article: http://map.tni.nl/articles/psg_sample.php

Ah, yes, I've read that one before. The chip in the MSX has a different volume scale to the SMS (MSX: 5dB per step, SMS: 2dB per step), so the tables will be inappropriate.

The tables produce the closest possible match to a given 8-bit sample, so the result isn't as clear as it would be with pre-processed samples and good dithering; on the other hand, he's brute-force-analysed the best maximum volume to use to get the minimum overall error, at the cost of overall amplitude.

The sample used in your .sms file also seems to be at too high a sampling rate - it's outputting at about 8kHz but H_sega.snd sounds right at around 16kHz.

Attached below is a screenshot of the original raw sample data and the output it produces, in the middle of the "aaaa" sound. The original data is a smooth repeating pattern, but the PSG output seems very noisy, suggesting some kind of systematic error. I suggest you put in some known-value waves - flat, sawtooth, sine, etc - to debug it.

You can also use a known-frequency sine wave to calibrate the playback speed - sample the output from a real system and FFT analysis should pop out the resultant fundamental frequency, then (output sampling rate) = (input sampling rate) * (output frequency) / (input frequency).
Wave and PSG comparison.png (54.98 KB)
Comparison of wave input and PSG output
Wave and PSG comparison.png

  View user's profile Send private message Visit poster's website
  • Joined: 10 Dec 2000
  • Posts: 590
  • Location: Australia and Japan
Reply with quote
Post Posted: Fri Feb 16, 2007 12:06 pm
Will these voices fit on a sms cart with a game. Seems huge.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13165
  • Location: London
Reply with quote
Post Posted: Fri Feb 16, 2007 1:25 pm
Well, I'm sure 4-bit ADPCM would be feasible on the SMS, by carefully-timed branching, which at 8kHz would give you 3.9KBytes/s (32kbits/s) - back to the 4 bits per sample of regular audio but at a higher quality.
  View user's profile Send private message Visit poster's website
  • Joined: 11 Sep 2006
  • Posts: 94
  • Location: Denver, CO
Reply with quote
Post Posted: Fri Feb 16, 2007 2:30 pm
Could the SMS handle Sports Talk Football (or Basketball or Futbol or Cricket or whatever) if it had a similar-sized cartridge as the Genesis/Mega Drive Sports Talk games? Or would the game freeze each time it had to talk? Space Harrier stays in motion while it talks.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13165
  • Location: London
Reply with quote
Post Posted: Fri Feb 16, 2007 3:00 pm
Cartridge size is really just a cost issue; using the standard mapper scheme, you can access 4MBytes, and using a custom mapper there could be no limit. As for what you describe: highly unlikely. Well, maybe the cricket, you wouldn't notice a pause because it's so damn slow already... :) Seriously, the point is that the only action you can really have during sample playback is something that's of predetermined complexity - eg. move sprite down by 1 pixel - and not something user-controlled, unless you can make all possible actions take exactly the same, very small, amount of time. And as noted above, Space Harrier's voice sounds clearer in the sound test because it doesn't have the animation to do.
  View user's profile Send private message Visit poster's website
  • Joined: 31 Oct 2006
  • Posts: 95
  • Location: MN, USA
Reply with quote
Post Posted: Fri Feb 16, 2007 4:01 pm
Maxim wrote
haroldoop wrote
It was based on this article: http://map.tni.nl/articles/psg_sample.php

Attached below is a screenshot of the original raw sample data and the output it produces, in the middle of the "aaaa" sound. The original data is a smooth repeating pattern, but the PSG output seems very noisy, suggesting some kind of systematic error. I suggest you put in some known-value waves - flat, sawtooth, sine, etc - to debug it.
.
That's the sort of waveform that can result from digital clipping as well.
The amplitude might be too high. I could be wrogn, though.
  View user's profile Send private message Visit poster's website
  • Joined: 25 Feb 2006
  • Posts: 548
  • Location: Belo Horizonte, MG, Brazil
Reply with quote
Post Posted: Sat Feb 17, 2007 6:41 pm
First of all, thanks for your input.

Quote
Ah, yes, I've read that one before. The chip in the MSX has a different volume scale to the SMS (MSX: 5dB per step, SMS: 2dB per step), so the tables will be inappropriate.


I didn't know that.. That would explain why it sounded so bad. =P

Quote
The sample used in your .sms file also seems to be at too high a sampling rate - it's outputting at about 8kHz but H_sega.snd sounds right at around 16kHz.


Actually, it was recorded at 11.5 kHz, but I see your point.

Quote

Attached below is a screenshot of the original raw sample data and the output it produces, in the middle of the "aaaa" sound. The original data is a smooth repeating pattern, but the PSG output seems very noisy, suggesting some kind of systematic error. I suggest you put in some known-value waves - flat, sawtooth, sine, etc - to debug it.

You can also use a known-frequency sine wave to calibrate the playback speed - sample the output from a real system and FFT analysis should pop out the resultant fundamental frequency, then (output sampling rate) = (input sampling rate) * (output frequency) / (input frequency).


Thanks for the tips. I'll give them a try,

Quote

That's the sort of waveform that can result from digital clipping as well.
The amplitude might be too high. I could be wrogn, though.


I see your point. Maybe the tables weren't optimized for that amplitude.
  View user's profile Send private message Visit poster's website
  • Joined: 28 Sep 1999
  • Posts: 1149
Reply with quote
Post Posted: Sun Feb 18, 2007 4:20 am
Quote
Also, does anyone know if it's possible for a cartridge to send an interrupt request or something that could force the z80 to execute specific code based on a timer?


Yes, you could have a timer in the cartridge assert /INT and run your program interrupt mode 0. In that mode the first thing it does is read an opcode off the data bus rather than execute any particular interrupt handler. Most implementations I've seen send a single byte RST opcode, but the Z80 manual says any instruction of any length can be executed.

Slightly OT, but if it hasn't been mentioned before check out the Viterbi encoder stuff at the bottom of this page:

http://en.wikipedia.org/wiki/AY-3-8910

I wonder if it could be adapted for the SN76489 or other sound chips.
  View user's profile Send private message Visit poster's website
  • Joined: 12 Nov 2005
  • Posts: 54
Reply with quote
Post Posted: Sun Feb 18, 2007 5:12 am
Last edited by Blargg on Thu Feb 25, 2010 3:10 pm; edited 2 times in total
I put together a WAV to PSG program and it sounds quite good. It accepts a 16-bit mono wave file and outputs the raw PSG samples (packed two to a byte), a converted wave file and a VGM. There are lots of comments in the source and adjustments that can be made.

wav_to_psg.c

The main insight was that you need to eliminate negative samples from the input, but without offsetting all samples by a fixed amount. Rather than describe the algorithm, this picture should help:



The top is the original wave, which goes below zero about half the time. The middle is the offset to add to it, and the bottom is the wave with the offset added. It sounds virtually identical because the offset changes smoothly. Note how it's near zero for the quiet parts of the original sound, which keeps them near the DAC's zero where it has more resolution.

Below are a couple of random sounds I found on the net, along with conversions (as you can see, I was looking for the Sega sound but found something completely unrelated, heh). Sadly the VGM files won't play on any players using my VGM player library, since it doesn't support the PCM mode of the PSG when a channel's period is set to 0. Maxim's in_vgm should work.

sega.wav (original)
breakfast_8.8khz.mp3 (8.8 kHz PSG sample)
breakfast_8.8khz.vgz (VGM version)

sega1.wav (original)
scorned.mp3 (14.7 kHz PSG sample)
scorned_14.7kHz.vgz (VGM version)

The reason I used 8.8 kHz and 14.7 kHz is that those are the closest to those discussed that the VGM format can accurately handle (they're divisions of the base 44.1 kHz rate). I might try having it intelligently use the other two channels to increase resolution, but this sounds pretty good already.

Let me know if you have any problems with or questions about the algorithm or source code.

Update: I did a quick 3-channel implementation (no source yet). Here are the results:

breakfast_8.8khz_3ch.mp3
breakfast_8.8khz_3ch.vgz

The VGM of course comes out pretty huge now. I need to find another sample to work with, preferably one with less background noise.

Update 2: Here are several instrumental sounds whose source was a very clean 16-bit sample without any noise. I tried converting them to 14.7 kHz also but they didn't sound much better.

1.vgz
2.vgz
3.vgz
4.vgz
5.vgz
6.vgz

EDIT: updated links
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8192
  • Location: Paris, France
Reply with quote
Post Posted: Sun Feb 18, 2007 11:16 am
(I moved the topic to the Development forum, was becoming too technical)
  View user's profile Send private message Visit poster's website
  • Joined: 25 Feb 2006
  • Posts: 548
  • Location: Belo Horizonte, MG, Brazil
Reply with quote
Post Posted: Sun Feb 18, 2007 2:23 pm
Quote
I put together a WAV to PSG program and it sounds quite good. It accepts a 16-bit mono wave file and outputs the raw PSG samples (packed two to a byte), a converted wave file and a VGM. There are lots of comments in the source and adjustments that can be made.


Truly, it sounds quite good!
  View user's profile Send private message Visit poster's website
  • Joined: 10 Dec 2000
  • Posts: 590
  • Location: Australia and Japan
Reply with quote
Post Posted: Sun Feb 18, 2007 10:11 pm
Bock wrote
(I moved the topic to the Development forum, was becoming too technical)


Good thing you did. All i was really after is a game name of the best and worst speech.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13165
  • Location: London
Reply with quote
Post Posted: Mon Feb 19, 2007 9:05 am
The VGM files linked above are invalid, they have no "end of file" byte so in_vgm goes into a panicky funk when there really is no more data. I'll fix that for the next release, but for now, here's those exact same files after being fixed.
breakfast_8.8khz.vgz (52.18 KB)
scorned_14.7kHz.vgz (16.89 KB)
1.vgz (17.93 KB)
2.vgz (17.61 KB)
3.vgz (12.3 KB)
4.vgz (12.76 KB)
5.vgz (5.87 KB)
6.vgz (25.65 KB)
wav_to_psg.c (8.76 KB)
May as well mirror this too

  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13165
  • Location: London
Reply with quote
Post Posted: Fri Apr 15, 2016 9:26 pm
I've been looking at this after all these years. Isn't it wrong to make the wave positive by shifting it up without scaling? A wave with full amplitude would end up severely clipped. The fix is to halve the amplitude at the same time, but that's going to make the results a lot quieter.

I'd like to adapt the algorithm into the viterbi encoder Charles mentioned above, as that offers additional improvements to the single channel quantisation used here.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!