Changes

PSG

1,544 bytes added, 23 April
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 ==
|}
==== Bit 3 When using the volume envelope generator, the volume is always increased from 00h to 0Fh (Continueor vice versa) ==== We can observe that there are only 8 resulting shapes, even though they are selected by using it is not possible to specify a 4-bit value. The continue bit does not exist internally. In other words, we have: shape = 1 if starting/ending point (ves >> 2 == 0like from 00h to 07h) else 7 if (ves >> 2 == 1) else ves & 7.
==== Bit 2 (Attack) ====
This bit is only responsible for the starting point of the envelope and the direction. In other words, we We have:
volume = 0 if attack else 15 # Start at 0 for attack, 15 for decay
direction = 1 if attack else -1 # Upward for attack, downward for decay
==== Bit 3 (Continue), Bit 1 (Alternate) and Bit 0 (Hold) ==== When using the volume envelope generatorbit3 = 0, the volume is and direction at the end of a period are always increased from 00h to 0Fh (or vice versa)0. When bit3 = 1, it is not possible bit1 and bit0 determine what happens to specify volume and direction at the end of a starting/ending point period. ==== Algorithm ====  def envelope_step(like from 00h to 07hvolume, direction, shape).: volume += direction if volume > 15 or volume < 0: match shape: case 8 | 12: volume &= 0x0f # direction is unchanged case 10 | 14: direction *= -1 volume += direction case 11 | 13: direction = 0 volume = 15 case _: direction = 0 volume = 0 return volume, direction
=== 0Eh - External Dataregister Port A ===
* 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]]
12,789
edits