Musical Instrument Minecraft Interface (MIMI)

Musical Instrument Minecraft Interface (MIMI)

779k Downloads

[BUG] Note does not play until roughly 6 seconds after I press the button

Collcroc123 opened this issue ยท 2 comments

commented

Any and all instruments in the mod have a delay of about 5 1/2 to 6 seconds from button press to the note playing.

Steps to reproduce the behavior:

  1. Install mod in modpack
  2. Create world
  3. Play any instrument

Expected notes to play very close to when I press the button, at least within a 1/2 or 1/4 second or so.

  • OS: Windows 10
  • Mod Version: 1.0.3
  • Minecraft Version: 1.16.5
  • Forge Version: 36.2.2
commented

Hello, thanks for the bug report!

Sounds in MIMI are generated by Gervill which is the MIDI Synthesizer that ships with Java and its performance is pretty dependent on your system. Within the context of Minecraft we don't get a lot of control over Gervill but there are a few settings that we have access to which can be tweaked in the MIMI config file (<Minecraft Directory>/config/mimi-client.toml) under the "MIDI Synth" category so you might be able to improve your latency by tweaking those. You should be able to change the config file while the game is running and when you save the file the changes should be applied immediately without needing to restart your game.

Some settings to look at:

synthBaselineLatency : This is the base latency of the Gervill synthesizer in milliseconds and it is used to allow the synthesizer to buffer notes before playing them. The default value is 250ms so changing that to something smaller should make a difference, but note that as the value approaches the minimum (10ms) the buffer length of Gervill decreases so you may notice stuttering in the sound.

synthBitRate: This is the data rate that should be used to generate the sound from the synthesizer. Higher values produce higher quality sound at the cost of more required processing power and possible latency, while lower values should require less processing power and have lower latency but may not sound quite as nice. I'd try lowering this to 8.

synthSampleRate: This is similar to the above and relates to how much processing power is spent generating higher quality sounds for each note. Higher values result in a higher quality sound, while lower values are a lower quality sound.

synthJitterCorrection : This is a feature of Gervill that makes note timing for accurate for MIDI files. It makes small adjustments to the time that the note is played based on your system time to reduce jitter (notes being off by a few milliseconds because of network latency and other factors). This feature does require a fair amount of processing power and does add a fair amount of latency as well so I'd recommend trying to disable this. Just note that if it is disabled you may notice some small timing errors with notes played from a MIDI file (hopefully nothing too noticeable though).

Let me know if tweaking any of those settings helps things! I don't have a lot of different hardware to test the mod out on so it's definitely very helpful to hear about issues like this that I can't recreate myself and I really appreciate the report!

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.