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

Audio improvements #2618

Merged
merged 11 commits into from Sep 2, 2021
Merged

Audio improvements #2618

merged 11 commits into from Sep 2, 2021

Conversation

Ghabry
Copy link
Member

@Ghabry Ghabry commented Aug 25, 2021

Fixed Fade In and added GetTicks to DrWav and XMP. Now "Get Midi Ticks" works for all types of audio.


The looping code for ogg/opus is based on the Midi code, including "loops_to_end" to keep the BGM alive etc.
Thanks to the previous research on how to loop in the Midi code this was quite easy to add :)

Not verified what AudioRemony does but this is the most consistent approach.

VX Ace and MV differ in how the tags are used: VX Ace version loops when LOOPLENGTH is reached.
MV uses WebAudio which plays the entire track once and then respects loop start and length.

@Ghabry Ghabry added the Audio label Aug 25, 2021
@Ghabry Ghabry added this to the 0.7.0 milestone Aug 25, 2021
@Ghabry
Copy link
Member Author

Ghabry commented Aug 25, 2021

More tests (have to fix the implementation):

LOOPSTART is 0 when it is not a number (guess they use atoi).

LOOPLENGTH is ignored when it is 0. I would diverge here and accept 0 for "silence looping".

@Ghabry
Copy link
Member Author

Ghabry commented Aug 25, 2021

(do not merge this yet, the volume adjustment stuff still needs testing but I hope this finally fixes it properly...)

@Ghabry
Copy link
Member Author

Ghabry commented Aug 28, 2021

that the fluidsynth system_reset reenables some notes (fades them out) seems to be an expected side-effect and not a bug.

So I removed the call as all_sounds_off and controller reset are enough (hopefully all Midi playing nice :))

@Ghabry
Copy link
Member Author

Ghabry commented Aug 28, 2021

@krmbn0576 can you test FluidSynth with this branch please?

Copy link
Contributor

@krmbn0576 krmbn0576 left a comment

Choose a reason for hiding this comment

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

@Ghabry
I tested this and it sounded beautiful when I changed the MIDI. This seems to have solved all MIDI problems. Thank you very much! 😇

src/audio_decoder.cpp Outdated Show resolved Hide resolved
This uses the VX Ace version which loops when LOOPLENGTH is reached.
MV uses WebAudio which plays the entire track once and then respects loop start and length.
This uses the VX Ace version which loops when LOOPLENGTH is reached.
MV uses WebAudio which plays the entire track once and then respects loop start and length.
…ic, converted in Midi events).

Fade API got the "start" removed, to fade from a certain start position call SetVolume first.

Fix EasyRPG#2587
…et because this reenabled voices, causing glitched audio for a brief moment when switching MIDIs.

Change the SysEx Api from void* to uint8_t* to make the API better to use.

Fix EasyRPG#2620
Also convert datatypes from double to float, is a bit faster and good enough here.
@Ghabry
Copy link
Member Author

Ghabry commented Aug 31, 2021

Now everything should work.
The only kinda-problem I see (or hear xD) is that the BGM volume for Midi is slightly higher when using fluidsynth or FmMidi compared to the synth of the system (for that case it is perfect).
But this is not something I want to solve here, the problem can be anywhere...

@fdelapena
Copy link
Contributor

The only kinda-problem I see (or hear xD) is that the BGM volume for Midi is slightly higher when using fluidsynth or FmMidi compared to the synth of the system (for that case it is perfect).

Because system synth (Microsoft Wavetable GS) seems apparently to run at 22 KHz after doing some hearing tests from here.
A more realistic FluidSynth/fmmidi playback would be by comparing with the same apparent frequency, because high frequency sounds could lie our perception about volume.
If we don't trust our ears, doing a recording from both and comparing peaks should help to take a decision. FluidSynth gain could be adjusted later if needed.

@fdelapena fdelapena merged commit f1d31df into EasyRPG:master Sep 2, 2021
@Ghabry Ghabry deleted the audio branch September 2, 2021 08:02
carstene1ns added a commit to carstene1ns/easyrpg-player that referenced this pull request Sep 11, 2021
needed for `vorbis_comment_query` (since EasyRPG#2618)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants