Varying Tone/Timbre on AY Channel through Hardware!

Probably the most technical forum around. It does not have to be coding related, or assembly code only. Just talk about how you can use the AY chip to do cool sounding things :)
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Varying Tone/Timbre on AY Channel through Hardware!

Post by Twilighte »

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.
Last edited by Twilighte on Sat Jan 03, 2009 1:35 pm, edited 2 times in total.
User avatar
carlsson
Pilot Officer
Posts: 127
Joined: Thu Jan 12, 2006 11:26 pm
Location: Västerås, Sweden

Post by carlsson »

Interesting. Would this technique only be useful on the Oric, with the AY chip mapped through the VIA?
Anders Carlsson
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

Yes :/
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

I've just updated the first message again. There were some discrepencies.
Apparently Andre is currently converting xeuphoric to C. It would be very cool if the 6522 was completely emulated. Fabrice theorised to make this so would require a pentium pc.. hmm methinks we have moved beyond those now. :)
User avatar
waskol
Flight Lieutenant
Posts: 414
Joined: Wed Jun 13, 2007 8:20 pm
Location: FRANCE, Paris

Post by waskol »

Twilighte wrote:I've just updated the first message again. There were some discrepencies.
Apparently Andre is currently converting xeuphoric to C. It would be very cool if the 6522 was completely emulated. Fabrice theorised to make this so would require a pentium pc.. hmm methinks we have moved beyond those now. :)
If this is done, you will have an emulator for XP/VISTA/SEVEN operational very quickly since it is the only part I did not success to emulate in my emulator !

If only I could get in touch with Andre in order to work on it could be very great !
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

Well now we have Oricutron (previously Oriculator) by Xeron we have an emulator that supports the Shift Register.
There are bugs in version 0.4 regards mode 100 Shift register mode which is intended for HardSID on the Oric and at the moment these are preventing HardSID to work correctly.

To test it i have written a little utility called hs.tap
It allows control of all the parameters in the HardSID environment.
You can get it here..

http://code.google.com/p/oriculator/issues/detail?id=17

The massive advantage of HardSID is it doesn't require a fast irq to constantly run in order to generate the SID sound.
Take the Times of Lore title music for example..

It displays the natty colour title TIMES of LORE then displays the doors opening sequence then back to the title again.
If we run a fast IRQ the SID sound will be too bad if we interrupt it everytime we want to change the HIRES screen (40x120).
Conversely the HIRES screen will look ugly if we keep the irq running during its display update.
But with HardSID we can use the CPU solely for updating the screen (and music element) which will look far superior.
[/img]
User avatar
waskol
Flight Lieutenant
Posts: 414
Joined: Wed Jun 13, 2007 8:20 pm
Location: FRANCE, Paris

Re: Varying Tone/Timbre on AY Channel through Hardware!

Post by waskol »

There may be another usage of this technique :
using the T2 Latch, it might be worth a try to create a "hardware" enveloppe generator (controlling volume directly) instead of using the limited AY enveloppe generator.
That would permit to create some ADSR enveloppe in order to make the Oric sound more like a real piano, flute, etc...

Unfortunately, I do not have the assembler skills to try this out.
User avatar
Dbug
Site Admin
Posts: 4438
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Varying Tone/Timbre on AY Channel through Hardware!

Post by Dbug »

Keep in mind that the Shift Register based tricks do not seem to work on all the Orics.
Post Reply