Audacity Aids for Creating Perfect Loops

Attention: Steve, as you mentioned something about this in one of your post replies and I am unable to find it.

I would like to get educated on the tools and plugins in audacity to synchronize the starting and ending parts of an audio for perfect looping.

  • I know Zero Crossing on Select is one nice tool.
    But I am looking for ways to see a band of audio region at the beginning and at the ending of a selection,
    side by side, for matching the patterns a d adjust start and end points for seamless looping.
    Zero Crossing alone cannot do this. While it can be considered a key pre-requisite, the music at the higher level also needs have a smooth flow, without discontinuities.
    I am toying with some ideas, but would like to leverage whatever is available already, rather than try to reinvent something, possibly inferior and/or not reliable.

Thanks in advance

Sri.

There are some tips here: https://manual.audacityteam.org/man/tutorial_looping.html

Also, if you enable the “Full” set of keyboard shortcuts (see: https://manual.audacityteam.org/man/keyboard_preferences.html) then you can use:
Ctrl + [” to jump to the start of the selection.
Ctrl + ]” to jump to the end of the selection.

Thanks for the tips Steve. Will try to use them. If there are no plugins for this, it may be good create one, if it is feasible. If you can be the Guru, I can follow your directions and start to create one.

Here are my thoughts. Please feel modify this as needed, as I may not be thinking in “Audacity-Nyquist” paradigm.

  1. Start the Plugin.
  2. Indicate the Track
  3. Select a region for the loop
  4. The plugin would create a new track for interactions
  5. Will show the Start Region and the End Region side by side on that new track [with some visual gap between the two]
  6. Plugin will show a band of L1,L2, R1,R2 seconds of audio region around the Left Point and Right Point
  7. User can adjust these values as needed, as well nudge/move the Left and Right Points
  8. Zoom in/out will be available to examine the left and right points and regions at the right zoom level (Note1)
  9. Zero Crossing can be also invoked on the Left and Right Points
  10. One can play the whole loop, or just the End Band followed by the Start Band skipping the audio in between
  11. Clicking Done will transfer the points precisely on the original track and also add a convenient marker.

This should be plenty to get started, before adding advanced “find” algorithms (which I will hold off for now)

Note1: Just like in case of Maps, it is very useful to show the big picture as well as the small picture at the same time.

Thanks in advance Sri.

Steve one another quickie…

Is there a way to make a selection in the audio track and create a loop region?

I can see that it is already possible to set selection to the loop region.

Thanks Sri.

I would like to get educated on the tools and plugins in audacity to synchronize the starting and ending parts of an audio for perfect looping.

Why? Do you have an actual end goal? That’s important because some goals or jobs demand different qualities in a loop than others.

Zero crossing and matching waveshapes is pretty obvious, but you also mentioned music matching. That snaps you from fractional second waveshape surgery to avoid clicks and pops; to every two or three minute musical phrase matching. A very different prospect. In some cases, once you get the music to match, super accurate waveshape matching might be a waste of time.

And, as mentioned in the tutorial, don’t use MP3. MP3 doesn’t have good end of file management, partially because of its heritage as the sound track for a video format. Its full name is MPEG-1, Layer 3. Since a raw, lonely MP3 has no video track framing to lean on, its stop and start times tend to be wonky (technical term).

So do you have an actual job?

Koz

Dear Koz

I hope your note was not intended to be intimidating or condescending, as it may be coming out that way in general, and specially due to the last line. Please let me know and so I can suitably respond with utmost professional collegiality.

br Sri.

not intended to be intimidating or condescending

Neither one. But this line does ring alarm bells.

… the music at the higher level also needs have a smooth flow, without discontinuities.

“Music” takes you out of the region of pre-baked tools, macros, chains, effects, and filters, and into the realm of right-brain creative, musical structure, and productions that “feel right.” Ask Steve how it works when someone creates a musical passage with a half-beat missing in the middle. This music thing isn’t easy.

So this is a good place to find out if that’s what you really wanted? Being able to define a goal is good. Any goal. Are you writing a paper? If you are, are you contributing to the Audacity manual?

would like to leverage whatever is available already, rather than try to reinvent something, possibly inferior and/or not reliable.

Granted, but also possibly design better or inject valuable but missing tools? Those are good goals.

Koz

Yes, use Transport > Looping > Set Loop to Selection or its shortcut Shift + L

Peter

That would be nice, but it can’t be done with a Nyquist plug-in.


You can do that:

Older Audacity:

  1. Create a selection for the loop
  2. Shift + Click on the Time at the point where you want playback to start.

New Audacity:

  1. Create a selection for the loop
  2. Click the “Loop” button
  3. Click on the Time at the point where you want playback to start.
    (4. Click the Loop button again to turn off loop mode.)


    While playback is looping you can adjust the loop start / end positions.
    Right click on the Timeline and ensure that “Enable dragging selection” is enabled, then:

Older Audacity:
Shift + Click and drag on the edge of the selection

New Audacity;
Click and drag the loop point indicators

Make a selection in the audio track in the usual way (for example, click and drag.

In older Audacity:
Nothing else needed - Older Audacity automatically uses the selection as the loop region.


New Audacity:
If this is the first time that Loop has been used:
Click the loop button. The selection will be used to define the loop region.

All subsequent uses of Loop:

  1. Make the selection in the usual way
  2. Right click on the Timeline and select “Set Loop to Selection”.

:smiley:
“Task” is the word Koz. “What is the actual task”, not “do you have a job”.

Peter/Steve

Thanks for your precise tips/directions. Extremely useful.

Such things may appear to be trivial things to you, but wonderfully expands my thinking for organizing and executing my tasks.

Thanks also for clarifying what will not be possible to do on Nyquist.

regards Sri.

Dear Koz

(Sorry of this personalized conversation here, but thought it is best put it here in context)

I am very happy to see your assuring clarification.

Pardon my indulging in a bit of self-bugling… let me assure you that I do not compromise on rigorous and disciplined thinking including maximum due respect to mundane, in things I attempt to do. By default, I consider that everyone does that same as well, even though this may not hold up.

This orientation, whatever reasons I have happen to come by it, has served me very well in my long Academic and Industry career.

Now I am retired from corporations, and blissfully pursuing my life long passions. MUSIC is at its core - in its arts, technology and research forms. All for nothing but self-fulfillment - whether it resonates with others or not, or whether it conforms to existing paradigms or not.

Not only I consider Audacity as an exceptional enabler, but this forum with its avid users and extremely helpful responsive staff (like Steve, You and others) are an integral, vibrant and inevitable part of that environment.

Kudos to all of you and I am very happy that you are all part of my journey of discovery and exploration.
I do hope to contribute back to audacity in some form/ways downstream.

regards Sri.

Steve

Let me know if I am overlooking something.

a) Set Loop to Selection. I got this. No issues.
b) Set Selection to Loop. How do you do this? Did I miss this in your note?

