Append Import

Share your Audacity/Nyquist plug-ins here, or test drive the latest plug-ins submitted by Audacity users.

After testing a plug-in from this forum, please post feedback for the plug-in author.
steve
Site Admin
Posts: 80326
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Append Import

Post by steve » Thu Aug 04, 2011 4:31 pm

[Update: The current version of this plug-in is fully functional - see the included help screens for usage and limitations ]

This feature gets requested from time to time, so I thought I'd look to see if it could be done with Nyquist.

Here's the first (experimental) version as a proof of concept.
This version can import up to 10 files, end to end in one track.

Limitations:
  • Only mono files are supported in the first version (marked "Obsolete" below). For stereo support, download the "latest" version.
  • All files should have the same sample rate.
  • Probably only WAV files supported at present.
  • The computer must have enough RAM to hold all of the files at the same time before they are written to the track.
  • There is no error checking, so incorrect user input will fail, probably with no error message.
I think that Nyquist only supports reading uncompressed formats, so I'll not be able to do anything about that particular constraint, but it should be possible to overcome the other limitations in future versions.

When installed, this plug-in will appear in the Generate menu. See Installing Nyquist plug-ins .

OBSOLETE VERSION:
AppendImport.ny
** OBSOLETE **
(1.46 KiB) Downloaded 588 times
LATEST VERSION: AppendImport.ny
Last edited by steve on Fri Apr 24, 2015 3:45 pm, edited 12 times in total.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 80326
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Append Import

Post by steve » Fri Aug 05, 2011 2:56 pm

Here's a new version.
  • Both stereo and mono files of any sample rate can now be imported.
  • To import files into a stereo track, a stereo track must be selected before running Append Import. (Generate plug-ins can only create new mono tracks, but can return stereo audio to a stereo track if the stereo track is selected before running the plug-in).
  • When "Mono" is selected as the output format, stereo files will be mixed down to mono.
  • Append Import only supports uncompressed audio formats.
  • The computer must have enough RAM for the entire import.
As with all Generate plug-ins, if the tracks are imported without selecting a track, then the imported track will be at the "Project Sample Rate" (as shown in the lower left corner of the main Audacity window). If a track is selected before running "Append Import" then the track sample rate will be used.

Unfortunately it does not appear to be possible to trap input errors. If an invalid path or file name is entered, then the import will fail without any meaningful message. If the "Debug" button is used rather than the "OK" button, then the error will be shown in the debug window, though not in a very user friendly way.

Nyquist only supports reading uncompressed file types (AIFF, WAV) so it is not possible to use this plug-in directly with MP3, WMA, FLAC or other compressed file types.

This plug-in could be adapted to concatenate longer files, but only by writing directly to disk rather than reading into a track, and there's better ways of doing that (for example by using SoX). For a modern computer (with 2GB or more of RAM) it should be possible to import well over an hour of stereo audio.

One nice little bonus feature is that the specified directory is the "default" import folder. Files from other locations may be imported at the same time if they are typed with a fully qualified address. For example, if the default folder is /home/user/Desktop/ and file1 is test1.wav and file2 is /home/user/soundfiles/test2.wav then test1.wav will be found from the default directory and test2.wav will be found because it has a fully defined path. I'm not sure how this works on Mac and Windows, so perhaps someone can test it and let me know.
AppendImport.ny
** OBSOLETE VERSION ***
(2.49 KiB) Downloaded 463 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 80326
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Append Import

Post by steve » Fri Aug 05, 2011 3:29 pm

A possible update on this could be for the plug-in to read a list of files from a text file. This would overcome the issue of limited space in the GUI so that more files could be imported at the same time. Would that be of interest to anyone?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 80326
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Append Import

Post by steve » Fri Aug 05, 2011 4:11 pm

A minor update.
This version is able to check that the default Import folder exists.
AppendImport.ny
** OBSOLETE VERSION ***
(2.63 KiB) Downloaded 417 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 80326
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Append Import

Post by steve » Fri Aug 05, 2011 11:20 pm

steve wrote:A possible update on this could be for the plug-in to read a list of files from a text file. This would overcome the issue of limited space in the GUI so that more files could be imported at the same time. Would that be of interest to anyone?
Well I thought it was a good idea, but also to have the option to import all of the files in a specific folder (in alphanumeric order).

This version does just that.

"Append Import will look in the selected "Import Folder" for a text file called filelist.txt.
If found, it will attempt to read each audio file that is listed in filelist.txt.
filelist.txt must contain only a list of uncompressed audio files of type .WAV, .AIFF or .AU.
The file extension .AIF is also allowed.

Each file must be on a new line and must be either
  1. A file in the 'Import Folder'
  2. A fully qualified file name.
If filelist.txt is not found, all supported audio files in the Import Folder will be loaded in alphanumeric order.
Clicking the Debug button rather than the OK button will show a list of the imported file names.

This information is also available in the built-in help screen.
AppendImport.ny
** OBSOLETE VERSION ***
(3.58 KiB) Downloaded 433 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 80326
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Append Import

