Varying Tone/Timbre on AY Channel through Hardware!
Posted: Mon May 28, 2007 1:16 am
I have had a bit of a brainwave.
The following idea can only be done on a Real Oric not on any emulator (because the shift register is not emulated) apart maybe from Caloric (when it is finished).
1) Set up one channel to EG Control by setting B4 in volume channel
2) Write 0 to the Envelope (EG) period
3) Set up the AY Sound Register to 13 (Cycle register)
4) Write \_ envelope waveform value to Port A ($030F)
5) Write %10000000 (Binary) to shift register
6) set CA2 low and CB2 to low
7) Write a mid-range value to T2
8 ) Set up the Shift Register to shift continuously at T2 rate
Now at a rate set by T2, the shift register will Rotate the value 10000000 with each carry being placed both on CB2 and Bit7 of the shift register again.
With CA2 low, CB2 going high will write the current value in $030F(PortA) to AY register 13. Because a write to register 13 always resets the waveform, it will produce this...
1000000010000000..
\_______\_______
By placing 11000000 in the shift register we will effectively produce the same pitch and volume but alter the tonal quality of the note.
11000000
\\______
Whilst we display the trigger as \\ the actual height will be more uniform (because even with an envelope period of 1, the Envelope will not have time to depleat before the second trigger is sent).
Now by varying T2 Latch/counter we are able to change the frequency of the note. On further reading of the 6522 spec it would seem that only the lower 8 bits of T2 are used for the rate which is even better since only the low period of T2 is latched in the 6522.
Cool huh?
It may even be possible to produce PWM samples using this technique.
Now all thats needed is someone to write this code and try it.
The following idea can only be done on a Real Oric not on any emulator (because the shift register is not emulated) apart maybe from Caloric (when it is finished).
1) Set up one channel to EG Control by setting B4 in volume channel
2) Write 0 to the Envelope (EG) period
3) Set up the AY Sound Register to 13 (Cycle register)
4) Write \_ envelope waveform value to Port A ($030F)
5) Write %10000000 (Binary) to shift register
6) set CA2 low and CB2 to low
7) Write a mid-range value to T2
8 ) Set up the Shift Register to shift continuously at T2 rate
Now at a rate set by T2, the shift register will Rotate the value 10000000 with each carry being placed both on CB2 and Bit7 of the shift register again.
With CA2 low, CB2 going high will write the current value in $030F(PortA) to AY register 13. Because a write to register 13 always resets the waveform, it will produce this...
1000000010000000..
\_______\_______
By placing 11000000 in the shift register we will effectively produce the same pitch and volume but alter the tonal quality of the note.
11000000
\\______
Whilst we display the trigger as \\ the actual height will be more uniform (because even with an envelope period of 1, the Envelope will not have time to depleat before the second trigger is sent).
Now by varying T2 Latch/counter we are able to change the frequency of the note. On further reading of the 6522 spec it would seem that only the lower 8 bits of T2 are used for the rate which is even better since only the low period of T2 is latched in the 6522.
Cool huh?
It may even be possible to produce PWM samples using this technique.
Now all thats needed is someone to write this code and try it.