Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_midi (foobar2000 v2.0) (Read 30745 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Re: foo_midi (foobar2000 v2.0)

Reply #100
Hey, I was wondering if it'd be much of a bother to implement a custom decay time on the never loop option for playback and conversion, instead of the fixed 1 second.
I have several midis that aren't meant to loop or don't end in a fade-out, almost all of which have the track end coincide with the last note played. A single second is never enough decay time for the instruments to fade to silence, it's especially jarring when ending on a cymbal hit on the drum track.

Shouldn't be too difficult. I'll see what I can do.

Re: foo_midi (foobar2000 v2.0)

Reply #101
[long] We have to talk about looping and fading...

Replacing the current fixed 1s decay time with a  configurable option was 30min work but then ~~~testing~~~ started... I dread touching the looping and fading code because, frankly, I don't understand it completely and I don't have enough files to test all the different combinations. It feels over-engineered with a lot of features and options added for 1 niche scenario.

The previous statements in no way diminishes my respect for the work and time kode54 has put into the code in the past but I'd like a clean start.

  • Looping is looping and fading is fading.
  • Respect all loop markers or none
  • Get rid of the distinction between playback and 'other' which only seems useful for rendering to a .wav file
  • Allow adding the settings to a song preset so you can tweak how one particular song is played

Are there any foo_midi users out there who have good arguments for me not to proceed with this? It's going to be a lot of work but it's better than going on like this.

Re: foo_midi (foobar2000 v2.0)

Reply #102
[long] We have to talk about looping and fading...

Replacing the current fixed 1s decay time with a  configurable option was 30min work but then ~~~testing~~~ started... I dread touching the looping and fading code because, frankly, I don't understand it completely and I don't have enough files to test all the different combinations. It feels over-engineered with a lot of features and options added for 1 niche scenario.

The previous statements in no way diminishes my respect for the work and time kode54 has put into the code in the past but I'd like a clean start.

  • Looping is looping and fading is fading.
  • Respect all loop markers or none
  • Get rid of the distinction between playback and 'other' which only seems useful for rendering to a .wav file
  • Allow adding the settings to a song preset so you can tweak how one particular song is played

Are there any foo_midi users out there who have good arguments for me not to proceed with this? It's going to be a lot of work but it's better than going on like this.
ty for your hard work and effort to make the midi component better..
I go plenty of midi files I collected over the years,
mainly from the early 2000s if you want a copy I can share them.. freely available..

Re: foo_midi (foobar2000 v2.0)

Reply #103
[long] We have to talk about looping and fading...

Replacing the current fixed 1s decay time with a  configurable option was 30min work but then ~~~testing~~~ started... I dread touching the looping and fading code because, frankly, I don't understand it completely and I don't have enough files to test all the different combinations. It feels over-engineered with a lot of features and options added for 1 niche scenario.

The previous statements in no way diminishes my respect for the work and time kode54 has put into the code in the past but I'd like a clean start.

  • Looping is looping and fading is fading.
  • Respect all loop markers or none
  • Get rid of the distinction between playback and 'other' which only seems useful for rendering to a .wav file
  • Allow adding the settings to a song preset so you can tweak how one particular song is played

Are there any foo_midi users out there who have good arguments for me not to proceed with this? It's going to be a lot of work but it's better than going on like this.
Hey, thanks for looking into the decay time thing!
If you plan on going through with the reworking of this part of the code, I'm pretty much on board with all the points made. The only thing that comes to mind for being able to pick and choose individual loop modes is that CCs used for looping in one scenario (e.g. CC 111 in RPG Maker) might be used for something else in different MIDIs that don't adhere to those same rules, resulting in potential conflicts or playback inaccuracies. I don't know how likely it would be for something like this to occur, but I still wanna put it in the room just in case.

Re: foo_midi (foobar2000 v2.0)

Reply #104
Hi, bug report, not sure if this is with FluidSynth or the plugin. I noticed that with FluidSynth running, if the sample rate is set to something other than 44100 Hz, the pitch of the audio is affected instead of the quality. You can reproduce this by setting the sample rate to 48000.

Re: foo_midi (foobar2000 v2.0)

Reply #105
Hi, bug report, not sure if this is with FluidSynth or the plugin. I noticed that with FluidSynth running, if the sample rate is set to something other than 44100 Hz, the pitch of the audio is affected instead of the quality. You can reproduce this by setting the sample rate to 48000.
It's a bug. I forgot to pass on the sample rate from the preferences to FluidSynth. Fixed in the next version.

Re: foo_midi (foobar2000 v2.0)

Reply #106
v2.9.1.0-alpha, 2023-09-27, *"Loop de loop"*

* New: You can specify the path of an ADLMIDI bank (*.wopl or any of the other supported formats) in the Advanced branch of the Preferences dialog.
  * The bank in the file overrides any selection in the bank drop down list in Preferences.
  * The file path is not yet saved as part of a preset.
  * Only file paths with Latin-1 characters are supported (limitation of the library).
* Improved: The decay time is now configurable. The default is still 1s (1000ms).
* Improved: Looping, fading and decay has been tweaked.
* Bug Fix: FluidSynth did not respect the preferred sample rate.
* Bug Fix: FluidSynth did not save two settings in a preset.
* Builds with foobar2000 SDK 2023-09-06.

Only available from GitHub for now until it's fully tested and ready.

Re: foo_midi (foobar2000 v2.0)

Reply #107
Bug report. I noticed that songs with a loop start marker, but no loop end are no longer detected as looping files. Here's an example file.

Re: foo_midi (foobar2000 v2.0)

Reply #108
Thanks for the report. I'll look in to it.

Re: foo_midi (foobar2000 v2.0)

Reply #109
The configuration page of the plugin is not fully displayed in the preferences settings. The top of the interface seems to have a few lines left blank, causing the bottom of the interface not to be fully displayed. I'm using the FB2K v2.0 64-bit version.

Re: foo_midi (foobar2000 v2.0)

Reply #110
You're using High DPI settings. The dialog unit calculation by Windows goes wrong. There's nothing I can do about it except cram less settings on 1 page.

Re: foo_midi (foobar2000 v2.0)

Reply #111
2.9.1.0-alpha doesn't handle sub-songs correctly; music ripped by mirsoft from the 1993 CRPG "Dark Sun: Shattered Lands" only plays the first twenty or so seconds of each track, then the foo_midi module assumes that the subsong markers mean it needs to loop back to the start of the sequence now (ignoring the looping settings in the process) so only the first subsong is getting played (which means a bunch of subsongs are not getting played).

Re: foo_midi (foobar2000 v2.0)

Reply #112
Thanks for the report. Could you please send me a link to or a copy of the file? I haven't encountered any MIDI files with subsongs.

Re: foo_midi (foobar2000 v2.0)

Reply #113
PM sent; "Subsong" is probably the wrong way to refer to this but that's what it most resembles; the original game would jump to different pre-defined loop points within the song based on what was happening within the game, but they're all defined within the same midi file for each region in the game.

Re: foo_midi (foobar2000 v2.0)

Reply #114
Got it. I'll have a look at it. I expected some things to break when rewriting the loop code.

Re: foo_midi (foobar2000 v2.0)

Reply #115
I finally found some time to look at this. The behavior seems to work 'as designed' but maybe not as you expect...

Is this something that used to work? I haven't found any 'subsong' handling in MIDI files in the original code but I may be mistaken. Edit: The song is a Format 0 MIDI file. The original code did not detect multiple 'loop' markers for this type.

I'd like to know because if it is new behavior I'd like to release the current version as-is and focus on subsong handling in the next release.

Re: foo_midi (foobar2000 v2.0)

Reply #116
I'm not actually sure how it is "supposed to" work, but what I do know is that if I use winamp's midi input handler with looping disabled, it plays through the whole thing without looping.  if I use the current version of this midi plugin with looping disabled, it still plays the first sixteen seconds for however many loops are set in the preferences and then moves on to the next file.  Effectively it's ignoring the "do not loop and fade" setting.

Re: foo_midi (foobar2000 v2.0)

Reply #117
Effectively it's ignoring the "do not loop and fade" setting.
Gotcha. That sounds like a bug. As a work-around you could disable the detection of EMIDI loop information.

Re: foo_midi (foobar2000 v2.0)

Reply #118
v2.9.1.0-alpha-2, 2023-11-01, "Happy Halloween"

* Improved: The song duration is now always calculated without taking into account the selected loop mode. So it's the absolute length of the song without any looping or decay time.
* Bug Fix: Loop modes should now work as expected again.

Only available from GitHub for now until it's fully tested and ready.

Re: foo_midi (foobar2000 v2.0)

Reply #119
Found a bug. It seems that with the play indefinitely when detected option is used, loops are ignored, even with a loop start and end. This doesn't seem to happen with the play indefinitely option.

Re: foo_midi (foobar2000 v2.0)

Reply #120
Thx. On it.

Re: foo_midi (foobar2000 v2.0)

Reply #121
v2.9.1.3, 2023-11-02, Loop de loop

* New: You can specify the path of an ADLMIDI bank (*.wopl or any of the other supported formats) in the Advanced branch of the Preferences dialog.
* The bank in the file overrides any selection in the bank drop down list in Preferences.
  * The file path is not yet saved as part of a preset.
  * Only file paths with Latin-1 characters are supported (limitation of the library).
* New: Made Opal and Java OPL3 emulator core from LibADLMIDI selectable in the Advanced Preferences.
* Improved: The decay time is now configurable. The default is still 1s (1000ms).
* Improved: Looping, fading and decay has been tweaked.
* Improved: The song duration is now always calculated without taking into account the selected loop mode. So it's the absolute length of the song without any looping or decay time.
* Improved: Made the parsing the MIDI data more robust.
* Improved: LDS file detection is more robust.
* Bug Fix: FluidSynth did not respect the preferred sample rate.
* Bug Fix: FluidSynth did not save two settings in a preset.
* Bug Fix: Invalid embedded karaoke lyrics were not handled correctly.
* Builds with foobar2000 SDK 2023-09-06.

Download from GitHub or the foobar2000 Components Repository.

Automatic update from within foobar2000 still does not work...

Re: foo_midi (foobar2000 v2.0)

Reply #122
Would it be possible to split Fluidsynth/Bass Midi/Munt/ADL/Nuke settings off into their own subpages (like how paths is split off?), as well as to move the OPN bank selection setting from Advanced to an OPN subpage?  Mostly this would benefit ADL since the bank descriptions are longer than the selection box has room for.

Re: foo_midi (foobar2000 v2.0)

Reply #123
Yes, it's on my To Do list, probably for the next release.