The Programmable Sound Generator (PSG) is a sound chip designed by General Instrument (GI) in 1978. The specific model used in the CPC is the AY-3-8912 chip.
The PSG is quite primitive. It is able to output a square wave and/or white noise in three separate sound channels (named Channel A, B and C). Each channel can be Some other 8-bit systems used to output tones more sophisticated soundchips such as the [https://youtu.be/7pONRbIHT_w C64 SID], the [https://youtu.be/BANwL2sQ0DM NES APU] andthe [https:/or white noise/youtu.be/-mdjiWBYIqU Gameboy soundchip].
== PSG Part numbers used in the CPC during its lifetime ==
When bit3 = 0, volume and direction at the end of a period are always 0.
When bit3 = 1, Bit 1 bit1 and Bit 0 bit0 determine what happens to volume and direction at the end of a period.
==== Algorithm ====
volume += direction
if volume > 15 or volume < 0:
if match shape < 8 or shape == 9 or shape == 15: direction = 0case 8 | 12: volume &= 0 elif shape == 11 or shape == 13: 0x0f # direction = 0is unchanged volume = 15 elif shape == case 10 or shape == | 14: direction *= -1 volume += direction else case 11 | 13: direction = 0 volume = 15 # case _: direction unchanged= 0 volume &= 0x0f0
return volume, direction
* The noise tone can be changed by applying an AND and OR mask to the output
<br>=== Replacing the AY-3-8912 in the CPC with an AY-3-8910(A) === In case that the AY-3-8912 needs to be replaced in the CPC it can become a hurdle these days to get a real AY-3-8912 especially for an acceptable price. Instead of the original AY-3-8912 it's possible to use an AY-3-8910(A) instead with the help of a small adapter board. An open source adapter board can be found here: https://github.com/etomuc/CPC-AY-3-8910-to-8912-adapter
== Datasheets ==* [[MediaFor tips regarding the desoldering of ICs see this Wiki page:Ay3-891x.pdf|AY-3-891x datasheet]]* [[Media:Ym2149 datasheet.pdf|YM2149 datasheetIC Repair]]
== Links ==
*[http://en.wikipedia.org/wiki/General_Instrument_AY-3-8910 Wikipedia on the PSG]
*[[Media:Ay3-891x.pdf|AY-3-891x datasheet]] [[Media:Ym2149 datasheet.pdf|YM2149 datasheet]]
*[http://quasar.cpcscene.net/doku.php?id=assem:psg Quasar PSG documentation (in french)]
*[https://youtu.be/C4ezcX1W2_Y Mix I] [https://youtu.be/gH57xU9c7dE Mix II] [https://youtu.be/e7V3EMXF97g Mix III] AMSTRAD CPC MUSIC 1 hour
*[https://youtu.be/AhgUwqv2yAE Space Debris - Amstrad CPC Soundtrakker cover] [https://youtu.be/E_plcHyOC_8 RUN! - SID emulation on Amstrad CPC] by [[BSC]]
*[https://nguillaumin.github.io/ym-jukebox/ YM Jukebox] [https://ym.mmcm.ru/ AY Music Collection]
[[Category:Hardware]]
[[Category:Music and sound| ]][[Category:Video contents]][[Category:CPC Internal Components]]