Jump to content

Exported MIDI file adds silence at the end


Lippeth
 Share

Recommended Posts

I've been composing the soundtrack for a game modding community project. Each song is designed to loop endlessly during gameplay. When loading the exported .mid file into something like VLC, the length is over an hour long, despite the composition being under four minutes. When opening with Windows Media Player, the length is correct. When loaded into the game, the .mid file loops back to the beginning as intended when playing back the MIDI info with a Roland Sound Canvas running from the MIDI out port of my interface, but when using soundfonts or OPL emulations, the full hour of silence is present after the song plays, which is not the intention.

 

I'm exporting as a type 1 MIDI file, with each track separated by channel and consolidated to a region.

Each region starts with a program change event at bar 1, beat 1 to play the right instrument, followed by things like volume, pan and reverb, then all the notes and automation.

 

Is there an event list controller that I'm missing? No other .mid file I load into Logic seems to have any indicator in the event list, yet they all display the correct length in VLC and loop in game as expected no matter the method of playback.

I've set the project start and end time, hoping that the MIDI regions will magically somehow know, and I've even deleted the click track through the environment window, thinking that it might interfere with the length of the project.

Also, how is the tempo even stored in a .mid file? They seem to playback at the right tempo with no apparent instruction.

 

Maybe it's a SysEx thing? I've read that in hexadecimal code F0 and F7 indicate the beginning and ending of something, but I'm not sure if that's even the same thing at all.

 

I've scoured the far reaches of the web, and though I've learned a lot of useful information, I'm still searching for a solution.

Edited by Lippeth
Link to comment
Share on other sites

  • 5 months later...
So with the newest update, the dead air at the end of exported midi files has been reduced to about 20 seconds. While it's a step in the right direction, it's not quite the result I'm looking for. I've talked to support twice about this issue, and they tell me it must be a third party issue because I'm doing everything right, but am getting an unwanted result. I can't be the only one having this issue. Is this a bug or is it trying to add a tail after the region ends when exporting? My only workaround has been importing the file into Pro Tools and exporting, everything works as intended, but it's such a headache switching DAWs.
Link to comment
Share on other sites

To better clarify my issue here are the steps I take:

 

-Create a new session and start with an instrument track

-Open Midi Environment Window and create a new multi-instrument, open all 16 channels and route it to the instrument track, removing its existing channel port settings (which I am unsure exactly what this entails)

-Create 16 new External MIDI tracks, set MIDI destination to off and check ascending, and leave Use External Instrument plug-in off

-Add and set up plugin on the instrument track (either DLSMusicDevice in stereo, or Roland Sound Canvas VA)

-Create song, making sure that all program changes and notes are listed in the Event List for each track

-Join regions so that each track is comprised of one region that is no longer than the last note

-Normalize region parameters for each track, making sure everything's going through the right channel

-Select all regions and export selection as MIDI file

 

-Check MIDI file in VLC, and notice that it's way longer than the song itself, with 20 seconds to an hour of dead silence, and if scrubbed to the silent part, will jump back to the beginning of the song

-Import into Pro Tools and export as MIDI file

-Check the new MIDI file in VLC, and the song is the expected length, ending at the very last note, so the file is able to loop in game engines.

 

Is there any way to make sure that the MIDI file ends at the last note when exporting from Logic?

 

Side note: If I open the MIDI file in another editor, it lists the hardware input and output for every track. Is this necessary or is there a way to omit this from the Event List? Also, is there a way to include the tempo information when importing a MIDI file? Logic is the only software I've used where I'm unsure how to do this, it's automatic in other software.

Link to comment
Share on other sites

To better clarify my issue here are the steps I take:

 

-Create a new session and start with an instrument track

-Open Midi Environment Window and create a new multi-instrument, open all 16 channels and route it to the instrument track, removing its existing channel port settings (which I am unsure exactly what this entails)

-Create 16 new External MIDI tracks, set MIDI destination to off and check ascending, and leave Use External Instrument plug-in off

-Add and set up plugin on the instrument track (either DLSMusicDevice in stereo, or Roland Sound Canvas VA)

-Create song, making sure that all program changes and notes are listed in the Event List for each track

-Join regions so that each track is comprised of one region that is no longer than the last note

-Normalize region parameters for each track, making sure everything's going through the right channel

-Select all regions and export selection as MIDI file

 

-Check MIDI file in VLC, and notice that it's way longer than the song itself, with 20 seconds to an hour of dead silence, and if scrubbed to the silent part, will jump back to the beginning of the song

-Import into Pro Tools and export as MIDI file

