tip: DON'T use the standard envelope things.. they suck. period.tip: DO use the standard envelope things.. they allow you to change the waveform of the PSG from square wave to sawtooth or other kinds.
I disagree, using the envelope functions on PSG (having bit 4 on the volume channels set will enable you to use 16 envs. at b0-b3) Note that the envelopes are NOTHING MORE than just Volume shapes!! (square and sawtooth in Amplitude, not in color or frq) And the volume shapes are preset, from MAX volume to whatever volume the shape goes (absolute volume). In other words; you can't control the volume of these waves. thaz why they suck for one.
You can disagree all you want, but it still won't change reality: using the standard envelopes you CAN change the COLOR of the sound!
You can't reproduce this effect using the normal volume controls, as the envelopes can have frequencies up to 64kHz. It would mean your music player should be called 1000 times the VDP interrupt frequency! (There's no way the Z80 can pull that off and do anything useful at the same time)
For proof: several MSX games (among which Matra products) use a sawtooth sound in PSG. It's also VERY easy to realize some effects in BASIC (as I said earlier) with the PLAY command.
I'm willing to bet that triangle waves or maybe even sine waves (would be tough) can be achieved.
BTW, your comments about the volume being fixed are correct, but any waveform other than square waves is inherently lower in volume, so it won't drown out the other channels.
everybody switch on the msx, and type this stuff here:
1 play"m5s14L1o4f"
instant coolness
-----------
for the interested ppl, this is amplitude modulation... same stuff you can find in prof synths yesteryear and today. As you prolly found out, each note requires a different M number .. hence the bitchy editing
Why &^%#$ didn't anyone ever make a PSG-tracker for this stuff?
Why &^%#$ didn't anyone ever make a PSG-tracker for this stuff?
You could also say "Why &^%#$ didn't Fuzzy Logic's SEE support this stuff?", but reading ro's posts I guess we know the answer
The main problem when using hardware envelope functions is that they are syncronized with the internal clock, not with the v-blank (as it is usually done in replayers).
If it sounds fine at 50 Hz, probably it will sound a bit weird in 60 Hz, and viceversa.
That's why I calculate everything for 50hz. Then, the first thing I do in my programs is setting any MSX2, MSX2+ or Turbo-r at 50hz. Anyway, it's a question of setting some parameters in my replayer. There's no problem in playing songs at 50hz or 60hz, though it's necessary to set the proper values for envelopes in both cases.
Do you have any plans to make your player public? Or your calculation methods?
Running at 50Hz actually has some more advantages, like increased vblank time, increased number of CPU cycles per interrupt and increased VDP command performance.
Too bad the downside is flickering screen, although you only notice it after you saw 60Hz for a while
Do you have any plans to make your player public? Or your calculation methods?
Sorry, GuyveR800, not for the moment. I'm still working on the player. I'm going to rewrite it, from zero. I added use of relative/absolute values, volume fade in/out, slide effects of frequency, notes, envelopes, ... but the size is still very big; about 6k the player. And from time to time I realize there are some ways to improve it, make the size of the songs drastically smaller, etc ...
Running at 50Hz actually has some more advantages, like increased vblank time, increased number of CPU cycles per interrupt and increased VDP command performance.
Yes, very true. It's much better for me, though the height of the screen at 50hz is smaller (uglier?).
I'm currently looking into the nsf (Nintendoos Sound File) files for some compatibality with the PSG. See if I can come up with a replayer for the 3 channel tunes
3? The Nintendo has got 5 built-in channels: 2 pulse ones, 1 triangle, 1 noise and 1 sample channel.
Still, you could just pretend that the triangle channel is a square one (or, if you're smarter, fake it on the PSG), and play samples on the keyclick (or do away with entirely, no big loss usually).
As for the NSF format, I think that it's very unfit for the MSX, considering that it's works using ripped replay routines, meaning you have to code a 6502 emulator for your poor little MSX.
Consider instead using the SND format, dumped from iNES and other emulators. This has worked on the C64, which has got a working NES sound player.
yeah, a replayer USING NSF music data (just ignoring the replayer code itself)
I know about the 5 channels, don't worry
As for the NSF format, I think that it's very unfit for the MSX, considering that it's works using ripped replay routines, meaning you have to code a 6502 emulator for your poor little MSX.
Actually I did that already
I have to find time to test it and add some extra code. I could write a NSF format player, but really, isn't playing the games much more interesting?
Emulation on our poor little MSX is already being done in NYYRIKKI's KSS player, which emulates a Z80 on the MSX's Z80, similar to NSF.
You might also want to check out GEM, my own Gameboy Emulator for MSX.