Thanks Sri.

Hi Sri,

I don’t think there is a command for this. perhaps there should be.

The workaround is to move your cursor in the track waveform, when you get close to the edges of the loop range in the Timeline you should see yellow snap guides appear (these are sticky with respect to the loop range edges) and this should facilitate accurate selection.

Peter.

I thought that this was a good idea so I wrote an enhancement request for this on GitHub
https://github.com/audacity/audacity/issues/2395

Peter.

Thank you so much Peter. For confirming that there is no command at present and making a request for it.

regards Sri.

I owe it to you and Steve to give you a glimpse of what I am creating.

I played a song on iPad/Geoshred and recorded it on Audacity.
I manually marked various sections of the audio and gave them labels.
I exported the audio as wave and the labels.

Now I wrote my Song Specs, for the combining the labeled audio in very flexible and alternate ways.
My python audio composer parses the Specs file and Acts on the Specifications.
Below is an illustration of the Specs file.
Hopefully things are self evident for needing notes and explanation, as I would be writing them diligently later
when I am ready to share the utility publicly.
There are all kinds of features supported but only some are illustrated in the specs below.

I am attaching an example of the end product – an MP3 file. (*** Error File Too Large for attaching. So I I will create and attach a smaller file asap)

I will be using this in a Video for uploading to YouTube.

regards Sri.

=================================================================

Sri Python Audio Composer Song Specs

Mere Baat Rahi Mere Man Me 122121

All Times are in Seconds

beg, end, fadein, fadeout, cfade, shift, where

#-----------The main audio file ----------------
filespec BaatRahi skip:no
fname BaatExp1.wav
dir D:/VideoProjs/Baat122021
mode in
slice full beg:0 end:0
labels Labels_BaatExp1.txt
end

----------The drone audio ----------------

filespec ShruthisB skip:what
fname ShruthisB.wav
dir D:/VideoProjs/Baat122021
mode in
slice shfull beg:0 end:0
slice shtest beg:0 end:419
end

------------Output file Spec --------------

filespec outFile1 skip:what
fname BaatRahiSoft.mp3
dir D:/VideoProjs/Baat122021
mode out
end

----------------------------

markers add audio at the junction points so I can know what part is playing.

By setting markers: yes or markers:no I can turn them on/off

while keeping the specs in place.

Any slice of audio can be merged to different places as needed

With fadein, fadeout, cross fade, number of times, vol/pitch/speed changes etc.

