Append Import

I sometimes doubt that sufficient improvements to Nyquist will happen within the next few decades.

I would expect Feature Requests for a full Append Import feature will grow as a result of the Align End to End feature (useful as that is in its own right).


Gale

Tell me about it, :sigh: though most of the limitations do not come from Nyquist itself, but from the primitive interface provided by Audacity.

A “full Append Import feature” could certainly be useful.
I’d imagine that much of the demand will come from people wanting to stitch together broken projects (weird that I’ve never needed to do that).

The currently posted Append Import does not work in HEAD (Nyquist did not return audio) :

error: unbound variable - *FILE-SEPARATOR*
if continued: try evaluating symbol again
Function: #<FSubr-SETQ: #4108070>
Arguments:
  *DEFAULT-SF-DIR*
  (STRCAT (STRING-RIGHT-TRIM " \/" *DEFAULT-SF-DIR*) (STRING *FILE-SEPARATOR*))
Function: #<Closure-IMPORT: #4098e20>
Function: #<FSubr-IF: #41071e0>
Arguments:
  (< OUTPUT 2)
  (IMPORT)
  (MAKE-LABELS)
Function: #<FSubr-CASE: #4105480>
Arguments:
  VIEWHELP
  (1 (HELP))
  (2 (LABEL-HELP))
  (3 (LIMITATIONS))
  (T (IF (< OUTPUT 2) (IMPORT) (MAKE-LABELS)))
1>

It does work in 2.0.6 Release.

Gale

FILE-SEPARATOR is a predefined Nyquist variable (global). It should return the ASCII character for the file separator (OS dependent).

Please try this in the Nyquist Prompt (should work in both “normal” (version 4) and “legacy (version 3) syntax”:

(print *FILE-SEPARATOR*)

and press the Debug button.

The debug output on Linux is:

#/

which is correct.

On Windows it should return (in the debug window):

#\

I’m not sure what it should return on Mac OS X, I’d guess either the same as Linux or #:

On Mac it returns the same as Linux.
– Bill

For both Version 3 and 4 the debug output is:

error: unbound variable - *FILE-SEPARATOR*
if continued: try evaluating symbol again
1>

In 2.0.6, as expected:

#\

Sample Data Export is broken as well in HEAD:

error: unbound variable - *FILE-SEPARATOR*
if continued: try evaluating symbol again
Function: #<FSubr-SETQ: #4120858>
Arguments:
  FILESEPARATOR
  (FORMAT NIL "~a" *FILE-SEPARATOR*)
Function: #<Closure-FILEWRITER: #4109a28>
1> sample-data   1 channel (mono)
Sample Rate: 44100 Hz. Sample values on dB scale.
Length processed: 100 samples 0.00227 seconds.


error: unbound variable - FP
if continued: try evaluating symbol again
Function: #<FSubr-CASE: #411dc68>
Arguments:
  HEADER
  (0 (FORMAT T (NORMHEAD)) (FORMAT FP (NOHEAD)))
  (1 (FORMAT T (NORMHEAD)) (FORMAT FP (MINHEAD)))
  (2 (FORMAT T (NORMHEAD)) (FORMAT FP (NORMHEAD)))
  (3 (FORMAT T (NORMHEAD)) (FORMAT FP (FULLHEAD)))
Function: #<Closure-PRINTDATA: #410b098>
Function: #<FSubr-IF: #411f9c8>
Arguments:
  (= FILEFORMAT 4)
  (PRINTHTML)
  (PRINTDATA)
Function: #<FSubr-PROGN: #41202d8>
Arguments:
  (PUT-HEAD-INFO)
  (IF (= FILEFORMAT 4) (PRINTHTML) (PRINTDATA))
Function: #<FSubr-IF: #411f9c8>
Arguments:
  (> (LENGTH ERR) 0)
  (IF (= MESSAGES 2) (S-REST 0) (FORMAT NIL "Error.~%~a" ERR))
  (PROGN (PUT-HEAD-INFO) (IF (= FILEFORMAT 4) (PRINTHTML) (PRINTDATA)))
Function: #<FSubr-SETQ: #4120858>
Arguments:
  FILESEPARATOR
  (FORMAT NIL "~a" *FILE-SEPARATOR*)
Function: #<Closure-FILEWRITER: #4109a28>
2> 1>

Gale

It’s working fine here with revision 13651, and I’m not aware of any recent changes relating to that.
FILE-SEPARATOR is defined in Nyquist, not in the plug-in or even in the Audacity code.

Do you get the same errors from these commands?

(print *default-sf-format*)
(print *default-sf-dir*)

.

Windows nightly 26th November, the file system.lsp is missing from the nyquist folder.
It was there in the nightly 23rd Nov.

It looks like some sort of build error. Copying that file from the 23rd to the 26th should fix the problem.

Use Case: User wants all the “songs” on a classical CD to become a single “song” - a complete symphony say - so that when played on iPod shuffle you don’t get disjointed brief segments of the work ( the Classic FM effect … ).

Peter.

Thanks for seeing that. Yes, there have been problems after the transition to VS2013 with some plugins and MO files not getting copied to the build folder. This is another issue - system.lsp is not copied from the source tree when building Audacity. For the build on the 26th I used the contents of the build folder instead of the source tree content. I’ll take a look.

However Sample Data Export still doesn’t work in HEAD with system.lsp added back. Here is the updated debug output:

error: bad argument type - NIL
Function: #<Subr-STRCAT: #3fd1ca8>
Arguments:
  NIL
  "/"
Function: #<Closure-FILEWRITER: #3f80640>
1> sample-data   2 channels (stereo)
Left channel then Right channel on same line.
Sample Rate: 44100 Hz. Sample values on dB scale.
Length processed: 100 samples 0.00227 seconds.


error: unbound variable - FP
if continued: try evaluating symbol again
Function: #<FSubr-CASE: #3fd2a58>
Arguments:
  HEADER
  (0 (FORMAT T (NORMHEAD)) (FORMAT FP (NOHEAD)))
  (1 (FORMAT T (NORMHEAD)) (FORMAT FP (MINHEAD)))
  (2 (FORMAT T (NORMHEAD)) (FORMAT FP (NORMHEAD)))
  (3 (FORMAT T (NORMHEAD)) (FORMAT FP (FULLHEAD)))
Function: #<Closure-PRINTDATA: #3f860e0>
Function: #<FSubr-IF: #3fd2918>
Arguments:
  (= FILEFORMAT 4)
  (PRINTHTML)
  (PRINTDATA)
Function: #<FSubr-PROGN: #3fd27d8>
Arguments:
  (PUT-HEAD-INFO)
  (IF (= FILEFORMAT 4) (PRINTHTML) (PRINTDATA))
Function: #<FSubr-IF: #3fd2918>
Arguments:
  (> (LENGTH ERR) 0)
  (IF (= MESSAGES 2) (S-REST 0) (FORMAT NIL "Error.~%~a" ERR))
  (PROGN (PUT-HEAD-INFO) (IF (= FILEFORMAT 4) (PRINTHTML) (PRINTDATA)))
Function: #<Subr-STRCAT: #3fd1ca8>
Arguments:
  NIL
  "/"
Function: #<Closure-FILEWRITER: #3f80640>
2> 1>

There is no problem on a 7 November build which I still happen to have, but builds from 22 November and 23 November also fail with Append Import.

After adding back system.lsp, Version 3 and version 4 output for the following in Nyquist Prompt

(print *FILE-SEPARATOR*)

is as for Linux:

#/

instead of what it should be:

#\

Gale

Well there is clearly something more that is broken on Windows (Sample Data Export works here).
Unfortunately there’s not such a good clue in the error this time as to where the problem lies, and as I don’t see the problem on Linux I can’t easily troubleshoot it.

It’s the system file for Linux and not the one for Windows.
This does probably also apply to the Mac.
However, I don’t know where this replacement should happen during the build.

It seems that using lib-srclibnyquistnyquistsyswinmsvcsystem.lsp solves the problems with Append Import, Sample Data Export and file separator.

According to Audacity.xcodeproj, nyquist/system.lsp is used on Mac (same as on Linux). Append Import, Sample Data Export and file separator (/) seem to work correctly on Mac.


Gale

Is there any possibility that this plugin will ever support compressed files such as mp3?

Not in the near future, because MP3 decoding is not supported in Nyquist.
For full details of supported formats and modes, see here: Nyquist Functions

Hello! It seems plugin doesn’t work with Audacity 2.3.2 on windows 7. No way to enter path to Import Folder. In Audacity 2.2.2 it works as expected.
This is how Append Import window looks in 2.3.2:

This plug-in should really be updated to a “version 4” plug-in, but in the meantime, here’s a version that should work in all 2.x versions of Audacity:
AppendImport.ny (9.68 KB)

Thanks! This version works.