Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config for Soundfont, Font and "Focus Lost" #3168

Open
wants to merge 39 commits into
base: master
Choose a base branch
from

Conversation

Ghabry
Copy link
Member

@Ghabry Ghabry commented Dec 4, 2023

Pause when focus lost is now a setting, not a compile time option:

screenshot_0 png

More Audio options

screenshot_2 png

Information about MIDI drivers

screenshot_1 png

The soundfont can be selected

screenshot_3 png

Font configuration with preview:

screenshot_4 png

screenshot_5 png

This function can open folders and websites, useful for the settings
This already contains a few lines of font I couldn't properly split.
Wrote both at the same time...
The Window class was extended to allow setting a font.
@Ghabry Ghabry added this to the 0.8.1 milestone Dec 4, 2023
@fdelapena fdelapena added UX For issues affecting the user experience, such annoyances, counter-intuitive or ugly design Fonts MIDI Settings All about customizable features, storing and applying them labels Dec 5, 2023
src/filefinder.h Outdated
@@ -37,6 +37,14 @@
* insensitive files paths.
*/
namespace FileFinder {
constexpr const auto IMG_TYPES = Utils::MakeSvArray(".bmp", ".png", ".xyz");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: two spaces before ".png"

@Ghabry Ghabry force-pushed the audio-cfg branch 2 times, most recently from 13ec613 to a45bad3 Compare December 5, 2023 22:30
@Mimigris
Copy link

Mimigris commented Dec 6, 2023

I know that it is still WIP but here's what I found in terms of issues while testing:

  • The Pause when focus lost text changed since the picture that you sent and is now too long to properly fit on-screen (a custom font is used here but it's also the case with the default font)
    screenshot_5

  • The MIDI Drivers menu seems to be laggy when selecting an option if no MIDI has been played during the current session and in some other occasions (e.g. game browser menu - the lag also occurs when selecting > Information < even if it doesn't do anything outside of playing a sound)

  • The MIDI Drivers menu falsely report Native MIDI as Not working if attempted to be used in-game (tested with the Windows x64 version - the setting work as intended outside of that, it's just the display in the menu that is incorrect) with a warning too long to be displayed and read
    screenshot_6

  • Unlike changing MIDI Drivers, changing the soundfont on the fly with the setting menu will not change it without reloading the game, which can be annoying to properly test

  • If you want to change the size of the font currently being used, you need to change the size and then reselect the entry, you cannot just change the size to see and apply the changes, which is a bit annoying

  • Since the font change is directly applied once a new character has been rendered, you can change it while displaying a message to have a message with different character sets, as well as having an incorrect spacing being used: it doesn't seem to cause gameplay issues since it only impacts the current message and doesn't change anything in terms of gameplay so I don't think that it's a huge problem
    image

  • In the MIDI Drivers menu, the text at the bottom of the screen will use the font from the last font previewed in the font menu, even if said font was not set
    screenshot_14

  • Exiting a game that uses a custom font will still disallow you to change it even outside of it (in the game browser or in a game that doesn't use a specific font)
    screenshot_221

  • The <Open (Sound)Font directory> should not be present on platforms where it is not possible to open a directory directly (e.g. Wii)

  • On Wii (a platform where Fluidsynth is replaced by FluidLite), the option Fluidsynth is present and doesn't work, meaning that only FMMidi and WildMidi can be used there

  • When Pause when focus lost is disabled, if the window of the game is put in the background, the Mouse Scroll Up/Down keys can still be used if the cursor is over the window of the game and the mouse position is still tracked Won't fix

Now more on a feedback side, feel free to take that into account or not:

  • Disabling all MIDI entries display a "Couldn't play BGM music.mid. Format not supported" warning (that's intended), but if possible, maybe it could be better to specify that no MIDI entry is available instead in said case
  • If I remember correctly, there is a thing on the RPG_RT where the two fonts used are not the same depending on the region/encoding, maybe having something to reverse the fonts used (either as a toggle directly in the menu or automatically depending on the encoding) could be used
  • Having the possibility to maybe add an X number of pixels after a character could be useful for some fonts where all of the letters are sticked together, making them unreadable

Also, the webplayer doesn't seem to like the entries Open Font/Sound directory and seems to randomly crash outside of that, I'm not entirely sure why for the second part.

@Ghabry
Copy link
Member Author

Ghabry commented Dec 6, 2023

Thanks for the exhaustive testing. I won't respond to all but they all sound reasonable.

The Pause when focus lost text changed since the picture that you sent and is now too long to properly fit on-screen (a custom font is used here but it's also the case with the default font)

Hm I already fixed this one locally, maybe forgot to commit it.

But yeah some messages do not fit. I think about implementing a "scrolling" feature that scrolls the text back and forth so the rest is visible.

Unlike changing MIDI Drivers, changing the soundfont on the fly with the setting menu will not change it without reloading the game, which can be annoying to properly test

Yeah I would prefer to have some kind of "hot reloading" here so the audio changes immediately. I just couldn't find a way yet that does not crash xD.

Having the possibility to maybe add an X number of pixels after a character could be useful for some fonts where all of the letters are sticked together, making them unreadable

Good idea. This is already required for StringPic so can be exposed.

Does a program reset, won't work for all MIDI files.
Playing a new file will fix it.
Prevents glitches when switching the font in the settings while rendering
Currently lacking sanity checks
Is the last option, disabling it breaks MIDI entirely
@Ghabry
Copy link
Member Author

Ghabry commented Dec 20, 2023

Instead of "Open (Sound)Font" emscripten got now "Upload (Sound)Font".

Can already see certain game developers demanding that this is patched out but not my problem :P

https://easyrpg.org/play/pr3168

Note that live switching between two MIDI devices (e.g. FmMidi to Fluidsynth) is not supported. Such a change requires playing a new MIDI file.

@Ghabry
Copy link
Member Author

Ghabry commented Apr 17, 2024

@florianessl it is not perfect yet but give it a try:

grafik

EDIT: Offset calculation for the mask is now correct

grafik


But this is now the final final contribution to this PR ;)

@Ghabry
Copy link
Member Author

Ghabry commented Apr 20, 2024

This is now ready in case somebody wants to do final testing.


The font stuff needs some Android Ui support imo but I will do this in another PR together with the LZH archive support. As you know I hate Android dev so I always do everything in one go 😅

@Ghabry
Copy link
Member Author

Ghabry commented May 13, 2024

(Rebased). I give one more week for feedback. Then going to merge this.

@Mimigris
Copy link

Changing the volume of the MIDI currently being played in the settings while having the MIDI output set as FluidSynth or FMmidi will not work entirely, since when reloading the music it seems that the volume set is different (tested with the title screen of Wadanohara and the Great Blue Sea - I suspect that the percentage of the volume is relative compared to the percentage that was set in the options when the music started for those two, = if a music starts while your setting is at 10%, the music almost cannot be heard in the end).

Ghabry added 14 commits May 21, 2024 20:55
Show FluidLite in settings instead of FluidSynth
…hile a font is selected.

Add cursor animation option to Window class.
Solves errors and lag in the audio settings when the device is opened multiple times
The options are now:
- OFF (Do not show)
- ON (in titlebar when windowed, inside when fullscreen)
- Overlay (show always inside the window)

Last option is disabled when fullscreen option is disabled.
The mask looks brighter than in Maniac Patch but at least it does not look corrupted anymore.
…not floats)

Use std::fill now which is not this error prone.

Solves audio glitches ("pop") when having no BGM (or MidiOut) and a sound effect ends.
@Ghabry
Copy link
Member Author

Ghabry commented May 21, 2024

The MIDI volume issue is fixed now. Forgot that the path where I adjusted the volume is used by all MIDI code, not just MidiOut. The volume does still not perfectly match though. Good enough imo.

Also this took me faaaar too long to figure out (2 hours -_-) but I finally solved this "pop" issue you get when only using MIDI out for BGM and a sound effect ends...

@jetrotal
Copy link
Contributor

After reading about the stretch settings in the code, got curious about something:

image

The stretch only works horizontally?
Shouldn't consider the vertical borders of the window as well?

@Ghabry
Copy link
Member Author

Ghabry commented May 22, 2024

This only stretches vertically because it was initially invented for Android. When you stretch in both directions it will look very interesting in Portrait orientation. :)

@Ghabry
Copy link
Member Author

Ghabry commented May 24, 2024

not commited yet as it depends on the other Android PR.

Had to disable the Settings Scene for Fluidsynth Soundfonts and Text Fonts on Android because the normal Player code cannot handle these URI-encoded SAF paths (because they use %2F as delimiter, not / -_-).

But here is the better workaround

grafik

@Ghabry
Copy link
Member Author

Ghabry commented May 27, 2024

Will merge this on Sunday when no further issues arise as this is slowly becoming a blocker for my other PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fonts MIDI Settings All about customizable features, storing and applying them UX For issues affecting the user experience, such annoyances, counter-intuitive or ugly design
Development

Successfully merging this pull request may close these issues.

None yet

6 participants