One Take on the Song Arrangment

song Final1 skip:no markers:no
audio file:BaatRahi label:Meri1 marker:beep1
audio file:BaatRahi label:Inter1 cfade:0.180 marker:beep2
audio file:BaatRahi label:Mere2 cfade:0.180 marker:beep3
audio file:BaatRahi label:SapneAdhure2 cfade:0.420 marker:beep4
audio file:BaatRahi label:SapneAdhure2 cfade:0.200 marker:beep5
audio file:BaatRahi label:OhRasiya1 cfade:0.180 marker:beep6
audio file:BaatRahi label:OhRasiya3 cfade:0.200 marker:beep7
audio file:BaatRahi label:OhRasiya6 cfade:0.200 marker:beep8
audio file:BaatRahi label:Pyaasa3Times cfade:0.200 marker:beep9
audio file:BaatRahi label:Mere4 cfade:0.500 marker:beep10
audio file:BaatRahi label:SapneAdhure3 cfade:0.350 marker:beep11
audio file:BaatRahi label:OhRasiya4 cfade:0.200 marker:beep12
audio file:BaatRahi label:Pyaasa3Times cfade:0.200 marker:beep13
audio file:BaatRahi label:Mere4 cfade:0.400 marker:beep14
audio file:BaatRahi label:SapneAdhure3 cfade:0.330 marker:beep15
audio file:BaatRahi label:Mere6 cfade:0.250 marker:beep16
audio file:BaatRahi label:Mere7 cfade:0.280 marker:beep17
audio file:BaatRahi label:SapneAdhure2 cfade:0.300 marker:beep18
audio file:BaatRahi label:End1 cfade:0.20 marker:beep19
audio file:ShruthisB label:shtest where:0 fill:song vol:-16 marker:beep20
out outFile1 Dec25B vol:2 fadein:3 fadeout:3 mtap:mt1
#trans outFile1 width=12 gap:5 sfx:sricomp5
end

Another take on the song

song Final2 skip:no markers:no
audio file:BaatRahi label:Meri1 marker:beep1
audio file:BaatRahi label:Inter1 cfade:0.180 marker:beep2
audio file:BaatRahi label:Mere2 cfade:0.180 marker:beep3
audio file:BaatRahi label:Inter1 cfade:0.180 marker:beep2
audio file:BaatRahi label:SapneAdhure2 cfade:0.420 marker:beep4
audio file:BaatRahi label:OhRasiya1 cfade:0.180 marker:beep6
audio file:BaatRahi label:SapneAdhure2 cfade:0.200 marker:beep5
audio file:BaatRahi label:OhRasiya3 cfade:0.200 marker:beep7
audio file:BaatRahi label:OhRasiya6 cfade:0.200 marker:beep8
audio file:BaatRahi label:Pyaasa3Times cfade:0.200 marker:beep9
audio file:BaatRahi label:Mere4 cfade:0.500 marker:beep10
audio file:BaatRahi label:SapneAdhure3 cfade:0.350 marker:beep11
audio file:BaatRahi label:OhRasiya4 cfade:0.200 marker:beep12
audio file:BaatRahi label:Pyaasa3Times cfade:0.200 marker:beep13
audio file:BaatRahi label:Mere4 cfade:0.400 marker:beep14
audio file:BaatRahi label:SapneAdhure3 cfade:0.330 marker:beep15
audio file:BaatRahi label:Mere6 cfade:0.250 marker:beep16
audio file:BaatRahi label:Mere7 cfade:0.280 marker:beep17
audio file:BaatRahi label:SapneAdhure2 cfade:0.300 marker:beep18
audio file:BaatRahi label:SapneAdhure3 cfade:0.330 marker:beep15
audio file:BaatRahi label:End1 cfade:0.20 marker:beep19
audio file:ShruthisB label:shtest where:0 fill:song vol:-16 marker:beep20
out outFile1 Dec25B vol:2 fadein:3 fadeout:3 mtap:mt1
#trans outFile1 width=12 gap:5 sfx:sricomp5
end

======================

P.S.
I cannot do such laborious explorations and trials on Audacity or any other UI.
These require specification languages, scripts/API, parsers and song generators.

Looping is important - if I want to play a section more than once, with different volumes, speeds, effects etc.
The other important thing is to get smooth musical flow when I combine pieces in different orders than the way I played originally.
I am tackling these for my own needs, as well as to develop conventions and procedures which will help (and possibly others) for doing these things, efficiently through automation.

Music is not only about playing, but also giving shape to imaginations, expressions and creativity - whether or not one is physically capable of executing them. MIDI while being simple, has significantly enabled this through automation by tools.