-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Solves issue #2028 (Slow MIDI import due to repeated message) #2033
Conversation
AutomationPattern::addObject now returns a boolean which indicates whether the object was added or not. This change enables the removal of the error message that is shown in the case that a model is already connected from AutomationPattern::addObject. Instead all interactive callers now check for the return value and show the message in case it is needed. This change set improves the import of MIDI files significantly. These have been slowed down quite a lot due to the message being shown repeatedly during the MIDI import.
Thanks. If we can get a someone to test, we can merge. Note also your formatting is a bit off in terms of tab spacing. Please correct this with and additional commit (or amending the existing commit) prior to the merge. |
The code looks ok to me, once the formatting is corrected. I have never imported midi files into lmms, so this could be better tested by others, as I have no experience of the expected behaviour. iirc @softrabbit has experience in this field. |
@tresf @curlymorphic Thanks for the quick review! I have just corrected the tab spacing. |
Thanks! The lines under TextFloat still look like something is wrong. Can you take a look? |
The wrong settings concerning tabs in QtCreator lead to bad display of the code in other editors.
Yet another correction of the tabs. 😄 I had the tabs set to four spaces instead of eight in the settings of QtCreator. It seems that the WIKI only states that tabs should be used instead of spaces but not how many spaces should be used to display them. So you might want to add this information. Thanks! |
I'm confused... isn't this a user preference? |
Yes. This is just how it is displayed in QtCreator. It would appear spaces have been changed to tabs. In QtCreator, tools > options > text editor > display There is an option "visualize whitespace" that I find invaluable for this as it clearly shows whats a tab or a space. |
Dave, what do we need to add to our tutorial then? Is it specific to QtCreator users mainly? Is is something non-obvious that we need to place in a wiki? I ask because currently I use |
@tresf many editors will respect settings contained in a ".giteditor" file
|
QtCreator can be a bit aggressive with formatting. There are two important options that need to be correct, The red arrows below show my settings for these, the first are in the Text Editor Options The Tab policy also has to be set in the c++ settings There is also an option to display symbols for white space, a faded dot for space, and an arrow for tabs |
Thanks a bunch Dave. I've placed a link to your comment in this PR in the wiki for now. Hopefully this helps others down the road. |
Solves issue #2028 (Slow MIDI import due to repeated message)
Does this fix the problem with hanging and in-responsiveness at 66% import done. |
@musikBear When I load the file jin-stage.mid in master the progress bar stops at 66% for a while but then it eventually loads. However, trying to play the song unfortunately leads to a crash in the SoundFont2 player code: void sf2Instrument::noteOff( SF2PluginData * n )
{
n->noteOffSent = true;
m_notesRunningMutex.lock();
const int notes = --m_notesRunning[n->midiNote];
m_notesRunningMutex.unlock();
if( notes <= 0 )
{
m_synthMutex.lock();
fluid_synth_noteoff( m_synth, m_channel, n->midiNote );
m_synthMutex.unlock();
}
} The crash occurs on the line |
Believed that the 'under'-short note-length was addressed in this summery-fix |
@musikBear I imported the midi file with the Master branch Lmms under Ubuntu 12.04 on a Pentium4 box.
|
@midi-pascal |
@musikBear I remember I encountered this crash when playing imported midi files sometimes ago in master branch but it stopped occurring for months now so I think an other fix did the job - at least under linux - |
@midi-pascal Sounds good 👍 , we need some windows confirming before the issue is done, but so far no binaries of 1.2 |
@musikBear are you on 32 or 64 bit windows? I could make some binaries for testing later today |
@Umcaruje |
@Umcaruje Thanks! -i will also test the VST-plugin Blue-Cat hang and loss of settings |
AutomationPattern::addObject now returns a boolean which indicates
whether the object was added or not. This change enables the removal of
the error message that is shown in the case that a model is already
connected from AutomationPattern::addObject. Instead all interactive
callers now check for the return value and show the message in case it
is needed.
This change set improves the import of MIDI files significantly. These
have been slowed down quite a lot due to the message being shown
repeatedly during the MIDI import.