Autor
| PSG samples
|
pitpan msx master Mensajes: 1379 | Publicado: Enero 27 2003, 12:27   |
I have been wondering how can you use the PSG to play samples. Anyone has any idea or source code? It was quite usual in 80's games: from Oh-Shit! to Rune Master 2. By the way, Rune Master 2 samples have an excellent quality. This is also true for Bandwagon demos.
I suppose that you should write constantly to the PSG to produce the wave, but no idea of amplitude, tone, envelope, etc. I am completly new to sound programming, but I feel that FM-PAC programming is quite easier than PSG or SCC. Anyway, first of all I want to code for the PSG.
Thanks!
|
|
Latok msx master Mensajes: 1727 | Publicado: Enero 27 2003, 12:31   |
You should try out PSG Sampler from Michel Shuqair  |
|
wolf_ online
 msx legend Mensajes: 4707 | Publicado: Enero 27 2003, 13:15   |
If can may make a very wild guess:
The psg has 16 volume steps, if you use a psg signal (essentially a square) to generate that sample, you get a sample with 4bit quality.
Compare it with the M and S commands from basic psg-mml.. You can make things like saw-type things and other amplitude modulated stuff. Same thing..
|
|
nf msx friend Mensajes: 3 | Publicado: Julio 21 2003, 19:14   |
Actually, our samples were 8-bit or even 12-bit. We used this method someone came up with the Atari ST: you've got three channels with 4 bit volumes, so each value of an 8-bit sample is mapped with a different combination of the three channels. I got the table straight from some Atari guy, so don't know how it works exactly.
|
|
GuyveR800 msx guru Mensajes: 3048 | Publicado: Julio 21 2003, 19:37   |
nf, would you please introduce yourself in the who=who forum? I'm sure I'm not the only one interested in knowing more about you  |
|
wolf_ online
 msx legend Mensajes: 4707 | Publicado: Julio 21 2003, 20:32   |
