2 eurocents question about AY-8912 possibilities
2 eurocents question about AY-8912 possibilities
Do you think it would be technically possible to play the raw data of a wav file with a ay-8912 ???
Of course, I imagine that the main limitation is the sample rate frequency...
what do you think ?
Of course, I imagine that the main limitation is the sample rate frequency...
what do you think ?
Re: 2 eurocents question about AY-8912 possibilities
Yes. It was common on the Atari ST.waskol wrote:Do you think it would be technically possible to play the raw data of a wav file with a ay-8912 ???
Of course, I imagine that the main limitation is the sample rate frequency...
what do you think ?
hmmm, it seems that someone did it for spectrum
http://www.zxdemo.org/extra/src/samplepack-20070527.zip
the zip file contains nice piece of source code in order ti realize a wav player for a zx-spectrum (and for an Oric maybe ?)
http://www.zxdemo.org/extra/src/samplepack-20070527.zip
the zip file contains nice piece of source code in order ti realize a wav player for a zx-spectrum (and for an Oric maybe ?)
Well, it's "trivial" to adapt to the Oric all the methods used on other AY/YM based machines.
I did my first 8 bit replay routine in 1997, for the "Oric Mega Demo" - mega only in the name -, making it replay the "Welcome" sample of the Barbarian 2 game "Welcome to the Dungeon of Drax: Please choose your warrior".
Performance wise, 8 bits is not very efficient, it's easier and way less CPU intensive to replay 4 bits samples. It also takes half the memory, since you can pack 2 samples on one byte.
The idea is just to play with the volume registers on the chanels. On one chanel you can get a value between 0 and 15 (0 to 1volt), and by using two or three chanels, you can get a larger value which increase the number of potential values and the volume (from 0 to 3 volts), giving a nearly 8 bit quality by using the cumulated 12 bits creatively.
I used the conversion tables from ST Replay, and they worked fine on the Oric as well.
Twilighte can provide good code for replaying samples. Mine is very crappy, I did that a very long time ago.
I did my first 8 bit replay routine in 1997, for the "Oric Mega Demo" - mega only in the name -, making it replay the "Welcome" sample of the Barbarian 2 game "Welcome to the Dungeon of Drax: Please choose your warrior".
Performance wise, 8 bits is not very efficient, it's easier and way less CPU intensive to replay 4 bits samples. It also takes half the memory, since you can pack 2 samples on one byte.
The idea is just to play with the volume registers on the chanels. On one chanel you can get a value between 0 and 15 (0 to 1volt), and by using two or three chanels, you can get a larger value which increase the number of potential values and the volume (from 0 to 3 volts), giving a nearly 8 bit quality by using the cumulated 12 bits creatively.
I used the conversion tables from ST Replay, and they worked fine on the Oric as well.
Twilighte can provide good code for replaying samples. Mine is very crappy, I did that a very long time ago.
Thanks Dbug, Pure WAV files from the PC contain about 16 or 32 bytes of header info, which is not so cool at the start of a sample when played on the Oric.
Their are several ways to play samples on the Oric, some are faster than others but remember, the faster the routine the more memory the sample may use.
I have written sample players from 200Hz up to 44Khz.
If you need a routine, let me know and i'll see if i can find time to find one.
Their are several ways to play samples on the Oric, some are faster than others but remember, the faster the routine the more memory the sample may use.
I have written sample players from 200Hz up to 44Khz.
If you need a routine, let me know and i'll see if i can find time to find one.
I found some decent info on an MSX page.
It has info on playing 8 bit samples and there is supposedly even a link to a read wave program to test it out.
http://map.tni.nl/articles/psg_sample.php#8bitsamples
It has info on playing 8 bit samples and there is supposedly even a link to a read wave program to test it out.
http://map.tni.nl/articles/psg_sample.php#8bitsamples
OK, let'see it in this way :
How could it be possible to "translate" some raw datas of a wav file into Oric asm code ???
If we can sort out an algorithm, it might be possible :
- to compose on PC
- "Translate" the resulting wav file into oric asm (on the PC)
- compile with OSDK
- hear the result on Oric
I am pretty sure it is possible, but my skills in asm and moreover of how to address the AY-8912 are, hummm... well
How could it be possible to "translate" some raw datas of a wav file into Oric asm code ???
If we can sort out an algorithm, it might be possible :
- to compose on PC
- "Translate" the resulting wav file into oric asm (on the PC)
- compile with OSDK
- hear the result on Oric
I am pretty sure it is possible, but my skills in asm and moreover of how to address the AY-8912 are, hummm... well
I packaged in a OSDK compliant the code of the "Welcome" from my Oric Mega Demo of 1997:
http://www.defence-force.org/ftp/forum/ ... lSound.zip
- welcome.s is a 8bit sample saved in raw/unsigned format
- digit.s is the replay code, including three 256 bytes tables used to convert the 8 bit sample to a single 4 bits value for each separate chanel.
(I'm using the old tables from the Atari ST ST-Replay software)
http://www.defence-force.org/ftp/forum/ ... lSound.zip
- welcome.s is a 8bit sample saved in raw/unsigned format
- digit.s is the replay code, including three 256 bytes tables used to convert the 8 bit sample to a single 4 bits value for each separate chanel.
(I'm using the old tables from the Atari ST ST-Replay software)
Well, I only adapted what we did on the Atari ST (same sound chip).waskol wrote:DBUG, I am afraid but... you are the best !!!!
It is really impressive.
This demo shows that it is possible to get anything out of the oric...
really impressive... (my jaw is still on the floor...)
And both Fabrice and Twilighte made sample sound, and there is this Rambo demo of the Tivoli Pirat as well, so please give the credits to other people
Well, a last technical question about this wonderfull "welcome".Dbug wrote:Well, I only adapted what we did on the Atari ST (same sound chip).waskol wrote:DBUG, I am afraid but... you are the best !!!!
It is really impressive.
This demo shows that it is possible to get anything out of the oric...
really impressive... (my jaw is still on the floor...)
And both Fabrice and Twilighte made sample sound, and there is this Rambo demo of the Tivoli Pirat as well, so please give the credits to other people
what is the sample rate of this ?
For example, imagine that I want to digitalize a sound effect and play it back :
- First I convert my little wav file to an unsigned 8 bits (but at which sample rate ?)
- then I extract the raw data (it is just a question of removing the wav header, and convert the binaries to a text file)
- finally I compile with OSDK
thank you
Good question.
I think it's 8khz, but I'm not sure.
Thing is, this routine does not use any timer, it is just disabling the interruptions and try to send stuff to the soundchip as fast as possible.
You probably noticed the 7 "nop" instructions, it's to slow down the replay.
The faster the loop, the higher the frequency
If you use a sample at a different (lower) frequency, you can just change the number of nop, or use instructions that take more time, this way you can play longer samples.
Also you can probably optimise the code quite a lot
If you use one channel instead of 3, the sound quality is a lot worse, but then you can use 4 bit samples, meaning that you store twice as many sample data in the same number of bytes, and you speedup the code by a HUGE factor (not x3, a lot more) because you can remove almost all the VIA register switching. Just need to select the volume register and write values in here as fast as you can - the methid we used to replay the 20th century fox and Digital DTS jingles in the other demos -
I think it's 8khz, but I'm not sure.
Thing is, this routine does not use any timer, it is just disabling the interruptions and try to send stuff to the soundchip as fast as possible.
You probably noticed the 7 "nop" instructions, it's to slow down the replay.
The faster the loop, the higher the frequency
If you use a sample at a different (lower) frequency, you can just change the number of nop, or use instructions that take more time, this way you can play longer samples.
Also you can probably optimise the code quite a lot
If you use one channel instead of 3, the sound quality is a lot worse, but then you can use 4 bit samples, meaning that you store twice as many sample data in the same number of bytes, and you speedup the code by a HUGE factor (not x3, a lot more) because you can remove almost all the VIA register switching. Just need to select the volume register and write values in here as fast as you can - the methid we used to replay the 20th century fox and Digital DTS jingles in the other demos -