You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've written my own midi player called Midiplay and am currently using Nuked for synthesizing the output.
Each time I change midi tracks, I call OPL3_Reset, but it can (but not always) cause a Seg Fault.
The solution was to call OPL3_Reset only once during Midiplay's initialisation. Then, during track initialisation:
opl3_chip oplChip;
int i;
for (i = 0; i < 18; i++)
{
oplChip.channel[i].cha = 0;
oplChip.channel[i].chb = 0;
}
oplChip.writebuf_samplecnt = 0;
oplChip.writebuf_cur = 0;
oplChip.writebuf_last = 0;
oplChip.writebuf_lasttime = 0;
for (i = 0; i < OPL_WRITEBUF_SIZE; i++)
{
oplChip.writebuf[i].reg = 0;
}
Perhaps it would be advantageous to have an OPL3_Init function. Then OPL3_Reset could just do the minimal stuff.
Notice that I've initialised left & right channels to zero to silence them.
The text was updated successfully, but these errors were encountered:
I've written my own midi player called Midiplay and am currently using Nuked for synthesizing the output.
Each time I change midi tracks, I call
OPL3_Reset,
but it can (but not always) cause a Seg Fault.The solution was to call
OPL3_Reset
only once during Midiplay's initialisation. Then, during track initialisation:Perhaps it would be advantageous to have an
OPL3_Init
function. ThenOPL3_Reset
could just do the minimal stuff.Notice that I've initialised left & right channels to zero to silence them.
The text was updated successfully, but these errors were encountered: