Audacity Bug Summary
••• Introduction •••
••• Keywords •••
    Audacity 3.0.3 development began 19th April 2021

Audacity Bugzilla



Bug 461 - MIDI or Allegro export filter does not enforce output format cross-platform
MIDI or Allegro export filter does not enforce output format cross-platform
Status: RESOLVED FIXED
Product: Audacity
Classification: Unclassified
Component: MIDI
unspecified
Other All
: P3 RepeatableAll
Assigned To: Default Assignee for New Bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-16 12:49 UTC by Steve Daulton
Modified: 2019-08-21 10:01 UTC (History)
8 users (show)

See Also:
Steps To Reproduce:
See Comment 6. 1) Allegro filter with no extension produces MIDI file with a ".mid" extension on all platforms EXCEPT Vista/7. On Vista/7, an Allegro file with a ".gro" extension is produced as expected. 2) If you add an extension that implies the other output format, the output format changes. So selecting MIDI filter but using ".gro" extension produces an Allegro file, and selecting Allegro filter but using ".mid" or ".midi" extension produces a MIDI file. I'm not 100% convinced by this yet, because when you import MIDI, the input filter is conflated into "MIDI and Allegro files (.mid; .midi; .gro)". I suggest that should be split into two separate filters when we implement point 2) (or three filters including MIDI/Allegro combined) then I'll be happy things really are consistent. 3) Output filter does not remember MIDI/Allegro choice but defaults to MIDI.
Release Note:
GROUP: MIDI * '''Exporting Note tracks:''' Selecting "Allegro (*.gro)" as the file type when exporting note tracks does not produce an Allegro file unless the file name includes the extension ".gro".
First Git SHA:
Group: NoteTrack
Workaround:
Closed: 2019-08-21 00:00:00
petersampsonaudacity: Test‑OK‑Win+
petersampsonaudacity: Test‑OK‑Mac+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Daulton 2011-12-16 12:49:40 UTC
File menu > Export MIDI... does not honour the file type selected in the export dialogue screen. 

"File > Export MIDI" gives options to export as either a MIDI (.mid) file, or as an Allegro (.gro) file, but _regardless_of_which_type_is_selected_:

* If no file extension is specified the file will export as a MIDI file with .mid appended to the file name.

* If the specified file name ends with .gro then the data is exported as an Allegro file.

Tested on Debian Squeeze and Mac.
Comment 1 Gale Andrews 2011-12-16 13:32:50 UTC
On Windows 7 the core issue works correctly. 

* Type "midi" for file name with midi selected - > results in "midi.mid"
* Type "gro" for file name with gro selected - > results in "gro.gro"

At the moment I feel it is correct and consistent with audio export that adding a valid extension overrides the filter. So, you can export "gro_file.gro" (an Allegro file) by typing "gro_file.gro" even with MIDI filter selected. If you want "gro_file.gro.mid" (a MIDI file), that's what you have to type, just as you have to add the extension with audio file export if you want to add dots into the file name.  

Title therefore changed from "Export MIDI file type" to "MIDI file exported when selecting Allegro filter but not specifying an extension" and platform changed to "OS X and Linux". 

