-
-
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
Import midi file from command line hangs #2562
Comments
@zonkmachine, is the file available anywhere? |
It failed the same way with all files I've got here. |
It actually saves three tracks and there should only have been two. The third track "Mr Joe" is the title and first in the meta data. |
I created a 4 note midi file without any meta data that opens correctly as one track on import from gui but fails the same way on import from the command line. |
I can reproduce this on master. You can import a MIDI file from the command line using the
It seems that this option is currently not documented in the help. The cause of the problem seems to be that the frames per tick are still initialized to zero when the song is played. This leads to problems in int ticks = m_playPos[m_playMode].getTicks() +
( int )( currentFrame / framesPerTick ); This expression leads to a division by zero because The initialization of the frames per tick is done in the method Another thing that I have noticed is that the imported MIDI blocks are only rendered in the Song Editor after you have changed its size. So all in all there are three things that need to be fixed:
|
@michaelgregorius The number 1 will be fixed via #2425 (some other options were missing in lmms --help). The PR is almost ready, I am testing command-line options right now. |
I've updated the original post with link to file and the command used.
Thank you! That was crucial information and related to #2424 |
Fixed by midi-pascal
@michaelgregorius Among the last things in MainWindow.cpp constructor after starting the timers. Tried it, works. Do you want me to fix that or are you working on this?
This should have been fixed by #2555
Some epic trouble shooting there! |
I went ahead and created a PR. I think that fixes it. |
@zonkmachine I had no fix ready anyway, so going ahead was the best thing to do. :) Regarding the check for 0, I think it would be better to just make sure that the variable |
Thanks! I bumped the PR with an assert for famesPerTick to be over 0. It's only turned on for debug builds. I think that should be enough for now. Now I need to check up on the work to switch to drumstick for MIDI import/export #3224 . |
Actually the imported files set 140 bpm though there is tempo defined. The test project above is 160 bpm. I should call |
I have tried with my branch. Import looks okay, but still hang PS: I have not merged your code... |
Trying it out now with
Don't. It's not my fines hour in coding. Yet... ;) |
I closed #3287 for now as that fix isn't satisfying enough and there is good work done on the drumstick branch. |
I had another go at fixing this in #3409 . @tonychee7000 I haven't tested it with drumstick yet. Currently the project tempo isn't updated until you press play. This is true both for projects imported via the command line and the gui. I haven't looked at programming for MIDI under an OS, only for embedded devices, but as I remember it the tempo is sent as actual ticks and not as tempo change messages. Maybe you can take the first of the tempo automation points and assign it to the project tempo? |
Right, no. The file I fixed up is deleted in the drumstick branch. |
I hadn't realized these things at that time, and just started my branch. |
When I try an import a midi file from the command line it will fail and open an empty project that will hang and if I press play will show time signatures as the top picture. When I force quit however the recovery file will be a correctly imported file ( bottom picture ). The same file will import just fine from the gui.
Example file: mrjoe_m.mid.zip
./lmms --import mrjoe_m.mid
The text was updated successfully, but these errors were encountered: