Arrange your tracks with 'Chain-it-up.ny'

Welcome to the presentation of my first plug-in

Regardless if you compose a new podcast, compile a CD with your favorite songs orcut your own audio drama, you have always to arrange and mix your tracks together. You all know the hard labour it takes to move your sounds to the right places, hence this plug-in.
chain-it-up.ny (17.7 KB)

  • any number of Tracks, mono or stereo.
  • Trimming of the sound
  • Noise below an arbitrary threshold is removed at the beginning and end.
  • Threshold goes from -120 db (digital Silence, as produced by Audacity) to 0 db.
  • The trimming is precise to one sample, regardless of the track length.
  • Chains the tracks (top to bottom) up, one after the other, i.e. in the time line.
  • Trimming only and alignement left also possible.
  • arbitrary gap (pause) or overlap (transition) in seconds or parts of it.
  • 4 Fading categories: no fade, Fade-in, cross-fade fade-out.
  • 7 Fading curves (linear quarter cosine, S-curve, gaussian bell, 3 x double S)
  • 4 selectable degrees of loudness correction for the transition.
  • Those range from equal gain (0 db) to equal power (3 db).
  • Audio preview of the transition (presumably Windows only).
  • Stepwise execution (and mix down in between via Audacity) possible.
  • 4 Help and example screens.
  • Reset to a new starting track by a parameter change or change of the selection length and other factors.
  • The new starting times/lengths of the tracks can be viewed in the debug window, along with other information.

Known issues of this version (0.301b)

  • The name may be confusing, but it is exact what it does.
  • I don’t know if it works with the chain command in Audacity and if this makes any sense anyway.
  • Since the tracks are moved by inserting silence before the start, the project’s file sizes increase rapidly if the tracks are not mixed down after the use of the plug-in.
  • I am no native english speaker, so the language in the help screens may be a little queer (Could you look into that, Gayle, please?)
  • Furthermore, the Help is too long and not formatted yet.
  • The code is not based on any existing plug-in, therefore the performance of some algorithms may be improved (Steve or Edgar?).
  • Tracks with different Samplerates may produce errors.
  • Long fading times slow the execution naturally down.
  • Other bugs, but Steve meant, I was too shy to public it… Hence this Beta release.

Please post your feed back and suggestions, that would be great.
Thanks a lot

Thanks for posting this, Robert. I am not a fade guru, so I will refrain from comment about fades other than wondering if the fade shapes should be a separate control so as to make the “Transition type” list more readable (note that visually impaired users cannot scan the list visually but have to have it read to them).