If Steve/Bill thinks this interpretation is wrong, let's discuss it.
Comment 2 Steve Daulton 2011-12-16 15:28:53 UTC
(In reply to comment #1)
> At the moment I feel it is correct and consistent with audio export that adding
> a valid extension overrides the filter. 

It's not consistent with audio export.

If you export audio as a WAV file and add ".mp3" to the file name, you get a WAV (PCM format) file with a ".mp3" extension.

Similarly if you export audio as an MP3 file and add ".wav" to the file name, you get an MP3 (MPEG audio) file with a ".wav" extension.

However, if you Export MIDI and select "Allegro (*.gro)" without specifying the file extension you get a MIDI file with a ".mid" extension and not an Allegro file.

Similarly if you Export MIDI and select "MIDI (*.mid)" but add a ".gro" extension you get an Allegro file with a .gro extension and not a MIDI file.

I've tested on Windows XP running in Virtualbox and I see the same behaviour.

Allegro files are plain text files with a .gro extension so they are easily identifiable as not MIDI.

I don't think that the new title correctly expresses the nature of this bug.
Comment 3 Gale Andrews 2011-12-16 16:22:18 UTC
(In reply to comment #2)
> It's not consistent with audio export.
I can see this both ways, but the argument turns on how "similar" are MIDI and Allegro? I appreciate one is plain text and one not, but it is the same family of formats, so this behaviour struck me as appropriate. I've Cc'd Roger - let's hear it from the horse's mouth. 

> However, if you Export MIDI and select "Allegro (*.gro)" without specifying the
> file extension you get a MIDI file with a ".mid" extension and not an Allegro
> file.
This is the current title of the bug. As already stated: on Windows 7, if you select the Allegro filter and do not add an extension, you get a plain text .gro file as expected. I'll try this on a real XP machine later and report back. If this occurs on Win 7 but not XP, then I can only assume it's because (IIRC) we use custom filtering on XP.        

> Similarly if you Export MIDI and select "MIDI (*.mid)" but add a ".gro"
> extension you get an Allegro file with a .gro extension and not a MIDI file.
This is a different issue (see above) - how "similar" are MIDI and Allegro? If we decide this is a bug (Roger did not intend it), we can consider the title. 

Note that on Ubuntu and Win 7, if you export as Allegro then export again, the filter resets to MIDI. I would probably question that.
Comment 4 Gale Andrews 2011-12-16 17:03:54 UTC
Confirmed on XP (Steve and me) that the Allegro filter is ignored when not specifying an extension. Platform changed to "All except Vista/7" (assuming Vista behaves as 7).
Comment 5 Roger Dannenberg 2011-12-16 22:57:08 UTC
Interesting. I always thought file filters were just that and did not specify output file formats. This is true with some programs, but not all. But in any case, midi file export should mirror the behavior of audio file export in Audacity. I agree this is a bug.
Comment 6 Gale Andrews 2011-12-17 11:30:36 UTC
Thanks, Roger. OK, title changed to "MIDI or Allegro export filter does not enforce output format cross-platform". There are three issues:
1) Allegro filter with no extension produces MIDI file with a ".mid" extension on all platforms EXCEPT Vista/7. On Vista/7, an Allegro file with a ".gro" extension is produced as expected.
2) If you add an extension that implies the other output format, the output format changes. So selecting MIDI filter but using ".gro" extension produces an Allegro file, and selecting Allegro filter but using ".mid" or ".midi" extension produces a MIDI file. I'm not 100% convinced by this yet, because when you import MIDI, the input filter is conflated into "MIDI and Allegro files (.mid; .midi; .gro)". I suggest that should be split into two separate filters when we implement point 2) (or three filters including MIDI/Allegro combined) then I'll be happy things really are consistent.  
3) Output filter does not remember MIDI/Allegro choice but defaults to MIDI.             

@Roger - how do you feel about a new enhancement issue (obviously not for 2.0) to add MIDI/Allegro files to File > Recent Files and separate "MIDI" and "Allegro" files filters to Open? This assumes File > Open stops "as is" - there may well be a separate "Open Projects" item or even only "Open Projects".
Comment 7 Steve Daulton 2017-07-30 19:46:49 UTC
Upped to P3 as the 2.2.0 release has greater emphasis on Note tracks than previous versions of Audacity.
Comment 8 Peter Sampson 2019-05-23 09:14:38 UTC
Testing on W10 with audacity-2.3.3-alpha-252-88dc11f525215cea57f7a89b0038fc7d40a50149

>Step 1) Allegro filter with no extension produces MIDI file with a ".mid"
>extension on all platforms EXCEPT Vista/7. On Vista/7, an Allegro file 
>with a ".gro" extension is produced as expected.

This now seems to work properly on W10 - i now get a proper Allegro file with a .gro extension


>Step 2) If you add an extension that implies the other output format, the 
>output format changes. So selecting MIDI filter but using ".gro" extension
>produces an Allegro file, and selecting Allegro filter but using ".mid"
>or ".midi" extension produces a MIDI file. 

This is still the case - but I'm not sure what the "correct" behavior is - should it be dictated by the filter, or by the extension the user supplies - which should dominate?

If I export with the MIDI filter but supply no extension a .mid file is exported as expected.


If we accept that the extension should take precedence in Step 2 then this now looks to be fixed on Windows.
Comment 9 Peter Sampson 2019-05-23 09:19:50 UTC
Testing on 2.2.2 on macOS 10.15.5

Step 1) now gives me a .gro file as expected

Step 2) the output file I get is test.gro.mid - so yje .mid extension is being added to the already-supplied .gro
Comment 10 Peter Sampson 2019-08-21 10:01:53 UTC
Testing on macOS 10.14.6 with 2.3.3 alpha jc007

I am now happy with the behavior on Mac

a) selecting MIDI in the file type defaults to a .mid extension

b) selecting Allegro in the file type defaults to a .gro extension

c) Gale is right, on next use it defaults to MIDI even if last use was Allegto - but I am perfectly happy with that - the command is called "Export MIDI"

d) If I Export as MIDI but specify a .gro extension the Audacity exports 
<filename>,gro.mid - and Get Info shows it to be a MIDI file

e) If I export as Allegro and specify a .mid extension I get an error message
>You cannot save this document with extension ".mid" at the end of the name.
>The required extension is ".gro"
>buttons: "Use both" "Cancel" "Use .gro" (default, highlighted)
All three buttons work as expected

f) the filetype entries in the dropdown also show what the extension should be.

This all seems totally watertight on Mac as well as Windows.