Audacity Version: 3.1.3
Windows OS: Windows 10 Pro
I’ve read around on https://audionyq.com/ , https://www.cs.cmu.edu/~rbd/doc/nyquist/index.html , https://manual.audacityteam.org/index.html. Ordered from most helpful to least.
I have a project which uses a looper and adds a new instrument in subsequent loops over time.
I have been able to successfully rip the stems out of the loop manually by using Audacity functions. To put it simply I…
- Copy the first loop.
- Paste onto a separate stereo track
- Align the pasted first loop with the second loop
- Invert the material
- Check the alignment by having both unmuted creating close to silence depending on static from recording quality and alignment.
- Track >> Mix >> Mix and Render to New Track
- …Rinse and repeat
So long as the first loop is aligned (almost) perfectly then the remaining ones will always be aligned.
I can do this alignment setup on the audio in advance and later work toward automating it. I’m not worried yet about the alignment.
For now let’s assume I have the audio aligned, each loop split into its own clip in the track as shown in the following image.
I’d like to make a Nyquist plugin to do most of the work for me since it’s a bunch of rinse and repeat iteration after the first alignment.
To breakdown the project I need to:
REPEAT AUDIO ***
CUMULATIVELY ADD INVERTED AUDIO
^^^ READ AND INTERPRET LABELS ^^^
REPEAT AUDIO ***
This is the main operation.
I haven’t found a straightforward way to do this yet.
I can mess with the entire track but I have yet to figure out copying specific areas.
I think the most ideal way to do this is to use the track-clips since I can split the main train and get clip data. However I’ve been having difficulty with converting clips and I’m starting to wonder if a clip is just a list of a start and end time (since that is what is returned) and maybe there is another way to extract(?) the audio between those times.
I can select the entire track and easily make sure the loop starts at time 0 (even though it has a preceding silence as seen in the image) That may help if I can get specific sections of audio within track.
- CUMULATIVELY ADD INVERTED AUDIO
After knowing how to capture specific segments of audio. I imagine this is the “easiest” part.
I want a variable that stores the inverted audio together and gets used to “rip” the stems from the loop. I’ve been manually using ~Tracks >> Mix >> Mix and Render to New Track~ and removing a single stem from the loop as I worked through it.
- ^^^ READ AND INTERPRET LABELS ^^^
This is the brains of the operation.
I’ll be typing the labels manually in advance as seen in the image.
However each loop has to only rip the stems out from whatever audio is within the labels.
A label seems to have three properties. Start, End, StringName.
Here the labels may be within a single loop instance (e.g. “flute”, “kazoo”, “choir”) or span over a few (e.g. “strings2”, “trumpets”, “piano2”). It is rare that a label will be exactly the same length of the loop (e.g. “piano”, “strings”).
As the loop is generated, a second addition may not happen until a few go arounds of the loop.
To put another way: using the image as an example. The first clip is silence. The second clip is the loop segment. The third clip doesn’t add anything to the loop since there are no labels, so nothing is “CUMULATIVELY ADD INVERTED AUDIO” until the fourth clip with the strings label.
To put yet another way: What will be cumulatively added in #2 (“CUMULATIVE ADD INVERTED AUDIO”) should be only what is within the labels. Silence can be used to pad whatever is not there.
I’m hoping that once I run the plugin I will obtain each stem.
That may be simply that the original track overwritten with the sound data of what was cumulatively added to the inverted audio…
Or, what I think is more advanced, each audio which was added cumulatively - as a separate track.
At which I export multiple files and import each into a DAW to mix together in a different way.
I understand that doing this I’m losing small artifacts depending on my recorded samples especially as I include instruments within similar stereo frequencies. I’ve plans to polish the sound afterwards.
I’ve considered using the “AUD-DO” command but that feels unnecessary.
HERE’s WHAT I HAVE ALREADY:
But I’m not against scrapping it.
NOTE: I’ve been doing my tests and learning on mono tracks knowing that I’ll have to do some work to get it using stereo. I’d prefer stereo.
I’m struggling with understanding:
- Getting specific areas of audio
- I’m misunderstanding the “extract-abs”
- I’m misunderstanding the “(s-rest 0)” function.
- I’m not understanding the “clip” data properties and how to use them in sim.
;;NOTE WORKS ONLY WITH MONO TRACKS SO FAR ;;Find clips (setf track-clips (get '*track* 'clips)) (setf start (get '*selection* 'start)) ;; Calculate the number of sounds in the selection. (setf cliplength (get-duration 1)) (setf repeatamount 6) (print cliplength) (setf total 360) ;total length required (seconds) ;; repeats the track a repeatamount number of times ;; ;; (let ( (sounddata (snd-copy *track*)) ) ;;Not entirely certain about extract-abs but otherwise returns nil. ;;Might use the absolute environment? (extract-abs 0 (mult repeatamount cliplength) (let ;;Set variables ( (loopoutput (s-rest 0)) ) ;;Loop through time (dotimes (i total loopoutput) ;;Add to output of loop the same sound starting at an absolute ;;position but relative to the selection? Since abs-env was not ;;used maybe this goes through the whole signal with the offset ;; already accounted for? (setf loopoutput (sim loopoutput (at-abs (* i cliplength) (cue sounddata) ) ) ) ) ) ) )