As a side note, I hope we will get a command into Audacity in the not too distant feature to align tracks end-to-end, and possibly an import appended feature too (and Steve has a separate append-import plug-in . Would any such built-in append features in Audacity cause you to redesign this?

Some issues I found…

I don’t think the plug-in should be called “Chain” anything, to avoid conflict with the Audacity “Chains” feature. “Trim and Append”?

If I am correct, this always does Trim, but does it always do Chain (which you call something else - arrange - in the help)? The help seems to suggest arrange is always done, but it seems to fail in this artificial example:

1 Create a tone of 30s, amplitude 0.1
2 select about 0s to 10s, generate tone amplitude 0.8 in the selection
3 Edit > Select All
3 Edit > Duplicate
4 Apply your effect, threshold of -20 dB, Trim & chain up, overlap +0.1
5 I see the amplitude 0.1 tone removed at the end of the tracks, but no append

If the 0.1 tone is e.g. at 10s to 30s in a 1 minute tone where the 0.1 tone is sandwiched between 0.8 tone, there is no trim at -20 dB threshold. I have not attempted to look at the code (I’m not a programmer) but how does the effect determine what is the start and the end of the track - is this proportional to the length?

“Trim and align left” does not align with time zero if it is the only track selected. Does “align left” mean “align with time zero”?

“Extras _Help” in the GUI should probably be called “Extras and Help”. Choosing “Force First Call” displays another Help screen with examples of fades. Should those examples not be called from its own separate menu item?

Generally I think you need to explain “first call” and “last call” in the help more than you do. What does “the first track of a previous call is encountered” mean? Is it to do with user changing the vertical order of tracks?

The Help screens should comply with conventions, notably maximum characters per line =50 and maximum lines per screen =25. This would mean cutting down text or more screens, or distributing help in an accompanying text form (or only in the Debug window, if that is even possible).

The transition preview is most interesting - preview is on the “Nyquist Wishlist” - see . Until then, can preview be provided more generally in this way in Nyquist plug-ins (e.g. “Preview 5 seconds”, “Preview 10 seconds”)?

That said, I think the current transition preview is way too short, I am not even sure it is playing what I would want to hear (e.g. one second of the track coming to an end and one second of the track following). The help doesn’t really explain any more what I am supposed to be hearing.

Finally “db” everywhere needs to be corrected to “dB”.


A nice plug-in. I can see it being useful in some situations, though there are also some problems (several are due to limitations of Nyquist in Audacity).
I’ve (deliberately) not read Gale’s response yet (so as not to colour my feedback).
Before moving onto the “issues” I’d just like to say that I think this is an impressive effect. I’ve not looked closely at the code, but I can see there are some interesting ideas.

Some of the known issues:

- The name may be confusing, but it is exact what it does.
From just the name, I had no idea what this effect might do. I assumed (wrongly) that it might be something to do with Chains.

- I don’t know if it works with the chain command in Audacity and if this makes any sense anyway.
As it is, no it doesn’t work with Chains.
Chains can be used either on external files (one file at a time) or on the current project. I thought that it might work on the current project, but it gets the times wrong.

- Since the tracks are moved by inserting silence before the start, the project’s file sizes increase rapidly if the tracks are not mixed down after the use of the plug-in.
Another option after running the effect is: “Edit > Clip Boundaries > Detach at Silences”.

- Tracks with different Samplerates may produce errors.
That does not appear to be a problem.

- Other bugs, but Steve meant, I was too shy to public it… Hence this Beta release.
No offence was intended. As you mentioned that you had created a plug-in, I was merely encouraging you to be bold. :wink: Thank you for sharing.

Other issues:

The other main issue is that for tracks that are not short, the effect uses a lot of RAM and is very slow. There’s probably not much that can be done about that as the entire track plus the leading silence needs to be calculated in RAM, so for compiling a CD that can be around 1.4 GB (assuming 44.1 kHz 32-bit float stereo). For compiling a CD I could perform the same operations a lot quicker manually than by using the effect.

I was also surprised that duplicate tracks were skipped.
What if the user wants to use the same audio clip more than once? It not only skips the one duplicate track, but then “looses it’s place” and starts a new sequence of tracks starting from the duplicate. I don’t see any user control to turn this feature off.

If trimming is not enabled (using one of the “Solely…” options) there is a problem if the tracks are different lengths that they do not line up correctly.

Undoing the effect, adding in a new track, and reapplying the effect can cause unpredictable results. This appears to be related to the plug-in “recognising” tracks.

Interface Issues:

For consistency with other plug-ins, the name should be capitalised.

The “Transition types” encounter the same problem as in my fade plug-ins. For most Audacity users the names are likely to be incomprehensible or at least cryptic. I doubt that many users would have any idea what (for example) “Solely fade-in Gaussian Bell” means. Similarly for “Scarcely correlated +2 dB”. Depending on the “target audience” for this plug-in, that may or may not matter, but for the “average” user, I feel that it is too complicated.

Other comments (not directly related to the plug-in).

Audacity produces digital silence at -infinity dB. If the track has an integer bit format and dither is enabled then silence generated by Nyquist will be dithered (unless rectangle dither is selected), so the “silence” that appears in the track will not be absolute silence.

Preview of the transition works in Linux (sort of), though not very well or reliably (due to bug 570)

Thank you guys for the detailed feed back. I have to reply in portions, it seems.

I am blind, therefore I know exactly what the output is alike. As a matter of fact, the accessibility issue is the point that brought me to writing my own plug-ins.
If one is a little familiar with the functionality of the plug-in, the navigation is actually quite easy. Let’s say I want to choose the cosine S-curve fade-in effect, all I have to do is starting the plug-in, press two times “tab” and then two times “s” and that’s it. What we could do is to take the trim modes to the very top.

"Action choice"
> Trim & append
> Trim & align at time zero
"Threshold for trimming"
"Transition type"
> No Fade effect
> Fade-out linear
> ...

This feature would only be helpful, if you exclusively want to trim without the application of Gap/overlap and cross fade. It would be much more important to enable Nyquist to see the start and end times of the current track/selection and to modify them…
I know Steve’s plug-in. But it lacks (through implementation issues of Nyquist) the ability to choose the files within a conventional file dialog. Furthermore, you can only apply a cross fade between different titles if you split the track again and position them manually, thus nothing gained.

Well, in the german version, the chain command has the hidious Name “Stapelverarbeitung”, what essentially means batch processing. But you’re right, “append” should certainly appear in the plug-in’s name. I firstly contemplated “append and fade” but I don’t want to be involved in your “fade effects battle”…
How about “Append and blend”?

The plug-in won’t chain up if one of the following tracks is the same as the first one (its therefore not suited for looping). If the program wouldn’t recognise the first track, the following would happen:
if the plug-in is called several times with the same selection, the lengths of the previous tracks would be added to the first selected track and thus all tracks would be moved to the right.
Chain-it-up tries to create a “finger print” of the tracks in order to compare them to the first track. It is just like the check sum of your bank account number and as different accounts can have the same check sum, so different tracks can have the same finger print. I am still trying to improve this algorithm, but there are limits.
The trim effect is necessary to determine the length of the track.
imagine that you have two tracks, one is three minutes and the other two minutes and you select them both.
Audacity gives the sounds in the following manner over to Nyquist:
The first is not modified, since it is the longest one. you can readily take their duration and length (get-duration and variable len), but you do not know this, therefore you have to look if there is digital silence in front or appended to the track. In the case of the second track, Audacity still gives a length of 3 minutes over. The program searches now for the zeros at the end and removes them, calculates the new length and stores it in a list that survives different calls.

You mean “Extras & Help”, that is what it should read like. I am going to change this.
The examples were inserted shortly before publication, the menu point is wrongly linked, will be corrected.

I presume you refer to the debug window output. This information was and is necessary during the development to see how the plug-in reacts in certain situations. I fancy that the “force first call” will be removed in the near future. It is maybe replaced by a “two track mode”. The first track handling is primarily internally important. The changing of the vertical order doesn’t influence the plug-ins execution, as long as any parameter is changed in a new plug-in call.

For visually impaired people, the normal output is useless anyway, since one can’t scroll in the text. We could keep the output very brief with the hint that the verbose version can be examined in the debug window. I intent to write a proper tutorial as soon as the functionality and layout of the plug-in is somewhat constant.

Yes, it could be generally be used, where it makes sense. It has some draw backs though, it doesn’t function properly on Linux it seems, on Mac, no one has tested yet. But it is surely an improvement for visually impaired people (which do not use Linux in general).

At the moment, it plays 0.5 s before a fade-out, after a fade-in and also 0.5 before and after a cross-fade. We can change this to 1 second. There are also some clicks, which could be removed to get a more pleasant preview.

I hope Mr Bell hasn’t seen that…
Thank you very much, Gale, that helped me a lot.

Thank you very much, such a statement is surely motivating, especially when it is made by an old stager.

Have you any proposal? I could have named it “String-it-up” but this suggests rather a hangman’s effect…
So far we have:

  • “Trim and Append”
  • “Append and Blend”

Should there also be a hint in the info line of the GUI? I personally do not like those Texts, since they are always read out by the screen reader, when you start an effect.

The idea to the plug-in is older than the possibility to execute Nyquist effects in chains. I presume that there is no possibility to check if the effect was started within a chain script, otherwise it could have been adapted for this case.

That’s interesting. I don’t work with clips though, since they’re not accessible.

It depends if the track with the different sample rate is the first or not. I did some correction but I am surprised that it yields no error any more. I need to check this.

Well, I am rather fastidious and do not like to present work that is only half done. However, the plug-in works fine to some degree and I’m happy to improve it due to the inputs from this forum.

Well, when I compiled a 1 hour CD with my favorite Dinah Washington songs, it took only a few minutes to process, a thing that I sure couldn’t have done myself in this time.

This should theoretically only be the case if the first track appears a second time. Maybe the first track detection will disappear altogether but it is necessary at the moment if the effect is applied several times (e. g. to deepen a fade-effector to apply it anew after a undo).

Trimming is always enabled (see last post). I have no explanation at the moment. Can you reproduce the bug?

It is a fairly complicated application flow thus it is hard to tell why this was the case.

In the title, the menu or where? Should it rather be “Chain It Up”, “Append And Blend” or something else?

Solely could be replaced by only. There must be a different leading character in front of the 3 fade types to facilitate the navigation per keyboard. The loudness control would be verbosely:

"Loudness control for sounds that are"
> equal (no mid-boost)
> fairly similar (+1 dB) 
> scarcely similar (+2 dB)
> different (3 dB mid-boost)

I don’t know how long the strings in the controls can be. I still hope to implement a half-automatic loudness control, that can be either enabled (up to equal power boost) or disabled (=equal gain).

Any consequences for my plug-in? is the default trimming threshold of -60 dB a good choice? If I am right, the dithering begins at about -71 dB. Should one test, which bit-rate is used?

As mentioned in another topic some time ago, it is a pity. The preview function is one of the highlights in this plug-in, because you don’t have to scroll thru an hour of music to hear the transitions.
Thank you very much Steve

To clarify, “dB” needs to be lower case d upper case B in GUI elements, error messages, debug messages and comments. Within the actual code it can, and usually will be lower case. I realise that this is a beta version, but if / when you have plug-ins ready for public release I’ll be happy to help with capitalisation and code indenting.

In that case, how about something like “Angekettet Spuren”?
I like the idea of having some reference to “Tracks” in the name.

I’ve now had a closer look at some parts of the code.
I like your novel approach to the “trim” function. I’ve not compared the performance to other methods but it looks like it should be pretty fast as it avoids any looping in LISP. It’s not necessarily the best way to do this in all situations as “snd-maxsamp” causes “sig” to be computed and saved in memory, but in this application it works really well. In the manual it is noted that snd-maxsamp “will probably be removed in a future version. See peak, a replacement”

I notice that you have posted while I have been typing, so I’ll post this now then read your reply.

It was previously common practice to include description and instructions in the GUI of Nyquist plug-ins but we are moving away from that now. Plug-ins that are available on the wiki are now documented on the download page. Plug-ins on the forum can be documented on the forum. Documentation can also be included as a separate file and bundled with the plug-in as a .ZIP download.

Hopefully in the future Nyquist (and other effect) will have a better mechanism for displaying help screens, so we are currently moving away from building help screens into the plug-ins. What I would like to see is a help button that links to a web page as this would allow direct linking to the manual.

I’ve only tested this briefly and may have missed problems.

Alpha / beta versions can be useful for getting feedback on ideas before spending a huge amount of time polishing all of the rough edges. I am very keen to encourage feedback both on plug-ins and on new Audacity features. “Experimental” features that may not persist into the finished versions can also be instructive or inspirational for other plug-in authors, for example I’ve been looking at your code for “zero crossing search” which has given me an idea relating to a granular synthesis effect that I’ve been playing with.

Performance varies a lot between different platforms. For some reason Nyquist tends to be a lot slower on Linux than on Windows. When I tested on a long CD, I cancelled the operation after 15 minutes processing time.

I’ll have a look and post back.

The ;name header text should be in Title Case.
For example:

;nyquist plug-in
;version 3
;type process
;categories ""
;name "Append Tracks Deluxe..."

Upper-case "A, upper-case “T”, upper-case “D”

The displayed menu item is about 15 characters, but the text is proportional spacing so it can be more or less.
When the menu is open, much longer text is visible in the menu.

Yes I noticed :smiley:

It does not seem to be specific to the trim options, but there is a problem …

Track 1: Generate 5 seconds sine wave
Track 2: Generate 4 seconds of white noise
Track 3: Generate 3 seconds of Pink noise.

Apply “Chain it up” with the default settings.
Move track 3 to the top.
Apply “Chain it up” with the default settings.

The spacing is wrong.

Apply Chain it Up with “force first call” (I’m attempting to “reset” the effect).
Help screen 6 is displayed 3 times.

Apply “Chain it up” with the default settings.

The spacing is still wrong.

At the very least, there needs to be a clear “reset” option.

The reset option will be removed. Normally, a reset is created by changing the selection (horizontally) or any of the plug-in’s parameters (except the help menu). As you know, the effect doesn’t realize that it is processing the last track of a selection, thus the control if the first track is encountered anew.
The Help menu is wrongly linked, as written above.

I really like the name “Append Tracks Deluxe” (although its not very modeste…).

The zero-crossing is in fact from some code that I wrote for the purpose of a granular synthesis. It delivers in the original a list of all zero crossings. It is fairly fast.
The slow part is actually only the reassemblying of the different sounds per “extract”. I’ll send you the code-snippet if you like.

Never mind about modesty :smiley:

I’d be interested to see it. If it’s open source then please feel free to post it in a new topic (the Nyquist forum board does not need to be full plug-ins. It’s fine to post snippets there.)

I’ve split the post about zero crossing detection to here:

I’ve split the post about passing track information from Audacity to Nyquist to here:

I really like the name “Append Tracks Deluxe” (although its not very modeste…).

“Duckling Management” from the way that baby ducks follow each other single file when they travel.

As I understand it, the process tries to find the audio in each sound file and assumes dead silence is useless? Can you turn that off? That removes pacing and meter control from the author of the show.

“And now, a moment of silence for our dead comrades…”


Unfortunately, artificially created silence will always disappear.
Let’s say we have three tracks:

  • Trk1 1 min intro music + 5 s silence
  • Trk2 2 s noise floor 1 min Music 5 s noise floor
  • Trk3 1 min outro 10 s fade-out.
    If all tracks are selected, the passed Sound to the plug-in has always the length of the longest track - 1 min 10 s.
    Thus the first track will be padded with 5 s Zeros (White space) and there’s no difference to the appended silence of 5 s (unless a dithering took place).
    The only Thing one can do is to set the threshold at -120 dB, this will only remove absolute silence and preserve the noisy floor from track 2.
    I think that graveyard silence is in any case something that spoils the Show (I am used to the romantic crackles of Vinyl inbetween Songs…).
    [possible Feature: fill gap with ambient noise instead of pure silence].
    However, it’s easy to process the tracks pairwise and to set the appropriate pause (“gap”), e.g. first two tracks with 5 s gap >> render result >> mixed and third track with other gap (or overlap) for the final stage.

By the way, we call it “Geese march”. Very pictoresque your idea though.
The meter and pace of the ducks shouln’t be disturbed too much - pauses within the Audio itself are not touched.
Thus, “Stop go stop go stop /+/ stop go stop” would give “go stop go Crash go” :smiley:.

Ps. The new Version is kicking about for some time, should really upload it before the decade Ends.

By the way, we call it “Geese march”. Very pictoresque your idea though.

My head does that unbidden.
I’m not wedded to ducks. Geese work for me.


That brings to mind those videos of ant death spirals where they follow each other until they starve. Geese are good. Natural comedians. GeeseMarch.ny.

Nice, so we call it “geese march.ny”,
The Progress Dialog says:
;Action “Managing Ducklings…” and all Ends up in a perfect mare’s nest.
If that’s not globanimal thinking…

LOL :smiley: