Author |
Message |
- Joined: 25 Feb 2013
- Posts: 384
- Location: Osaka
|
Phase of the channels of the PSG
Posted: Sun Feb 06, 2022 10:45 am
|
The frequency of each channel is clearly specified by the tone register, but how is the relative phase between the three channels determined?
(let us say, if tone2 = tone1/2 and tone3=tone1/4).
|
|
|
- Site Admin
- Joined: 19 Oct 1999
- Posts: 14749
- Location: London
|
Posted: Sun Feb 06, 2022 10:50 am
|
It’s dependent on the previous frequencies used. The PSG is constantly counting down and reloads the counter when it gets to 0; so the relative phase at a given setting depends on when the counters reached 0 which depends on what frequency (technically, counter values which are half-wavelengths) was in use previously.
|
|
|
- Joined: 05 Dec 2019
- Posts: 56
- Location: USA
|
Posted: Sun Feb 06, 2022 3:50 pm
|
Thus one could force the channel's phase to either zero or 180 degrees by briefly setting period 1. However, I don't see how to control nor predict which of these two phases will be chosen.
|
|
|
- Joined: 25 Feb 2013
- Posts: 384
- Location: Osaka
|
Posted: Mon Feb 07, 2022 7:35 am
|
Let me see if I got it right:
- there are three free running counters.
- each counter counts downwards
- the tone is just the reload value
- when 0 is reached, the respective reload value is loaded.
I have no musical knowledge, but simply by Fourier I would expect that three different frequencies should sum up to a wide variety of signals depending on the respective phase.
Do they sound pretty much the same irrespective of the phase?
Did the developers use tricks as the one mentioned by PinoBatch to control the relative timing?
|
|
|
- Site Admin
- Joined: 19 Oct 1999
- Posts: 14749
- Location: London
|
Posted: Mon Feb 07, 2022 8:31 am
|
Technically phase should have no effect on the perceived tones, except in the case where you are specifically targeting overtones or identical frequencies to get phase effects. I thought Fourier analysis is invariant to phase. Most games are using different frequencies on all channels most of the time making it less of a factor.
I think I have seen an attempt at this once, in Micro Machines 2 for GG (I think - it was a long time ago) which seemed to have a 50% phase offset between channels to give a very rough triangle shape. Well, maybe it was an accident, but I saw it in the waveform while trimming the pack.
I don’t know of any games using very close frequency parameters to get a phasing effect between the two channels.
|
|
|
- Joined: 25 Feb 2013
- Posts: 384
- Location: Osaka
|
Posted: Mon Feb 07, 2022 11:23 am
|
Thank you. The coefficients of the Fourier transform are complex numbers, the magnitude is the usual spectrum and the phase encodes the phase of each component.
The Fourier transform is an invertible function. If two different signals (sum of the same signals but with different phases), were to have the same transform, it would imply the transform is not invertible. The difference between such signals is, indeed. in the phase of their coefficients.
I guess that unless a frequency is a multiple of the other it will never be noticed. If so we must deduce that, except in rare cases as the one you mentioned, developers usually never used multiple harmonics to change the timber of a particular note, and preferred to have the possibility of multiple notes at the same time.
|
|
|