libOPNMIDI icon indicating copy to clipboard operation
libOPNMIDI copied to clipboard

Unknown junk notes on a specific song

Open freq-mod opened this issue 5 years ago • 11 comments

Similar to #84, I guess... During playback of a certain .mid, junk note (or notes, depending on chip count or emulator used) can be heard. I can't track where do they come from, in case of MAME 2608 or NP2 core they sustain to the end of a song, in case of Nuked 2612, with 3 FM cores, they terminate after ~15 seconds, starting at a different point of a song. Tested with command-line midiplay.

crap.zip - .zip with recordings of different behaviours, song in question and my bank. I can't reproduce it with xg.wopn, maybe due to lack of GS instruments this song relies on?

freq-mod avatar Jun 07 '19 10:06 freq-mod

I took a look at this song and my bank - the song uses instrument "Steel Guitar 2" (GS bank 32, patch 25), which I have in my bank. When muting this instrument, it falls back to standard GM "Steel Guitar" and the crap sounds are gone. However, steel guitar patch I have should not really cause any problem - I even took xg.wopn, added GS bank 32, dropped the instrument in question and still there were no junk sounds! So, something else must be wrong. stguitar.opni.zip - instrument in question

freq-mod avatar Jun 07 '19 19:06 freq-mod

It's reproducible easily in adlmidiplay, in realtime MIDI I couldn't do it. It's not a very simple one to track, I'm going to give it a more detailed look.

jpcima avatar Jun 08 '19 16:06 jpcima

I still don't exactly know but I found things.

  • I can reduce the file to a smaller case, which doesn't have the Steel Guitar 2 but still produces the problem
  • When I do not handle the sysex messages, even having GS mode forced on, the file plays correctly
  • In the small case, file provided, problem can go away when you delete one among several tracks, not necessarily one track in particular

n_toh03_lite_2.mid.gz

jpcima avatar Jun 12 '19 12:06 jpcima

I see. It's really weird now, it would be great to get to know what happens at ~29 seconds mark of that song, when crap noises kick in. Maybe it's some weird NRPNs?

freq-mod avatar Jun 12 '19 13:06 freq-mod

It's not NRPN. It has possibly to do with the 12th track "Standerd SET". The track is switched to percussion by the GS Roland Percussion Channel sysex at the start. Under the percussion mode, it seems this track is responsible for creating the noise.

jpcima avatar Jun 13 '19 11:06 jpcima

(no it's not a sequencer error)

jpcima avatar Jun 13 '19 12:06 jpcima

On my side, I kinda managed to fix this problem in a weird way: This song used "Sticks" percussion instrument, which ,on my bank, had operators 3 and 4 zeroed out (only release values for both operators were=15, so this instrument was essentially 2-op), after I duplicated values from OP2 into them, junk notes are no longer heard.

Yet, I don't have any idea why muting "Steel Guitar 2" caused "Sticks" to calm down...

freq-mod avatar Jun 13 '19 14:06 freq-mod

Trace of register commands on a reduced example.

debug.txt.gz n_toh03_lite_3.mid.gz

The releasing of channel 11 is suspect. The note-off, whether it's note-extended or isn't, is not writing anything to chip.

-> NoteOff Channel=10 Note=31 effective now -> NoteOff Channel=10 Note=37 effective now

jpcima avatar Jun 13 '19 15:06 jpcima

Ok this is current status. The test case is as reduced as I can make it. There are register dumps with text. tinycrap.tar.gz

It's 2 notes in succession, the pad and then the sticks percussion. The both of them play on the chip channel 0.

Strange thing: It's notable that the pitch of the drum is following the 1st note. I can't explain the reason, hear it in opnmidiplay. The case "High.mid" is based on original, "Low.mid" is octaves lower.

You will first hear a pad as normal, and then the percussion is followed by sustaining noise. (note: the drum channel has sustain pedal on, when sustain pedal off this noise doesn't happen)

The register dumps don't give me a clue on what is happening in this case; none of the setup, or tuning of drum note has been affected, only affected is the first. @Wohlstand do you understand a thing of this?

jpcima avatar Jun 14 '19 02:06 jpcima

The note-off, whether it's note-extended or isn't, is not writing anything to chip. It's notable that the pitch of the drum is following the 1st note. none of the setup, or tuning of drum note has been affected, only affected is the first.

@Wohlstand please ping if it's possible, these behaviours look very weird 🤔

freq-mod avatar Jul 03 '19 16:07 freq-mod

In the past was a glitch that caused junk sound to appear because of silent drum voices was called and there are written into registers something to shut up the voice, but in fact, makes a glitch in some cases when something tries to deal with that channel. That may happen when actually silent instrument wasn't marked as silent and was written into registers.

Wohlstand avatar Jul 03 '19 22:07 Wohlstand