Combining Analyze and Equalize

This read-only archive contains discussions from the Adding Feature forum.
New feature request may be posted to the Adding Feature forum.
Technical support is available via the Help forum.
kozikowski
Posts: 71198
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Combining Analyze and Equalize

Post by kozikowski » Sat Jan 19, 2013 6:00 pm

Once again I wish for a tool that could take the result of Analyze and apply it to Equalize.

Run Analyze and free-hand draw the general outline of the lumps and bumps in the curve.
drawCurve.jpg
drawCurve.jpg (120.87 KiB) Viewed 10310 times
Save the drawing and apply it to the Equalize display insuring that the cardinal frequency points overlap, even if the gain/loss values don't.
combo.jpg
combo.jpg (96.29 KiB) Viewed 10310 times
Obvious ad-lib extensions are flip the curve top to bottom and Ultimate Ad-Lib where the curve automatically applies itself.

Koz

billw58
Posts: 5758
Joined: Wed Aug 12, 2009 2:10 am
Operating System: macOS 10.15 Catalina or later

Re: Combining Analyze and Equalize

Post by billw58 » Sun Jan 20, 2013 7:54 pm


kozikowski
Posts: 71198
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Combining Analyze and Equalize

Post by kozikowski » Sun Jan 20, 2013 9:44 pm

Yes. There are certainly shortcomings to this idea and I spent all of about a minute and a half thinking about it, but I'm tired of sketching the analyze on an envelope so I can apply corrections in the equalizer with some accuracy.

"Let's see. There was a hump about 400Hz and it's about yo much wide give or take and then there's a gradual dip as you go up and I'll mess with it until it sounds right."

I think Steve posted some programs do this and it doesn't work as well as you would think, which just means thinking is required. Highlight tool?

"I think this is a room resonance hump [dragging to the right] and I want it to go away."

This is far different from "flatten everything out." That's a good way to remove the expression from a show.

Also, this gets into Magic Drawing. When you move a brightness curve in Photoshop, you don't get one point. You get a suite of points to gracefully fold your correction into the rest of the show. Corel Paint doesn't do this and their brightness tool, as far as I can tell, is use-free.

The illustration is of a suite of brightness curves and corrections I generated with only two manual points. Straight line is normal.

Koz
Attachments
curves.png
curves.png (39.63 KiB) Viewed 10284 times

steve
Site Admin
Posts: 84904
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Combining Analyze and Equalize

Post by steve » Mon Jan 21, 2013 5:36 am

Here's an experimental plug-in for you to try.

There's some pretty strict limitations for this plug-in and not much error checking.
If you get errors or nonsense, check the instructions, check the file paths, and if it still does not work, use the "Debug" button and post the debug output.

Instructions:
Install in the usual way - put it in the Audacity plug-ins folder and restart Audacity. The plug-in should appear in the Analyze menu with the name "Spectrum to Eq Curve..."

Generate a Spectrum text file by exporting from Plot Spectrum.
Use "Size = 128" in Plot Spectrum.

[Update: This is no longer the case: Note that Plot Spectrum Export does not overwrite files of the same name - it appends.]

The spectrum text file must contain only one set of 128 spectrum points, so if you wish to use the same file name again, delete the old file first.
spectrum2eq.png
spectrum2eq.png (30.56 KiB) Viewed 10270 times
"Input Spectrum text file" must be the full path and file name of the exported spectrum text file.,for example:
/home/username/spectrum-files/spectrum.txt
or
C:Documents and SettingsusernameDesktopspectrum.txt

"File / curve name" is the name of the Eq curve that you are going to create for the Audacity Equalization effect. The same name will also be used for the exported XML file. Do not add a file extension, it will be added automatically.

"Save file to" is the full path to where you wish to save the XML file, for example:
/home/username/xml-files/
or
C:Documents and SettingsusernameDesktop

"Invert Spectrum" creates an Eq curve that is upside down from the spectrum. You can use this to "neutralize" the spectrum of a track before applying a new spectrum profile,

"Offset curve by (dB)" will shift the equalization curve up or down by the specified dB. This will be required if the Eq curve goes too far "off the scale".


Things that I can't do:
I can't add a file browser to the effect - Nyquist plug-ins do not have file browsers - that's a feature request for Audacity.
Do the spectrum analysis or the equalization directly in the plug-in - well I possibly could eventually, but FFT is a bit of a nightmare in Nyquist.

This is one effect that I think really does need to be coded in C/C++, unless Nyquist plug-ins get a file browser which I don't see happening any time soon. However this plug-in may gives some insight into whether such a plug-in is actually useful, and what features it would need, etc.
Attachments
SpectrumToEqCurve.ny
(2.53 KiB) Downloaded 1036 times
Learn more about Nyquist programming at audionyq.com

waxcylinder
Posts: 15154
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10 / 11

Re: Combining Analyze and Equalize

Post by waxcylinder » Wed Feb 20, 2013 10:12 am

@Koz: have you tried Steve's experimental plugin - did it work for you - does it do what you need?

Peter.
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

kozikowski
Posts: 71198
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Combining Analyze and Equalize

Post by kozikowski » Wed Feb 20, 2013 3:40 pm

I'm experiencing a "talent curse." "Say, Koz, I'm having trouble making my web page look right, can you help?" "I need a simple web page to display my paintings -- and I'm heavily techophobic." "Oh and I need a business card, too, but I have no idea what my business name is."

All that and I'm setting up a stand-up desk in my home office and moving the computers and Killer Sound System (registered trademark).

[sigh]

Why can't all this stuff happen evenly distributed on a timeline?

Koz

kozikowski
Posts: 71198
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Combining Analyze and Equalize

Post by kozikowski » Mon Feb 25, 2013 7:40 pm

OK. I'm back. I'm wading through the instructions.
Koz

kozikowski
Posts: 71198
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Combining Analyze and Equalize

Post by kozikowski » Tue Feb 26, 2013 12:29 am

You don't realize how much you rely on the directory/folder tools in file management.

/Users/koz/Desktop/spectrum2.txt

Code: Select all

Frequency (Hz)	Level (dB)
344.531250	-10.044029
689.062500	-9.829976
1033.593750	-13.625548
1378.125000	-15.817608
1722.656250	-18.604933
2067.187500	-20.564348
2411.718750	-20.552774
2756.250000	-21.192760
3100.781250	-22.203526
3445.312500	-23.430639
3789.843750	-24.703487
4134.375000	-25.709158
4478.906250	-26.961905
4823.437500	-27.597525
5167.968750	-28.181555
5512.500000	-28.709917
5857.031250	-28.952936
6201.562500	-28.229807
6546.093750	-29.350267
6890.625000	-30.804392
7235.156250	-31.274818
7579.687500	-31.396988
7924.218750	-31.767759
8268.750000	-32.658550
8613.281250	-33.185520
8957.812500	-33.472633
9302.343750	-33.919762
9646.875000	-34.270081
9991.406250	-34.293999
10335.937500	-34.966835
10680.468750	-35.525421
11025.000000	-35.912636
11369.531250	-36.094578
11714.062500	-36.580418
12058.593750	-36.976967
12403.125000	-37.383499
12747.656250	-37.753876
13092.187500	-38.148346
13436.718750	-38.737484
13781.250000	-39.318859
14125.781250	-39.786343
14470.312500	-40.016136
14814.843750	-40.333366
15159.375000	-40.627449
15503.906250	-40.977657
15848.437500	-41.280716
16192.968750	-41.481495
16537.500000	-41.778641
16882.031250	-42.190605
17226.562500	-42.624786
17571.093750	-43.168465
17915.625000	-43.767708
18260.156250	-44.396236
18604.687500	-45.299866
18949.218750	-45.629063
19293.750000	-45.598957
19638.281250	-47.805206
19982.812500	-49.817646
20327.343750	-51.408566
20671.875000	-53.051270
21016.406250	-54.803005
21360.937500	-56.306866
21705.468750	-57.562160
/Users/koz/Desktop/AirTraffic
(output file)

Nyquist
Nyquist did not return audio. [OK]

Koz

Code: Select all

error: bad argument type - NIL
Function: #<Subr-CLOSE: #1bf0528>
Arguments:
  NIL
Function: #<FSubr-PROGN: #1bf20a0>
Arguments:
  (SETF STRINGLIST (EXTRACT-NUMBERS STRING))
  (SETF EQSTRING (FORMAT NIL "<equalizationeffect>nt<curve name="~a">" FNAME))
  (DO ((I 1 (+ I 2))) ((>= I (LENGTH STRINGLIST))) (WHEN (NOT (NUMBERP (NTH I STRINGLIST))) (SETF (NTH I STRINGLIST) -120)) (SETQ MAXGAIN (MAX MAXGAIN (NTH I STRINGLIST))))
  (DO ((I 0 (+ I 2))) ((>= I (LENGTH STRINGLIST))) (SETQ GAIN (+ OFFSET (IF (= INVERT 0) (- (NTH (1+ I) STRINGLIST) MAXGAIN) (- MAXGAIN (NTH (1+ I) STRINGLIST))))) (SETF EQSTRING (FORMAT NIL "~a~%t<point f="~a" d="~a"/>" EQSTRING (NTH I STRINGLIST) GAIN)))
  (SETQ FP (OPEN OUT-PATH :DIRECTION :OUTPUT))
  (FORMAT FP "~ant</curve>n</equalizationeffect>" EQSTRING)
  (CLOSE FP)
  (FORMAT NIL "File written to:~%~a" OUT-PATH)
Function: #<FSubr-IF: #1bf19d4>
Arguments:
  (> (LENGTH STRING) 2000)
  (FORMAT NIL "Error.~%Too much data.~%There should be no more than 128 spectrum points.")
  (PROGN (SETF STRINGLIST (EXTRACT-NUMBERS STRING)) (SETF EQSTRING (FORMAT NIL "<equalizationeffect>nt<curve name="~a">" FNAME)) (DO ((I 1 (+ I 2))) ((>= I (LENGTH STRINGLIST))) (WHEN (NOT (NUMBERP (NTH I STRINGLIST))) (SETF (NTH I STRINGLIST) -120)) (SETQ MAXGAIN (MAX MAXGAIN (NTH I STRINGLIST)))) (DO ((I 0 (+ I 2))) ((>= I (LENGTH STRINGLIST))) (SETQ GAIN (+ OFFSET (IF (= INVERT 0) (- (NTH (1+ I) STRINGLIST) MAXGAIN) (- MAXGAIN (NTH (1+ I) STRINGLIST))))) (SETF EQSTRING (FORMAT NIL "~a~%t<point f="~a" d="~a"/>" EQSTRING (NTH I STRINGLIST) GAIN))) (SETQ FP (OPEN OUT-PATH :DIRECTION :OUTPUT)) (FORMAT FP "~ant</curve>n</equalizationeffect>" EQSTRING) (CLOSE FP) (FORMAT NIL "File written to:~%~a" OUT-PATH))
1> 

steve
Site Admin
Posts: 84904
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Combining Analyze and Equalize

Post by steve » Tue Feb 26, 2013 3:02 am

kozikowski wrote:You don't realize how much you rely on the directory/folder tools in file management.
Absolutely.
File path handling could be improved a bit and better error handling, but in the absence of a file browser this effect will be a pain to use and unfortunately there is no file browser for Nyquist plug-ins. Can you copy and paste the file path from the file properties on a Mac?
Learn more about Nyquist programming at audionyq.com

kozikowski
Posts: 71198
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Combining Analyze and Equalize

Post by kozikowski » Tue Feb 26, 2013 4:25 am

I can "right-click" anywhere > get INFO and then just drag > copy > paste from the INFO panel.

/Users/koz/Desktop/purchases/lifesaver/LIFESAVER USA Online - Checkout.pdf

Macs support three-button mice with scroll wheel. Control-Click will get you the same thing on a touch pad or other less talented mouse. I was surprised that the spiffy-looking wireless mice supplied of late do have two buttons and scroll wheel. All by touching and stroking. No moving parts. They have a power switch on the bottom, too. Another pet gripe of wireless equipment.

I was all ready for the Apple "You don't need the right button so we're going to take it away from you," but they didn't do that.

So I missed the address or something else silly? I thought I was being careful about the names and addresses. If I had to guess wildly about the failure, it's the program thought the first line of the file was data and that put the count over 128.

I'm also missing the Overview. What happens when the program succeeds?

Koz

Locked