Updated FAQ regarding Linux setting for fixing latency issue

Fixed FTGL font init code issue when it's disabled.
Minor label change to play stats
This commit is contained in:
Nam Nguyen 2022-10-07 18:43:25 -04:00
parent bdacc85f18
commit db04e29b1e
5 changed files with 48 additions and 4 deletions

View File

@ -34,3 +34,37 @@ timidity -iA -B2,8 -Os -EFreverb=0
## What is the latency fix?
The latency fix is no longer required since Piano Booster on Windows now includes the integrated FluidSynth sound generator which works in real-time and has low latency.
Previously on windows the latency fix was required when using the MS GM Wavetable Synthesizer sound generator which has very high latency.
## Linux latency issue
If you experience latency in Linux, try the following steps, it is very likely to fix the problem:
First, see what is your current latency output, using the following command:
[my console ~]$ pacmd list-sinks | grep 'latency: [1-9]'
You should see something like this:
current latency: 100,86 ms
fixed latency: 100,14 ms
Edit file (using sudo as needed):
/etc/pulse/daemon.conf
Locate the following lines, uncomment as needed, and adjust values as followed:
default-fragments = 2
default-fragment-size-msec = 5
Save the file, and restart pulseaudio using this command:
[my console ~]$ pulseaudio -k
Check your latency again:
[my console ~]$ pacmd list-sinks | grep 'latency: [1-9]'

View File

@ -214,6 +214,8 @@ protected:
eventBits_t m_realTimeEventBits; //used to signal real time events to the caller of task()
CRating m_rating;
void outputSavedNotes();
void resetWantedChord();
@ -264,7 +266,6 @@ private:
return m_followState;
}
CRating m_rating;
CQueue<CMidiEvent>* m_savedNoteQueue;
CQueue<CMidiEvent>* m_savedNoteOffQueue;
CMidiEvent m_nextMidiEvent;

View File

@ -39,6 +39,7 @@ int CDraw::m_forceCompileRedraw;
QColor CDraw::color;
#ifndef NO_USE_FTGL
FTFont * setupFont() {
FTFont * cacheFont = NULL; //TBD should use singleton pattern or wrapper
//if ( cacheFont == NULL ) {
@ -70,6 +71,7 @@ FTFont * setupFont() {
//}
return cacheFont;
}
#endif
CDraw::CDraw(CSettings* settings)
#ifndef NO_USE_FTGL

View File

@ -223,7 +223,7 @@ void CGLView::drawOverallAccurracy() {
int totalPlayed = m_rating->getPlayedNoteTally();
x += 260;
renderText(x, y, 0, tr("Correct:"), m_timeRatingFont);
renderText(x, y, 0, tr("On Key:"), m_timeRatingFont);
drawRatioBar(x + 70, y, 180, (int) totalPlayed - m_rating->getPlayedWrongNoteTally(), totalPlayed,
CColor(0.0, 1.0, 0.0), bgColor,
CColor(1.0 - bgColor.red, 1.0 - bgColor.green, 1.0 - bgColor.blue), true);

View File

@ -202,6 +202,8 @@ void CSong::handleSpecialKey(CMidiEvent inputNote) {
else if ( startStopSet.empty()) {
playMusic(!playingMusic());
songControlListener->playState(playingMusic());
m_rating.addPlayedWrongNoteTally(-this->startStopSet.size());
m_rating.addPlayedNoteTally(-this->startStopSet.size());
}
else if ( speedupSet.empty()) {
//start the speeding up timer
@ -213,11 +215,14 @@ void CSong::handleSpecialKey(CMidiEvent inputNote) {
speedDir = 1;
if (! speedCtrlTime.isActive() ) {
speedCtrlTime.start(500, this);
} else {
//speedDir = 0;
//speedCtrlTime.stop();
}
}
//m_rating.addPlayedWrongNoteTally(-this->speedupSet.size());
m_rating.addPlayedNoteTally(-this->speedupSet.size());
} else if ( speeddownSet.empty()) {
//start the speeding up timer
if ( speedDir == -1 ) {
@ -232,6 +237,8 @@ void CSong::handleSpecialKey(CMidiEvent inputNote) {
//speedCtrlTime.stop();
}
}
//m_rating.addPlayedWrongNoteTally(-this->speeddownSet.size());
m_rating.addPlayedNoteTally(-this->speeddownSet.size());
}
}
}
@ -251,9 +258,9 @@ void CSong::setSongControlListener(SongControlListener * listener) {
void CSong::pianistInput(CMidiEvent inputNote) {
handleSpecialKey(inputNote);
CConductor::pianistInput(inputNote);
handleSpecialKey(inputNote);
}
void CSong::setActiveHand(whichPart_t hand)