Jump to content
quattj

Saved MIDI file misaligned track starts

Recommended Posts

I am new to Cakewalk.  I am using it for two features: removing some measures from the end of my MIDI files, and adding a 10 second fade out.

The first file I've tried it on, which is one of my eventually hundreds of MIDI files in my project, I am able to remove the extra measures, I am able to fade the song as desired.  Everything appears normal.  I go to File -> Save As, and the resulting MIDI file all of the starts of the tracks are misaligned, with some starting as they should at the beginning, while others are delayed up to 4 seconds.  See the attached before and after screenshots.  Any idea what might be causing this, and how I can correct it?  The original file is created with a game music converter, and then edited with several other utilities along the way, before arriving at this point. No offset issues exist until it is edited with Cakewalk.

I cut the end of the song by making a selection using the selection tool, then Ctrl-X.  The "Split Notes" option is turned on.  Saved, everything appears normal.

I add the fade by selecting the last 10 seconds, and the go to Insert -> Series Of Controllers -> 11 Expression, start = 127, end = 0.  Everything looks normal pre-save.  Then I save, and in Cakewalk it still looks normal, but if I close and reopen, the offsets become visible.

before.jpg

after.jpg

Share this post


Link to post
Share on other sites

Note to everyone: This problem is also discussed starting at this midi.org post.

It looks like Cakewalk decided there wasn't enough time at the beginning to send all of the initial setup events, so Cakewalk moved all the notes one measure later.

Some of the tracks in your file have events before the first note event. For the most part, Cakewalk left the events before the first note in each track at the same position. (Some of the initial setup events in each track were moved between a few ticks to around one beat later.) In each track, the events starting with the first note and after were moved one measure later.

Share this post


Link to post
Share on other sites

I found a setting that will help avoid most of the problem.

Close Cakewalk, then edit the following file in a text editor:

%AppData%\Cakewalk\Cakewalk Core\TTSSEQ.INI

In the [Options] section, add the following line:

GeneralMidiSMFs=0

Save and close the file, then you can re-open Cakewalk.

Now when you save your MIDI file, Cakewalk no longer moves all notes 1 measure later. However, there is still some slight adjustment of the notes at time zero in your MIDI file, they're now 3 ticks later. And the initial setup events in each track are still reordered and some are moved 1 to 3 ticks later.

Source: Cakewalk Help - TTSSEQ.INI:

Quote

Variables in the [Options] section

[...]

Variable: GeneralMidiSMFs
Type: Boolean
Default value: 1 (enabled)
What it does: This line controls whether or not Cakewalk creates a General MIDI setup measure when loading Standard MIDI Files.

Perhaps it should really say "when saving Standard MIDI Files" since that's when Cakewalk seems to make the change, but otherwise this description fits the behavior we were seeing happen. (And I think a better name for it would have been something like "SetupMeasureSMFs" -- it doesn't seem related to General MIDI to me.)

Edited by Bavi_H

Share this post


Link to post
Share on other sites
3 hours ago, Bavi_H said:

I found a setting that will help avoid most of the problem. [... In TTSSEQ.INI] In the [Options] section, add the following line: GeneralMidiSMFs=0

[...] Now when you save your MIDI file, Cakewalk no longer moves all notes 1 measure later. However, there is still some slight adjustment of the notes at time zero in your MIDI file, they're now 3 ticks later. And the initial setup events in each track are still reordered and some are moved 1 to 3 ticks later.

Alternatively, it looks like you can achieve the same effect by (temporarily) removing the GS Reset System Exclusive message from your MIDI file.

As a test, I removed the GeneralMidiSMFs=0 from TTSSEQ.INI I had previously added. Using another MIDI file editor I removed the GS Reset from your MIDI file, then opened the file in Cakewalk and saved it, then examined the MIDI file in another editor. I saw the same results as when I had added the GeneralMidiSMFs=0 line to TTSSEQ.INI. (Cakewalk no longer moves all notes 1 measure later. However, there is still some slight adjustment of the notes at time zero in your MIDI file, they're now 3 ticks later. And the initial setup events in each track are still reordered and some are moved 1 to 3 ticks later.)

Source: Special handling of GM, GS, and XG MIDI files:

Quote

When Cakewalk finds a GM, GS or XG reset message, it assumes that you would like to work within the GM Score Production guidelines. [...] If necessary, Cakewalk will insert blank setup measures at the start of your song. [...] When you save your work as a MIDI File, Cakewalk will place [] events [for track parameters][...] at the specific clock ticks recommended by the guidelines.

 

  • Like 1

Share this post


Link to post
Share on other sites

So it seems it not really a "problem", just an unanticipated result.  I gave the file a good listen, and the audio integrity seems to remain intact, ie no misplaced notes, no sounds that behave improperly as far as I can tell.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...