yeah.. that's true.. wouldn't expect this to work as I thought that using 3 channels, each with their 'own' sample (-part), would freeze the z80.
I wonder.. imagine that you filter:
1 all superhigh freqs of a sample,
2 all lo-freq freqs of a samples,
play 1 using the psg-noise, and play 2 using 3 psg channels.. what would the result be? I guess it's not 100% authentic since noise is just noise.. you can't control the contents (except the nosiecolor), only the amp.
anyone ?
|
|
Grauw msx professional Mensajes: 1005 | Publicado: Julio 21 2003, 21:50   |
|
|
NYYRIKKI msx master Mensajes: 1509 | Publicado: Julio 22 2003, 13:06   |
Quote:
| Actually, our samples were 8-bit or even 12-bit. We used this method someone came up with the Atari ST: you've got three channels with 4 bit volumes, so each value of an 8-bit sample is mapped with a different combination of the three channels. I got the table straight from some Atari guy, so don't know how it works exactly.
|
Hi, nf! Long time no C  Actually I asked this table from you few years ago, but I got only the replay routine. I anyway think, that I already figured that out (Correct me, if I'm wrong) as I think this is what the article in map.tni.nl/?p=articles/psg_sample.html is telling about the 5.5bit samples...
The volume controll of PSG seems to be linear, as you can directly play 4bit samples on it. If you use all 3 channels, they are just added to each other, so you get the range of 0-45. (It may be anyway more usefull to use these channels to play 3 samples at a same time.) Here is, example of the table, where N is the sample value (0-45) and A, B and C are the volume controls to each channel of PSG:
N: A B C
0-15 N 0 0
16-30 15 N-15 0
31-45 15 15 N-30
If you use this table, it is recommended to output the values to PSG in order of A,B,C or C,B,A to get minimum amount of unwanted click sounds.
As 0-45 is not any kind of vice table it is usefull to expand the table to 0-255, like it was made in your demos. This takes a bit more memory, but you can easyly use RAW samples created on any sample program without modifying the sample data.
If you would add also "Key click sound output" to the sample playing routine, you could get even more accurate sample playing, but I don't know if volume between PSG and key click is standard, so if it is not, then that might cause the sample to sound dissorted on some MSX models.
On SCC you have two different possibilitys... You can try to write the 32 byte sample RAM in same speed as it is playing, but I think, that it is VERY hard to get it in sync... or then you can use a bit modifyed version of the abowe mentioned method.
In SCC you have to fill the sample first with only one byte (#7F) to get the sound output up. Then you can choose sample rate. I don't know if the sample rate affects to volume setting in anyway, so pick just something.
SCC volume is not linear, so makeing a table for that will need oscilloscope (Or maybe PC with a good soundcard can do the trick). Anyway using different sample bytes on different channels, you can probably get the whole 8bit sample out of SCC, or maybe even more...
I have also heard very good quality samples played with FM-PAC, but I don't know details about that. I think, that the theory behind is about same, there is just more channels to use...
Note: All of this is just theory and I have not tried any of these methods.
~NYYRIKKI
|
|
NYYRIKKI msx master Mensajes: 1509 | Publicado: Julio 22 2003, 13:56   |
I just checked out, that Amiga volume can be converted to dB using formula:
dB=20*log10(Volume/64)
I think, that this can be quite a close also with SCC:
dB=20*log10(Volume/16)
Don't shoot me, if I'm wrong
~NYYRIKKI |
|
Grauw msx professional Mensajes: 1005 | Publicado: Julio 22 2003, 14:22   |
About the FM-PAC, apparantly you can set a bit somewhere in the test register, and that will enable you to write 6-bit sample data directly to the DAC. It is an undocumented feature of the FM-PAC. Although I don't know the exact details yet we intend to use this in our upcoming game aswell.
And thanks for the explaining text about '5.5-bit' samples and samples on the SCC. I'll add it to the MAP sometime (when I have more time  ).
~Grauw |
|
ms msx novice Mensajes: 18 | Publicado: Marzo 13 2004, 20:36   |
As Latok suggests, you could try the PSG Sampler. It comes with a driver file, called psgdrv.bin which has call routines (also in MSX-BASIC) to load samples and play them using SCC, PSG, FM-PAC and MSX-Music. This file can also be found on most Sunrise Picture Discs (but is named SRPSYS.BIN).
Some extra basic statements include:
CALL PSGPLAY(Device)
CALL PSGLOAD("Filename"
Samples can be imported, recorded and saved within PSG Sampler.
If you're interested I could provide you with the original disc, since I am the original author of the application. BUT, I need some time to figure out the copy-protection. Apparently I have not documented it and even I can't just copy the Original discs onto a blank disc. I need an MSX with Philips Drive Controller and Philips Disc Diagnostic software to create the copy. |
|
GuyveR800 msx guru Mensajes: 3048 | Publicado: Marzo 13 2004, 20:48   |
Michel?! WHOOAAAAAAA
Cool to see you here! Are you back, are you back, hey, hey?
|
|
ms msx novice Mensajes: 18 | Publicado: Marzo 13 2004, 21:13   |
Hi GuyveR800. Well, back, I just found this forum and thought I might contribute something. Only use my MSX turbo R nowadays to play some games (Thexder is my favorite!). Recently sold my sony F700p, nms8245 and Toshiba 700 printer. Also sold my Philips MSX CD-rom player together with the original Philips MSX cds. Too bad, this prototype of the first CD-Rom player in the world (1982) would be a nice to have nowadays.
But, who are you actually ? I am quite bad in names, but might remember you.
|
|
manuel msx guru Mensajes: 3447 | Publicado: Marzo 13 2004, 22:32   |
Quote:
| Also sold my Philips MSX CD-rom player together with the original Philips MSX cds. Too bad, this prototype of the first CD-Rom player in the world (1982) would be a nice to have nowadays.
|
Whoaah!! Any more information about that stuff?
Who has it now?
What were the product codes?
How did it work?
What was on the cd's?
ANyway, nice to see such a familiar name here. I remember talking to you on a Tilburg fair once... about PSG sampler of course  |
|
Vincent van Dam msx addict Mensajes: 379 | Publicado: Marzo 13 2004, 22:52   |
Quote:
| If you're interested I could provide you with the original disc, since I am the original author of the application. BUT, I need some time to figure out the copy-protection.
|
I seem to have a version without a copy protection, if you want it: vincentd kip.sateh.com. |
|
|
|
|