This is a first attempt using 9 channels on OPLL chip
OPLL player
Thanks to wouter for his support.
The source code is here
Need Improvements but this first step seems promising. Please, continue!
I had some improvements, but not as much as I would have expected.
The main result is that now the channels with minimum volume are muted.
Here the new OPLL encoder and player
Ok the volume formula was wrong.
I fixed it and now I think the result is by far more acceptable (I think it sounds very well)
New files here
@wouter
The new OPLL encoder now has correct volumes and voice now sounds much better.
Never the less, looking at the sound wave in time we see something unexpected.
It seems like that the produced signal is modulated by a tone at 500Hz of frequency: one can see clearly a zero crossing each 0,002 seconds.
I'm using your settings as I'm not able to fiddle with OPLL registers.
Could it be due to the way the instrument is set ? And in case, can it be fixed somehow?
mod={AM=0 PM=0 EG=0 KR=0 ML=01 KL=0 TL=63 WF=0 FB=0 AR=15 DR=15 SL=15 RR=15}
car={AM=0 PM=0 EG=1 KR=0 ML=01 KL=0 WF=0 AR=15 DR=00 SL=00 RR=15}
Registers R#00-R#07 = { 01 21 3F 00 FF F0 FF 0F }
Where do you see this (amplitude?) modulation at 500Hz? I tried your rom in openMSX, recorded the audio, plotted the spectogram. And I clearly see the 8, sometimes 9 dominant frequencies, but nothing at 500Hz. Also not in the full frequency spectrum.
I also verified these register settings on a real OPLL chip. When I sample the OPLL output I get a fairly clean sine wave. Nothing that can explain AM @ 500Hz.
Just checked your opll.asm source code. The problem might be that you're writing the OPLL registers too fast. There should be at least 84 cycles (@3.57MHz) between 2 writes to IO port 0x7D (and 12 cycles between 2 writes to 0x7C). If I counted correctly your code should be fine in Z80 mode, but in R800 mode I think you're too fast.
OpenMSX doesn't emulate this too fast access yet.
OpenMSX doesn't emulate this too fast access yet.
I would welcome this addition, it would make my task of converting Aleste 2 to R800 much easier. No need to track all accesses to the fm i/o ports, just connect to a callback that triggers when the access is too fast.
Hmm...Sorry it was a false alarm.
We cannot reproduce the picture you see, it has been generated using bluemsx, but now when using open msx anything seems normal
Anyway I'm pretty happy of the result for opll
Don't you think it works fine?