-Check the new MIDI file in VLC, and the song is the expected length, ending at the very last note, so the file is able to loop in game engines.

 

Is there any way to make sure that the MIDI file ends at the last note when exporting from Logic?

 

Side note: If I open the MIDI file in another editor, it lists the hardware input and output for every track. Is this necessary or is there a way to omit this from the Event List? Also, is there a way to include the tempo information when importing a MIDI file? Logic is the only software I've used where I'm unsure how to do this, it's automatic in other software.

Link to comment
Share on other sites

I've been composing the soundtrack for a game modding community project. Each song is designed to loop endlessly during gameplay. When loading the exported .mid file into something like VLC, the length is over an hour long, despite the composition being under four minutes. When opening with Windows Media Player, the length is correct. When loaded into the game, the .mid file loops back to the beginning as intended when playing back the MIDI info with a Roland Sound Canvas running from the MIDI out port of my interface, but when using soundfonts or OPL emulations, the full hour of silence is present after the song plays, which is not the intention.

 

I'm exporting as a type 1 MIDI file, with each track separated by channel and consolidated to a region.

Each region starts with a program change event at bar 1, beat 1 to play the right instrument, followed by things like volume, pan and reverb, then all the notes and automation.

 

Is there an event list controller that I'm missing? No other .mid file I load into Logic seems to have any indicator in the event list, yet they all display the correct length in VLC and loop in game as expected no matter the method of playback.

I've set the project start and end time, hoping that the MIDI regions will magically somehow know, and I've even deleted the click track through the environment window, thinking that it might interfere with the length of the project.

Also, how is the tempo even stored in a .mid file? They seem to playback at the right tempo with no apparent instruction.

 

Maybe it's a SysEx thing? I've read that in hexadecimal code F0 and F7 indicate the beginning and ending of something, but I'm not sure if that's even the same thing at all.

 

I've scoured the far reaches of the web, and though I've learned a lot of useful information, I'm still searching for a solution.

Can you post that MIDI file.

I'd like to examine it with a program I wrote using CoreMIDI, not a 3rd party MIDI library but CoreMIDI.

[attachment=0]MidiInfo.png[/attachment]

MacBook Pro 10.8.5 2.2 GHz Intel Core 2 Duo 6GB Ram - Logic Pro X (10.2) - MacMini 10.13.6 2GHz Intel Core i7 16GB Ram - GarageBand 10.4.5 Logic Pro X (10.4.8) - iPad Mini iOS 12 - iOS GarageBand 2.0.1 - Qosimo X70-A 10.13.6 Intel® Core™ i7-4700MQ Processor 32GB DDR3L 1600MHz memory, 2-500GB 7200rpm hard drives - Logic Pro X (10.4.8) - MacMini M1 11.6.1 Apple M1 16GB Ram 1TB SSD Logic Pro X (10.7.1) Rosetta 2 not installed

Link to comment
Share on other sites

I've been composing the soundtrack for a game modding community project. Each song is designed to loop endlessly during gameplay. When loading the exported .mid file into something like VLC, the length is over an hour long, despite the composition being under four minutes. When opening with Windows Media Player, the length is correct. When loaded into the game, the .mid file loops back to the beginning as intended when playing back the MIDI info with a Roland Sound Canvas running from the MIDI out port of my interface, but when using soundfonts or OPL emulations, the full hour of silence is present after the song plays, which is not the intention.

 

I'm exporting as a type 1 MIDI file, with each track separated by channel and consolidated to a region.

Each region starts with a program change event at bar 1, beat 1 to play the right instrument, followed by things like volume, pan and reverb, then all the notes and automation.

 

Is there an event list controller that I'm missing? No other .mid file I load into Logic seems to have any indicator in the event list, yet they all display the correct length in VLC and loop in game as expected no matter the method of playback.

I've set the project start and end time, hoping that the MIDI regions will magically somehow know, and I've even deleted the click track through the environment window, thinking that it might interfere with the length of the project.

Also, how is the tempo even stored in a .mid file? They seem to playback at the right tempo with no apparent instruction.

 

Maybe it's a SysEx thing? I've read that in hexadecimal code F0 and F7 indicate the beginning and ending of something, but I'm not sure if that's even the same thing at all.

 

I've scoured the far reaches of the web, and though I've learned a lot of useful information, I'm still searching for a solution.

Can you post that MIDI file.

I'd like to examine it with a program I wrote using CoreMIDI, not a 3rd party MIDI library but CoreMIDI.

MidiInfo.thumb.png.3a564b2946e4c9dbcb49b2a590aa86e7.png

MacBook Pro 10.8.5 2.2 GHz Intel Core 2 Duo 6GB Ram - Logic Pro X (10.2) - MacMini 10.13.6 2GHz Intel Core i7 16GB Ram - GarageBand 10.4.5 Logic Pro X (10.4.8) - iPad Mini iOS 12 - iOS GarageBand 2.0.1 - Qosimo X70-A 10.13.6 Intel® Core™ i7-4700MQ Processor 32GB DDR3L 1600MHz memory, 2-500GB 7200rpm hard drives - Logic Pro X (10.4.8) - MacMini M1 11.6.1 Apple M1 16GB Ram 1TB SSD Logic Pro X (10.7.1) Rosetta 2 not installed

Link to comment
Share on other sites

Sure! It's not song specific either, but here's one example.

I loaded this midi file in VLC (Mac), Logic Pro X, Quick Time Pro 7 and all show it as 4:03 seconds long.

The one thing I was going to look for is a stray CC message that would create that silence, but since all three of the above programs show the same time, I wouldn't see that in my program. My program shows the raw data (as you see in the pic), no calculated data.

 

Which version of VLC are you using, OS and Version number.

MacBook Pro 10.8.5 2.2 GHz Intel Core 2 Duo 6GB Ram - Logic Pro X (10.2) - MacMini 10.13.6 2GHz Intel Core i7 16GB Ram - GarageBand 10.4.5 Logic Pro X (10.4.8) - iPad Mini iOS 12 - iOS GarageBand 2.0.1 - Qosimo X70-A 10.13.6 Intel® Core™ i7-4700MQ Processor 32GB DDR3L 1600MHz memory, 2-500GB 7200rpm hard drives - Logic Pro X (10.4.8) - MacMini M1 11.6.1 Apple M1 16GB Ram 1TB SSD Logic Pro X (10.7.1) Rosetta 2 not installed

Link to comment
Share on other sites

Sure! It's not song specific either, but here's one example.

I loaded this midi file in VLC (Mac), Logic Pro X, Quick Time Pro 7 and all show it as 4:03 seconds long.

The one thing I was going to look for is a stray CC message that would create that silence, but since all three of the above programs show the same time, I wouldn't see that in my program. My program shows the raw data (as you see in the pic), no calculated data.

 

Which version of VLC are you using, OS and Version number.

MacBook Pro 10.8.5 2.2 GHz Intel Core 2 Duo 6GB Ram - Logic Pro X (10.2) - MacMini 10.13.6 2GHz Intel Core i7 16GB Ram - GarageBand 10.4.5 Logic Pro X (10.4.8) - iPad Mini iOS 12 - iOS GarageBand 2.0.1 - Qosimo X70-A 10.13.6 Intel® Core™ i7-4700MQ Processor 32GB DDR3L 1600MHz memory, 2-500GB 7200rpm hard drives - Logic Pro X (10.4.8) - MacMini M1 11.6.1 Apple M1 16GB Ram 1TB SSD Logic Pro X (10.7.1) Rosetta 2 not installed

Link to comment
Share on other sites

Thanks for checking it out!

 

I've been using version 3.0.8 Vetinari of VLC. I just updated to 3.0.11, and am getting a length of 4:30, which is better than 5:36, but there's still silence. OS is Catalina 10.15.5, but I started noticing the problem with Mojave. Logic version 10.5.1

 

Honestly I haven't done MIDI music since Snow Leopard and Logic Pro 9. And VLC isn't really my end goal either. In Windows Media Player, the MIDI file loops just fine and is the correct length, but any game engine that it plays in includes the exact amount of silence that VLC detects. If I import the file into another program and export that, the issue is completely gone, which makes me believe that the problem starts in Logic, whether it's a preference or something I'm doing.

 

EDIT: I just did a test and created a region exactly 30 seconds long with a note that extends the entire length, and after exporting, VLC reads it as 4:36. I did the same thing in Pro Tools and VLC reads it as 0:30. Not that it proves anything new, but I thought I'd share.

 

EDIT: I've also reset all Logic preferences and did the test again, and the time is reduced to 0:46, both in simple and advanced mode.

Link to comment
Share on other sites

Thanks for checking it out!

 

I've been using version 3.0.8 Vetinari of VLC. I just updated to 3.0.11, and am getting a length of 4:30, which is better than 5:36, but there's still silence. OS is Catalina 10.15.5, but I started noticing the problem with Mojave. Logic version 10.5.1

 

Honestly I haven't done MIDI music since Snow Leopard and Logic Pro 9. And VLC isn't really my end goal either. In Windows Media Player, the MIDI file loops just fine and is the correct length, but any game engine that it plays in includes the exact amount of silence that VLC detects. If I import the file into another program and export that, the issue is completely gone, which makes me believe that the problem starts in Logic, whether it's a preference or something I'm doing.

 

EDIT: I just did a test and created a region exactly 30 seconds long with a note that extends the entire length, and after exporting, VLC reads it as 4:36. I did the same thing in Pro Tools and VLC reads it as 0:30. Not that it proves anything new, but I thought I'd share.

 

EDIT: I've also reset all Logic preferences and did the test again, and the time is reduced to 0:46, both in simple and advanced mode.

Link to comment
Share on other sites

Okay, so I opened all the MIDI files in a program called Sekaiju and in the first track of each song (which is invisible in Logic) there's an event list for tempo, time signature, key, timecode, and an End of Track event, which in my case is set at a later time than the end of the actual song. Is there a way to see this info in Logic?
Link to comment
Share on other sites

Okay, so I opened all the MIDI files in a program called Sekaiju and in the first track of each song (which is invisible in Logic) there's an event list for tempo, time signature, key, timecode, and an End of Track event, which in my case is set at a later time than the end of the actual song. Is there a way to see this info in Logic?
Link to comment
Share on other sites

Okay, so I opened all the MIDI files in a program called Sekaiju and in the first track of each song (which is invisible in Logic) there's an event list for tempo, time signature, key, timecode, and an End of Track event, which in my case is set at a later time than the end of the actual song. ...

What do you mean by this? I am afraid I don’t understand what you mean by ‘first track’.

27" iMac Pro 1.1 8 core 64 GB 1 Tb SSD with 27" Apple Thunderbolt display | MacOS Catalina 10.15.7, Logic X 10.6.1 | 4 TB G-RAID via Thunderbolt Display and 4 TB TBolt HDD Timemachine only, | RME UFX via Firewire to Thunderbolt Display, | MOTU MIDI express XT to USB, Seaboard 25 via BT or USB | Roland AT45, Kurzweil PC3X, Arturia MatrixBrute, 12Step & BCF2000 via MOTU’s MIDI | PC3X, MatrixBrute, 12Step and BCF2000 occasionally via USB.

Link to comment
Share on other sites

Okay, so I opened all the MIDI files in a program called Sekaiju and in the first track of each song (which is invisible in Logic) there's an event list for tempo, time signature, key, timecode, and an End of Track event, which in my case is set at a later time than the end of the actual song. ...

What do you mean by this? I am afraid I don’t understand what you mean by ‘first track’.

27" iMac Pro 1.1 8 core 64 GB 1 Tb SSD with 27" Apple Thunderbolt display | MacOS Catalina 10.15.7, Logic X 10.6.1 | 4 TB G-RAID via Thunderbolt Display and 4 TB TBolt HDD Timemachine only, | RME UFX via Firewire to Thunderbolt Display, | MOTU MIDI express XT to USB, Seaboard 25 via BT or USB | Roland AT45, Kurzweil PC3X, Arturia MatrixBrute, 12Step & BCF2000 via MOTU’s MIDI | PC3X, MatrixBrute, 12Step and BCF2000 occasionally via USB.

Link to comment
Share on other sites

Meaning each channel of a type 1 midi file, but the track that each channel appears on. Apparently there's a hidden track before all channels that lists information about the entire song. Say you have a midi file with 10 channels: Sekaiju sees 11 tracks, the first being track 0, followed by each instrument channel, only I can't find it in Logic. It has to be there, otherwise a program like Quicktime or VLC wouldn't know what the tempo or time signature it is. I can't seem to find any information about this. Also, When importing a midi file with tempo info into Logic, it doesn't change the tempo of the session, even with Smart Tempo selected.
Link to comment
Share on other sites

Meaning each channel of a type 1 midi file, but the track that each channel appears on. Apparently there's a hidden track before all channels that lists information about the entire song. Say you have a midi file with 10 channels: Sekaiju sees 11 tracks, the first being track 0, followed by each instrument channel, only I can't find it in Logic. It has to be there, otherwise a program like Quicktime or VLC wouldn't know what the tempo or time signature it is. I can't seem to find any information about this. Also, When importing a midi file with tempo info into Logic, it doesn't change the tempo of the session, even with Smart Tempo selected.
Link to comment
Share on other sites

I have always found the info your talking about in the header of a MIDI filehence my confusion.

27" iMac Pro 1.1 8 core 64 GB 1 Tb SSD with 27" Apple Thunderbolt display | MacOS Catalina 10.15.7, Logic X 10.6.1 | 4 TB G-RAID via Thunderbolt Display and 4 TB TBolt HDD Timemachine only, | RME UFX via Firewire to Thunderbolt Display, | MOTU MIDI express XT to USB, Seaboard 25 via BT or USB | Roland AT45, Kurzweil PC3X, Arturia MatrixBrute, 12Step & BCF2000 via MOTU’s MIDI | PC3X, MatrixBrute, 12Step and BCF2000 occasionally via USB.

Link to comment
Share on other sites

I have always found the info your talking about in the header of a MIDI filehence my confusion.

27" iMac Pro 1.1 8 core 64 GB 1 Tb SSD with 27" Apple Thunderbolt display | MacOS Catalina 10.15.7, Logic X 10.6.1 | 4 TB G-RAID via Thunderbolt Display and 4 TB TBolt HDD Timemachine only, | RME UFX via Firewire to Thunderbolt Display, | MOTU MIDI express XT to USB, Seaboard 25 via BT or USB | Roland AT45, Kurzweil PC3X, Arturia MatrixBrute, 12Step & BCF2000 via MOTU’s MIDI | PC3X, MatrixBrute, 12Step and BCF2000 occasionally via USB.

Link to comment
Share on other sites

Ah, I think I see where you're confused. So the information that's in the track header gets embedded in the first track of a multichannel MIDI file, but the only way to see it in Logic is by looking at the header itself. I'm trying to access the End Of Track event (hex code FF 2F 00), which I am unable to find in Logic. Is there any way I can access this event in the project's event list?
Link to comment
Share on other sites

  • 1 year later...
Posted (edited)
6 hours ago, JT1312 said:

Hi. I also have the problem that Logic adds 20 seconds of "silence" to every midi export. Has anyone found a solution in the meantime? Thanks!

Can you post an example project in which this happens? Obviously doesn't happen for all projects, as I don't see this here. Also, what exactly do you mean by "20 seconds of silence"? Are the imported MIDI regions too long with no content at the end?

Edited by polanoid
  • Like 1

MacBook Pro 16'' 2019, 2,4 GHz 8-Core Intel Core i9 64 GB 2667 MHz DDR4 / macOS Monterey 12.4 / Logic 10.7.4

Link to comment
Share on other sites

As you can see in the (german) screenshot, I created a midi track in Logix Pro X (version 10.7.4) that is about 1 minute long with one midi command at the beginning and one at the end:
909824621_logicmidiexport.thumb.png.dab2ecc35a4e218b4cd8e28a53642f7f.png

After exporting, however, a midi file is created that is 1:20 min long:150211502_Bildschirmfoto2022-05-14um23_32_31.thumb.png.f4f8f83cb46f530b76287dfd9286b450.png
I have attached the file midi-export.mid.
midi export.mid

This "20 sec bug" does not only occur in this Logic test project, but in all our song projects where midi tracks have to be exported.

 

Link to comment
Share on other sites

Posted (edited)

If I reimport that file into Logic, the result is exactly 1 minute long. I assume your second screenshot is from VLC? Is there any documentation on how VLC determines lengths of MIDI files? Also, is there any other software apart from VLC that show the file's length as 1:20?

Edited by polanoid
  • Like 1

MacBook Pro 16'' 2019, 2,4 GHz 8-Core Intel Core i9 64 GB 2667 MHz DDR4 / macOS Monterey 12.4 / Logic 10.7.4

Link to comment
Share on other sites

Yes, even if I drag it into my Logic project it is 1 minute long again. The problem is that live on stage we control our guitar effects (and more) via this midi file. It is played through the uTrack24. And unfortunately this also intreprets the 20 seconds longer.

Basically I wouldn't care But every song with this midi file has 20 seconds of silence at the end. If you don't have standin ovations after every song, that's a pretty long time until the next song can be loaded. ;)

Link to comment
Share on other sites

Posted (edited)
38 minutes ago, JT1312 said:

This "20 sec bug" does not only occur in this Logic test project, but in all our song projects where midi tracks have to be exported.

Yes, VLC will add the 20 seconds in the player, but if you reimport the midi file into Logic nothing is added:

 

 

Screen Shot 2022-05-14 at 3.22.05 PM.png

Edited by triplets
  • Like 1

Logic Pro 9 Master Pro and X certified - ProTools 10 & 11 Certified Operator
2 x 3.06 Intel Six-Core 24 GB RAM, Logic 10.5.1, 10.14.6., UA Apollo - 2012 i7 MBP 16 GB Logic 10.6.3, 10.15.7
Contact me for Logic help (Teamviewer, Zoom, Skype) - http://www.ultimatestudiosinc.com

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...