Jump to content
  • 0

Cakewalk crashes exporting MIDI file while driven by AutoIt


EdStauff

Question

With Cakewalk being discontinued, I need to export about 300 projects to standard MIDI files.  (I only care about the MIDI tracks, not the audio.)

Can't afford the time to do them all by hand, so I wrote an AutoIt script to do the exporting.  It worked fine for a few dozen projects, then for no apparent reason, every time my script clicks the "Save" button in the export dialog, Cakewalk abruptly quits.  When I try the same export by hand, exporting works fine.  I tried it on a few different projects, and they all behave the same way.

I looked at Windows event log and a .wer file, but learned nothing useful.  I tried disabling all devices in Cakewalk and removing all VST paths, but that didn't help either.

Anybody have any suggestions (besides doing them all manually)?

Thanks,

-- Ed

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

Thank you for the responses.

Azslow3, I plan to open/import the MIDI files in another DAW.  (I'm currently using Ardour.)

Promidi, yes, AutoIt is a free scripting language that knows how to manipulate Windows GUI apps.  My script is already loaded with delays.  Here's a summary of what it does:

The input to the script is a text file containing a list paths to Cakewalk projects (.cwp).

for each line in the file:
        make sure the file actually exists
        activate Cakewalk's main window
        * open the (project) file in Cakewalk:
                  type <ctrl>+"o"
                  wait for the "Open" dialog to appear
                  type the project file path
                  type <enter>
                  wait for Cakewalk's main window to become active
        * select all tracks:
                  activate Cakewalk's main window
                  type <alt>+"e"        ;  main menu bar: "Edit" menu
                  type "e"                       ;  open "Select" sub-menu
                  type "a"                       ;  All
        * export to standard MIDI file
                  type <alt>+"e"        ;  main menu bar: "Edit" menu
                  type <left>                ;  main menu bar: "File" menu (typing <alt>+"f" doesn't work)
                  type "e"                       ;  open "Export" sub-menu
                  type "m"                     ;  "Standard MIDI File"
                  wait for "Save Copy" dialog to appear
                  set the "File name" text box to the name of the output file
                  type <enter>
                  wait for "Save Copy" dialog to disappear
                  wait for Cakewalk's main window to become active
                  verify that the MIDI file actually got created
        * close the project
                  type <alt>+"e"        ;  main menu bar: "Edit" menu
                  type <left>                ;  main menu bar: "File" menu (typing <alt>+"f" doesn't work)
                  type "c"                       ;  "Close"
                  if the "Save Changes" dialog appears, tell it No.
                  wait for Cakewalk's empty main window to become active
 

Not shown in the algorithm above:

  • Dismiss dialogs for things like missing audio files, missing plug-ins, device disconnected.
  • Minimize the Multidock window.
  • 500ms (½ second) sleeps between UI events.
  • Error handling.

One more data point:  I just tried running my script on a project that the script had already processed successfully.  This time Cakewalk crashed, just like with the other projects.

I can't figure out what could have changed to make it stop working.  <sigh>

Thanks again,

-- Ed

Link to comment
Share on other sites

  • 0

Yes, SAVE AS is the best way to easily do this. Takes about 3 seconds once a project is open. 

Ardour?  I use Ardour and it's one of the Daw's that doesn't  "open"  a midi file. It only allows drag and drop which then looses all the patches and the tempo etc. Possibly I am unaware of how it can "open" a midi file in Ardour, but all attempts by me failed. 

Link to comment
Share on other sites

  • 0

I have about the same number of CWP files that are my backing tracks and the best way to archive them is this simple procedure. 

Open the CWP file, "Save As" Midi type 1. Done.  

This vide explains backing up projects for the future as well as Daw transfering- https://youtu.be/o8o8zK4SKWI

Yes it takes time but such is the nature of working with backing tracks and keeping your work safe. Time well spent. Midi files are timeless and defiantly a very smart thing to do with all your projects. 

A Daw needs to  "open" a midi file.  Or at least have some import options to use the tempo map. Many will ask you if you want to use the tempo map. Ardour is not among those. Cakewalk and Cubase have the best importing options for midi files. 

 

This Video explains how to save your CWP files as General Midi files. https://youtu.be/zRfJymkHA6o

 

Edited by Sock Monkey
Link to comment
Share on other sites

  • 0

I don't blame people for believing Cakewalk is discontinued. Because of the way they handled the release of Sonar last year the interment is now flooded with misinformation. You Tubes, Facebook etc.  Right or wrong it doesn't go away.   A musician friend of mine asked me what DAW I was using these days and when I mentioned Cakewalk being one of them they replied " I thought they killed that one?"    There's still very little "facts" to be found.   

Notice how there's almost zero new users coming here now?  Majority of questions in the Sonar sub forum are  about licensing and authorization as well as question about older Sonar.  The Next forum has had a grand total of 4 questions asked since June. 

This Cakewalk sub forum is the more active one but even that is slowing down. 

Link to comment
Share on other sites

  • 0

Promidi wrote:
> Instead of export, have you tried File - save as and then select MIDI Format 0 or MIDI Format 1 as filetype.

No, I hadn't tried that.  Great suggestion, thank you!
I tried it, but unfortunately, it didn't change the crashing behaviour.

Sock Monkey wrote about the importance of archiving stuff to MIDI.
Yes, I should have been doing that as part of my normal workflow, but the problem is remembering to do it.  That's the sort of thing I should be able to automate, but CW has no real support for general workflow automation (scripts/macros).

msmcleod wrote:
> we've no immediate plans to discontinue Cakewalk.

Sorry about the false allegation; faulty memory.
I should have said that Cakewalk will be replaced at some point in the future with two non-free products (more about that below).

Regarding the remarks about the DAW "Ar****":

•  It cannot "open" MIDI files, but it can import them, which has worked fine for me.
•  Its MIDI support is not limited to Note and CC events.  It handles Pitch Bend and Aftertouch as well.  I don't know about stuff like SysEx and song events, as I don't use those.

I don't love the DAW I'm using, but I have a strong preference for open-source software for a variety of reasons, including (a) I'm poor, and (b) when an app I'm using goes away, I can't afford to have work lost because the files are in a proprietary format.  There's only piece of non-FOSS software I still use: my score editor (Fi****).  And now that's going away too, leaving me with around 4 thousand score files to migrate.

Thanks again for your help,

-- Ed

Link to comment
Share on other sites

  • 0
On 9/14/2024 at 7:46 PM, EdStauff said:

Azslow3, I plan to open/import the MIDI files in another DAW.  (I'm currently using Ardour.)

Sorry, I (currently) can't help with Ardour. But I will keep an idea to export into open source DAW format in my mind...

The problem with MIDI/Audio transfer, you loose many details (separate clips, plug-ins, etc.).

Link to comment
Share on other sites

  • 0

This topic is of great interest to me as I have been testing about 10 Daw's to see how they handle importing a GM midi file. This is critical if you want to re construct a Cakewalk project that contains any midi data in another Daw.  Even though many will end up using Sonar ( me included) we should always have a backup plan for transferring to other Daw's. You might find your self collaborating and need to do this. 

I've been messing with Ardour.  The development is open source community. But be warned, it's very Mac and Linux oriented.  It was one that more or less failed the GM test.  Take note that Harrison Mixbus is the same Daw. It just comes with better?  plug ins. 

I asked on the user forum about my issues. There was no solution, but I made progress and managed to import a midi file. It takes a lot more work than most of the other daw's I tried.   If you are importing a Midi file that has a tempo map it ignores that. I am hoping this is an issue that can be resolved by the community. There are check boxes for tempo and you can choose any GM player you want, it just doesn't work. No tempo and the GM player ignores the patch's.  I would think this can be fixed, but only if someone is willing to do it, open source is different than complaining to a paid developer. 

 

So far Cubase  is the only one equal to Cakewalk for importing ( opening) a GM file. Some import the tempo map but there's either no player or the player ignores patches. Then some play the proper instruments but at that wrong tempo. I do like the way Studio one gets everything working and you can drag and drop all your proper VST instruments in like 10 seconds from the browser.  

Link to comment
Share on other sites

  • 0
16 hours ago, Promidi said:

If you want a MIDI file's tempo map included, then open the MIDI file, do not import it.

I wasn't talking about Cakewalk. Cakewalk/Sonar would seem to be the only Daw that is this way. Most other Daw's have Import or drag and drop often both. And each is different in what happens. The OP was using Ardour. Please read whole post not just part of it for a better understanding of my comment. 

 

Update:  I tried importing a Midi file into Ardour again today and this time it all worked properly. I got the tempo map as well as it played the correct instruments. I write it off as the software seems sort of on the edge all the time. It crashes etc. 

Edited by Sock Monkey
Link to comment
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...