Post by steve » Sat Aug 06, 2011 9:08 am

I've noticed a small bug.
When importing all files from the Import Folder, import may fail if there are files with very short file names.
I think this will be a trivial fix but I don't have time to fix it right now - so this is a reminder that it needs fixing.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 80326
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Append Import

Post by steve » Sun Aug 07, 2011 1:07 pm

This version includes a fix for the bug mentioned in my previous post.
AppendImport.ny
** OBSOLETE **
(3.63 KiB) Downloaded 405 times
Last edited by steve on Fri Apr 24, 2015 3:45 pm, edited 3 times in total.
Reason: Steve: Marked download as obsolete.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 80326
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Append Import

Post by steve » Tue Aug 23, 2011 11:12 pm

This version adds a feature that may help to recover stereo recordings from a crashed Audacity 1.2 (though the plug-in requires Audacity 1.3.8 or later to run).

The extra feature is an "Import Type" option. The choices are:
Sequential: This is the (default) standard mode that imports files end to end.
Alternate Channels: This is the option that may help recover stereo recordings from a crashed Audacity 1.2.x project. The first file read will be placed in the left channel, the next file will be placed in the right channel, the next appended to the left, and so on.

Note:
Audacity 1.2.x will create sequentially numbered .AU files when recording, however, as soon as there is any editing the file numbers will probably be no longer in numerical sequence.
AppendImport_Mode.ny
** OBSOLETE **
(4.69 KiB) Downloaded 452 times
Last edited by steve on Fri Apr 24, 2015 3:45 pm, edited 5 times in total.
Reason: G.A. Renamed to AppendImport_Mode.ny to avoid confusion. Steve: Marked download as obsolete.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Gale Andrews
Quality Assurance
Posts: 41763
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Append Import

Post by Gale Andrews » Wed Aug 24, 2011 2:04 am

Thanks for this plug-in Steve and the "import mode" modification.
steve wrote:One nice little bonus feature is that the specified directory is the "default" import folder. Files from other locations may be imported at the same time if they are typed with a fully qualified address. For example, if the default folder is /home/user/Desktop/ and file1 is test1.wav and file2 is /home/user/soundfiles/test2.wav then test1.wav will be found from the default directory and test2.wav will be found because it has a fully defined path. I'm not sure how this works on Mac and Windows, so perhaps someone can test it and let me know.
This needs more explanation I think,Steve. Are you saying that you can leave "Import Folder" empty and it uses the last used Audacity Open/Import directory, or the working directory? On WIn 7, if the "Import Folder" box is empty you receive "Directory "" does not exist". If you enter the fully qualified path to a file it tells you that directory does not exist.

If you can type multiple files or folder names, what are valid separators?

Is it expected that Unicode or extended ASCII characters in folder names will fail? Folders called "Söndag" and "Älska" are reported not to exist on Win 7 here, though they do.

Also for these and other Nyquist plug-ins that look in folders, do they/should they search recursively?



Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

steve
Site Admin
Posts: 80326
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Append Import

Post by steve » Wed Aug 24, 2011 4:19 am

Gale Andrews wrote:Are you saying that you can leave "Import Folder" empty and it uses the last used Audacity Open/Import directory, or the working directory?
No, but this feature has changed since the first (prototype) version.

How it works now:

The "Import Folder":
  • The "Import Folder" tells the plug-in where to look.
  • If the "Import Folder" is not specified, the plug-in will only look in Nyquist's *default-sf-dir* (default sound file directory). The location of the *default-sf-dir* is platform dependent though I think it could be displayed in the Help screen. For clarity the user should always specify this folder by entering a valid, fully qualified path as the "Import Folder".
  • The plug-in will look in the "Import Folder" to see if there is a file called filelist.txt.
  • If filelist.txt is found, then the plug-in will import each file that is listed in "filelist.txt" in the order that they are listed.
  • If filelist.txt is not found, then the plug-in will import all supported audio files that exist in that folder.
The filelist.txt file:
  • If this file is present in the "Import Folder" folder it will be used and only audio files listed in this file will be imported.
  • filelist.txt is a plain text file.
  • Each file on the list must be on a new line.
  • Blank lines are ignored.
  • Each audio file must be either (a) a file in the "Import Folder" or (b) a fully qualified file name.
  • All files listed must exist.
  • All files listed must be of supported file types.
If there is no filelist.txt file:
  • All supported files in the "Import Folder" will be imported.
  • Unsupported file types will be ignored.
Gale Andrews wrote:Is it expected that Unicode or extended ASCII characters in folder names will fail? Folders called "Söndag" and "Älska" are reported not to exist on Win 7 here, though they do.
That may be OS dependent. Söndag" and "Älska" both work here (Linux) as file names or folder names. There's some (unresolved) discussion about this here: http://audacity.238276.n2.nabble.com/Un ... 81026.html
Gale Andrews wrote:for these and other Nyquist plug-ins that look in folders, do they/should they search recursively?
This plug-in does not search recursively. It looks only in the "Current directory".
Searching recursively would be difficult and I think that it would probably be more confusing for users.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply