When importing files sequentially, the files are
‘merged’ into one track with no split marks. Sometimes
it is useful to be able to see where each track starts
and ends, so the plug-in provides the ability to create
labels for each imported file.
To create labels for each file AFTER successfully
running Sequential Import, run the plug-in again with
‘Output’ set to ‘Labels’.
The labels will be retained by the plug-in for use at
any time after running Append Import in ‘Sequential’
mode for the duration of the Audacity session. Running
Append Import again in Sequential mode will replace
the labels stored by the plug-in with labels for the
most recent import.
Tip: To view a help screen in a form that can be easily
copied, use the Debug button with ‘View Help’ enabled.
Remember to deselect Help before running the plug-in.
It still needs thorough testing as there have been quite a lot of code changes, but here’s the new version.
Normally I’m not keen on Nyquist plug-in help screens, but due to limitations in the Nyquist plug-in interface I think that this plug-in requires some built-in help. For this reason I’ve kept the help screens and a little bit of advice in the GUI. AppendImport.ny (8.88 KB)
Tested on Windows 8 (just to be awkward). If the “Import Folder” field is empty and I choose “Sequential”, “Mono” (or “Stereo”) I get a message “Directory “” does not exist" (with no Debug output). The “Usage” help states the working directory correctly, though. This is true whether the working directory contains importable files or not.
The labels seems like a nice feature. I take it we cannot have a control:
“Label sequential import” Yes, No
that does the labelling at import time, and remove that choice from “Output”? This would be much more user-friendly I think.
If we don’t change that, should labelling not just work on the audio at its current Timeline position? It seems un-necessary to label starting at the cursor point because user could have moved the cursor or selection, meaning the labels will be in the wrong place.
I see from the code that “Alternate channels” assumes equal file length, but could it not fill the empty channel with silence if the files are different length, rather than truncate the file?
I know file lists only support ascii but I should probably relate the following anyway. I had a problem with a character in a file name in filelist.txt that looks like 2D hyphen-minus (and is identified as such if I paste it into various online checking tools) but it causes filelist.txt import to fail. The file itself imports OK from the folder it is in if filelist.txt is not in that folder.
I added the file name to filelist.txt by F2 and copy-paste. I assume it is really not hyphen-minus as if I replace it with a hyphen typed on my PC keyboard, the error goes away. The wav file came from a Mac; I attach the filelist.txt file.
Here is the result when the Import Folder is S:Filesfilelist.txt and that file contains that hyphen character:
“uncompressed audio files of type .WAV .AIFF or .AU” lacks the full stop at the end of the sentence.
This text may be better for only a couple more words:
"Append Import will look in the 'Import Folder' for
'filelist.txt'. If found, it will try to read each
audio file listed in 'filelist.txt' and ignores any
audio files in the Import Folder. If not found, all
supported audio files in the Import Folder will be
loaded in alphanumeric order.n
Say “1) A file name in the ‘Import Folder’, with extension” (import fails without the extension)
I prefer to say " ‘Sequential’ will append the files end-to-end" as I think it is less ambiguous.
If ‘Alternate Channels’ retains the equal length restriction, you could say that by dropping some superfluous words e.g. “assumes the first file is for the left channel”… is shorter.
I don’t mean to be disparaging about this very useful plug-in but I think this is one plug-in where a built in C++ version would be vastly more functional. How soon or if that version will happen, even given it’s an “approved” P4 enhancement, remains to be seen.
Thanks, that was a bug. I think that I’ve fixed it now, but please recheck this in the next version if you can on Windows 8 in case it does something weird.
Sadly no.
Plug-ins can only return one result to Audacity (other than debug text). So you can either return the audio, OR labels, but not both.
Nyquist is unaware of the cursor position or the track start time. The start time for Nyquist is “time = zero” and Audacity puts “time = zero” at the cursor position.
This is part of the wish-list feature that I’ve been discussing with Robert J. H. here: Information passed from Audacity to Nyquist
I’m not sure why it does that… I think that is an Audacity bug, possibly related to http://bugzilla.audacityteam.org/show_bug.cgi?id=425
The sound exists in Nyquist, but Audacity is truncating it to the shortest channel.
I can work around the problem by padding the shorter channel with silence at the end.
“Nyquist” only supports ASCII. In cases where Nyquist does not need to “understand” the characters (if Nyquist can just treat the string as a series of one byte characters), non-ascii characters will often not cause a problem, but in the case of “reading” the file list, Nyquist runs into the Unicode character and produces the “invalid octal digit” error. I don’t think that I can do anything about this. The “fix” is for Nyquist to support Unicode, but I guess that is a long way off.
Thanks for the help screen suggestions. The new version is:
Append Import will look in the ‘Import Folder’ for
‘filelist.txt’. If found, it will try to read each
audio file listed in ‘filelist.txt’ and ignores any
audio files in the Import Folder. If not found, all
supported audio files in the Import Folder will be
loaded in alphanumeric order.
The default Import Folder is:
“/home/steve”.
Supported file types .WAV .AIFF and .AU must have
valid file extensions. If used, ‘filelist.txt’ must
contain only a list of uncompressed audio files.
Each file must be on a new line and must be either:
A file in the ‘Import Folder’
A fully qualified file name.
Import Mode:
‘Sequential’ will append the files end-to-end.
‘Alternate Channels’ will assume that the first file
is intended for the left channel, the next file for
the right, and so on.
To see a list of imported file names, click the
Debug button.
IMO, the biggest limitation is the lack of a file browser for Nyquist plug-ins. I don’t think that the developers ever really expected Nyquist to be used for anything more than simple experimentation. As Nyquist plug-ins are becoming more sophisticated they are running into the limitations of the very basic interface. It’s not only the GUI limitations, but the limited interaction between Audacity and Nyquist. I hope that we can find a developer that is interested in developing Nyquist functionality in Audacity.
List of changes in this version:
Bug fix for empty ‘Import Folder’.
Debug window indicates if no files found (rather than just an empty debug window).
The debug window now shows the import folder path before the list of imported files.
If one channel is shorter with Alternate Channel mode, pad the shorter channel with silence.
Looks OK on Win 7. will check XP and 8/ OS X later unless there is a volunteer on Mac?
I think this is sufficiently unintuitive that it ought to be mentioned in the second help screen.
Could the plug-in write a label.txt file to the import folder when importing the file, then if requested, import the label file, which doesn’t care about the cursor position?
Even it if could write the label file, I guess it would have to be optional, as some people might find it useful, but for others it would be clutter to be cleaned up.
I would still rather give people a bit more help here, given Windows and Mac hide extensions by default.
How about
Supported file types: .WAV .AIFF and .AU. If used,
'filelist.txt' must contain one file per line and
each line must be either:
1) The name of a file in the Import Folder,
including the extension - for example, tune2.wav
2) The fully qualified path to a file in another
folder - for example, C:\My Music\tune2.wav.n
Yes I can go for that, but it’s an extra line and we’re already up to the 25 line limit for 800 x 600, so we’ll need to lose a line somewhere - perhaps the blank line between:
loaded in alphanumeric order.
The default Import Folder is:
I’ll have a look tomorrow. Better would be if Nyquist could access “Audacity track time”, but it can’t
I agree that it is not intuitive, but at least it is easily discoverable.
It could still be wrong because the imported files are relative to the cursor position.
The limitations are quite frustrating, and the limitations for help screens exacerbate the frustration.
Yes, I had not taken into account the n, only the real line usage in the plug-in.
I think your suggestion is OK, or trim the “alternate channels” text to two lines:
'Alternate Channels' assumes the first file is for
the left channel, the next for the right, and so on.n
53 characters, but some lines already use more than that.
Yes but at least import (of the audio) at the cursor is a feature.
If doable, it would reduce the limitations. Import at zero, move the cursor to play a bit of it, then import labels (surely a common scenario) would then still have the labels in the correct position.
I agree it would need two labels choices, “Labels at cursor”, “Labels from file” (or some such). That would be useful but then you probably need a choice not to create the label file (or an action to delete it, called from the plug-in).
Windows 8 and Mac OS X 10.7.4 seem OK with detecting the working directory if the “Import Folder” field is left empty. I still have to check Win XP.
On Windows, I found two more behaviours to note with filelist.txt import.
Windows XP and later uses “natural number sort” that makes “file10.wav” come after “file2.wav” rather than before, but if the file name has a letter preceding a number, this sort makes that file name come before a name that has only numbers.
Unfortunately there is no international standard for alphanumeric order, so inconsistencies can and do occur.
Nyquist uses “character by character” alphanumeric ordering (as does Windows 2000) while Windows XP and later file name sorting considers numbers in strings in file and folder names as numeric content, not text (as does Linux).
We could change:
If not found, all
supported audio files in the Import Folder will be
loaded in alphanumeric order.
to:
If not found, all
supported audio files in the Import Folder will be
loaded in alphanumeric character order.
recently i’m using this wonderful plugin and it could be useful to create sample sequences and load them on my Korg ESX-1 as “slice samples” (as in this video http://www.youtube.com/watch?v=lGctUPri1ew )
in order to do that, i could use samples with clear attack and end… otherwhise, after importing appended files, i’d separate the samples one by one in order to create a little silence between them…
but if there were an option to do that during the import… i’d find it more than useful!
do you think it could be possible to implement that? or any tip to save time on this operation?
thanks in advance and my compliments to the writers of this plugin!
You could also try my Plug-in: https://forum.audacityteam.org/t/arrange-your-tracks-with-chain-it-up-ny/26201/1
You import the files via the import menu.
Select all tracks and start the plug-in.
For a pause of 300 ms just enter 0.3 in the gap control.
Once the tracks are arranged, you can mix them down or simply export which will do the same.
A feature request has been made for Append Import - a way to mark the joins between the imported files.
It was suggested to insert silence at the joins but you could also label the joins or add split lines there (or perhaps only the C++ version could do that)…
Nyquist plug-ins can currently only return one “result”. Thus a plug-in can return audio (the appended track) OR labels, but not both on the same pass.
The split positions can be saved in RAM between one pass and the next, so it would be possible (though not hugely convenient) to run an effect twice, returning the audio on the first pass and a label track on the second pass.
When Nyquist plug-ins return audio, Audacity always renders the audio as one continuous audio clip. It is not currently possible to return more than one audio clip from a Nyquist plug-in. Thus “split lines” and “white space” are not possible from Nyquist plug-ins.
Perhaps a better option would be a development of the (new) “Align End to End” feature (Tracks menu in Audacity 2.0.4).
Something that I had this mind while developing “Align End to End” was another function that behaves similarly to Align End to End, but moves all of the audio tracks onto the same track (and removes the, then empty, tracks). I’ve been trying to think of a more user friendly name for this function than “Concatenate”. Any suggestions?
But would this add Split lines? I’ve been suggesting users do Tracks > Mix and Render to do what you suggest (which doesn’t add Split lines).
I’ve little doubt that a dedicated C++ Append Import with a file browser and customisations for “import first file at the cursor” and “methods to demarcate the joins” is the best way to go.