How to perform boolean AND operation on tracks

Context: Audacity 3.2.4
I have two sections of a song with extremely similar instrumentals but different vocals - see VerseA and VerseB files. Alignment and inversion of these tracks substantially reduces the instrumental while preserving the vocals but mixed together - see VerseCancel file.

https://mega.nz/folder/KzAjhbRK#mWmpbPNCmwrKy5FKg-_PLA

I think a boolean AND operation would allow me to separate the common audio between the tracks, and reduce the instrumentals on each file separately allowing me to isolate the vocals more cleanly using ai vocal isolation. I’ve already attempted something similar using centre isolation - get the left channels from each track, pan them left and right, mix into a stereo track, and do a centre isolation on them - then repeat with the right channels to create a new stereo track. However, this process leaves remaining un-common parts.

Boolean is for digital ones & zeros. 16-bit digital holds values between −32,768 and +32,767. A logical AND between two integer values will give you a 1 except when both values are zero. That’s not “audio”. A bitwise AND would give “meaningless” results and it would sound like random noise.

Alignment and inversion of these tracks substantially reduces the instrumental while preserving the vocals but mixed together - see VerseCancel file.

That only works if the two instrumentals are derived from the same original, or if they are generated digitally so they are VERY close at the digital level or at the “microsecond” level. For example, if you record yourself saying “hello” twice, subtraction and addition will sound almost identical… Either way, you’ll get a mix and it will sound like you and your twin saying “hello” together. If you make a copy of the same file it will subtract to silence or sum to double the volume (just like the Amplify effect).

The “old” vocal removal technique subtracts left from right sample-by-sample, or analog subtraction can be done moment-to-moment. The more advanced Vocal Reduction and Isolation work in the frequency domain (using FFT) to look for similar or different frequency information rather than working with the sample data.

There is also something “more advanced” called [u]Spleeter[/u].

Got a few things to add/clarify:

  1. I see what you mean about boolean logic only really working for binary operations. Is there another method to isolate just an intersect? I’m thinking possibly intersecting amplitude on a waveform point (i.e. At one point the amplitude is 0.2 one one track, and the other track is 0.4, give an amplitude of the lower value (0.2) at that point for the result).

  2. The instrumentals are mainly digitally generated, the exception being the drums (as you can hear on VerseCancel, the only instrumentals remaining are drums and miscellaneous noises). The files I’m using are from the .FLAC digital version of an album, so compression artefacts are not a concern.

  3. I don’t need the intersect to sound meaningful on it’s own - I just need it to be able to reduce the instrumental without removing any part of the vocals upon inversion. I’m already reasonably familiar with AI vocal removal/isolation and have done previous projects involving it, which have been pretty successful in my opinion. I’ve found that getting the instrumental quieter through methods such as phase cancellation generally improves results from AI which is why I’m trying to do this. My attempts with centre isolation were more about getting intersects than producing anything useful on its own - this song has so many channel specific vocal layers that centre isolation is basically useless for direct vocal isolation.

At one point the amplitude is 0.2 one one track, and the other track is 0.4, give an amplitude of the lower value (0.2) at that point for the result

I assume that can be done in [u]Nyquist[/u] but I’d be surprised if you get the results you’re expecting.

…I’ve never used Nyquist. I’ve done a fair amount of programming in various languages but never any audio programming. Greater-than and less-than, etc., and conditional execution (“if statements”) are common to every language I’ve used. :wink: