• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required as is 20 years of participation in forums (not all true). Come here to have fun, be ready to be teased and not take online life too seriously. We now measure and review equipment for free! Click here for details.

GWolfman

Senior Member
Forum Donor
Joined
Nov 3, 2020
Messages
386
Likes
454
See the SPOILER for a quick and dirty script to convert the files @sweetchaos had mentioned. Save the contents to wavelet_conv.py. You can try executing directly (./wavelet_conv.py input_file.txt) or you can call from python (python3 wavelet_conv.py input_file.txt, if you're getting errors). Please read the notes at the beginning of the file for how to use it or what it does.

Please let me know if you want additional features or changes to formatting.

Posted version: 0.1 beta
Python:
#!/usr/bin/env python3
"""
This script converts an AutoEq file for use with GEQs (graphic equalizers).
It prints the simplified version to screen (std_out).

Usage: wavelet_conv.py filename.txt
To save to a file, use redirection: wavelet_conv.py filename.txt > newfile.txt

Version: 0.1 beta
Author: GWolfman

AutoEq (@jaakkopasanen): https://github.com/jaakkopasanen/AutoEq
GEQ info (@sweetchaos): https://www.audiosciencereview.com/forum/index.php?threads/list-of-amirs-headphone-geq-filters.20043/

===
MIT License

Copyright (c) 2021 GWolfman

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

import re
import sys

# Constants
DEBUG = False  # Change to True to print extra text for debugging, else False
R_HEADER = re.compile(r'^Preamp: (?P<gain>[-]?\d+.\d) dB$')
R_BAND = re.compile(r'^Filter \d+: (?P<on>\w+) (?P<type>\w+) Fc (?P<freq>\d+) Hz Gain (?P<gain>[-]?\d+.\d+) dB Q (?P<q>\d+.\d+)$')

# Variables
out_text = []

# Check command line argument(s)
if len(sys.argv) != 2:
    print("ERORR! See usage (-h).")
    exit(1)
elif sys.argv[1] == '-h':
    print("wavelet_conv.py filename.txt")
    exit(0)

# Try opening and reading the input file
try:
    with open(sys.argv[1], 'r') as fin:
        in_text = fin.readlines()

    # Remove newline characters
    in_text = [line.strip() for line in in_text]

    # Print input if debugging
    if DEBUG:
        print('=INPUT=\n', '\n'.join(in_text))
except Exception as err:
    print("INPUT FILE ERROR: {ERR}".format(ERR=err))
    print("    Does the file exist and do you have read permissions?")
    exit(2)

# Process each line of input
for line in in_text:
    if DEBUG:
        print('line:', line)

    # Try matching line to known type(s)
    l1 = R_HEADER.search(line)
    l2 = R_BAND.search(line)

    # If matching preamp header
    if l1 and l1.groups():
        if DEBUG:
            print("match header: gain={G}".format(G=l1.group('gain')))

        # Add formatted text to output
        out_text.append("Preamp: {G}db".format(G=l1.group('gain')))

        # Skip to next line
        continue

    # If matching filter line
    elif l2 and l2.groups():
        if DEBUG:
            print("match filter: on={O} type={T} f={F} gain={G} Q={Q}".format(
                O=l2.group('on'), T=l2.group('type'), F=l2.group('freq'),
                G=l2.group('gain'), Q=l2.group('q')))

        # Add formatted text to output
        out_text.append("{F} {G}".format(F=l2.group('freq'), G=l2.group('gain')))

        # Skip to next line
        continue

if DEBUG:
    print('=out_text=\n', (out_text))

# Save output to file
print('\r\n'.join(out_text))

# Exit gracefully
exit(0)

# vim: set noai ts=4 sw=4 sts=4 expandtab syntax=python:

Edit: I've attached the script as well.
 

Attachments

  • wavelet_conv.zip
    2 KB · Views: 37

GWolfman

Senior Member
Forum Donor
Joined
Nov 3, 2020
Messages
386
Likes
454
@sweetchaos Re: Latest thoughts #2: I use foobar and I'd appreciate the GEQ profile for it. If not maybe I'll just ask you for a particular device ad hoc if I happen to test it. But Foobar is quite popular.
 
OP
sweetchaos

sweetchaos

Major Contributor
Forum Donor
The Curator
Joined
Nov 29, 2019
Messages
2,216
Likes
5,397
Location
BC, Canada
See the SPOILER for a quick and dirty script to convert the files @sweetchaos had mentioned. Save the contents to wavelet_conv.py. You can try executing directly (./wavelet_conv.py input_file.txt) or you can call from python (python3 wavelet_conv.py input_file.txt, if you're getting errors). Please read the notes at the beginning of the file for how to use it or what it does.

Please let me know if you want additional features or changes to formatting.

Posted version: 0.1 beta
Python:
#!/usr/bin/env python3
"""
This script converts an AutoEq file for use with GEQs (graphic equalizers).
It prints the simplified version to screen (std_out).

Usage: wavelet_conv.py filename.txt
To save to a file, use redirection: wavelet_conv.py filename.txt > newfile.txt

Version: 0.1 beta
Author: GWolfman

AutoEq (@jaakkopasanen): https://github.com/jaakkopasanen/AutoEq
GEQ info (@sweetchaos): https://www.audiosciencereview.com/forum/index.php?threads/list-of-amirs-headphone-geq-filters.20043/

===
MIT License

Copyright (c) 2021 GWolfman

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

import re
import sys

# Constants
DEBUG = False  # Change to True to print extra text for debugging, else False
R_HEADER = re.compile(r'^Preamp: (?P<gain>[-]?\d+.\d) dB$')
R_BAND = re.compile(r'^Filter \d+: (?P<on>\w+) (?P<type>\w+) Fc (?P<freq>\d+) Hz Gain (?P<gain>[-]?\d+.\d+) dB Q (?P<q>\d+.\d+)$')

# Variables
out_text = []

# Check command line argument(s)
if len(sys.argv) != 2:
    print("ERORR! See usage (-h).")
    exit(1)
elif sys.argv[1] == '-h':
    print("wavelet_conv.py filename.txt")
    exit(0)

# Try opening and reading the input file
try:
    with open(sys.argv[1], 'r') as fin:
        in_text = fin.readlines()

    # Remove newline characters
    in_text = [line.strip() for line in in_text]

    # Print input if debugging
    if DEBUG:
        print('=INPUT=\n', '\n'.join(in_text))
except Exception as err:
    print("INPUT FILE ERROR: {ERR}".format(ERR=err))
    print("    Does the file exist and do you have read permissions?")
    exit(2)

# Process each line of input
for line in in_text:
    if DEBUG:
        print('line:', line)

    # Try matching line to known type(s)
    l1 = R_HEADER.search(line)
    l2 = R_BAND.search(line)

    # If matching preamp header
    if l1 and l1.groups():
        if DEBUG:
            print("match header: gain={G}".format(G=l1.group('gain')))

        # Add formatted text to output
        out_text.append("Preamp: {G}db".format(G=l1.group('gain')))

        # Skip to next line
        continue

    # If matching filter line
    elif l2 and l2.groups():
        if DEBUG:
            print("match filter: on={O} type={T} f={F} gain={G} Q={Q}".format(
                O=l2.group('on'), T=l2.group('type'), F=l2.group('freq'),
                G=l2.group('gain'), Q=l2.group('q')))

        # Add formatted text to output
        out_text.append("{F} {G}".format(F=l2.group('freq'), G=l2.group('gain')))

        # Skip to next line
        continue

if DEBUG:
    print('=out_text=\n', (out_text))

# Save output to file
print('\r\n'.join(out_text))

# Exit gracefully
exit(0)

# vim: set noai ts=4 sw=4 sts=4 expandtab syntax=python:

Edit: I've attached the script as well.

Thanks for creating this script @GWolfman
This is very helpful.
This will save me from making data-entry mistakes and speed up the process.
Appreciate it. :D
 
OP
sweetchaos

sweetchaos

Major Contributor
Forum Donor
The Curator
Joined
Nov 29, 2019
Messages
2,216
Likes
5,397
Location
BC, Canada
@sweetchaos Re: Latest thoughts #2: I use foobar and I'd appreciate the GEQ profile for it. If not maybe I'll just ask you for a particular device ad hoc if I happen to test it. But Foobar is quite popular.
Hmm, I'm still on the borderline for this...

Here's what I wrote earlier (in another thread):
How to upgrade Foobar2000's (for Windows) 18-band GEQ (with +-1dB gain adjustments), to a 31-band GEQ (with +-0.1db gain adjustments)?
1. Get the free addon "Graphic Equalizer" from https://www.foobar2000.org/components/view/foo_dsp_xgeq
2. Download, save .zip to desktop
3. Foobar2000, file, preferences, components, select "install" button, select .zip from desktop, "apply", it will restart Foobar
4. To adjust GEQ, go to View, 'Graphic Equalizer', you'll see the 31-band GEQ (with +-0.1db gain adjustments).
Note: The original GEQ is still there, just under View, DSP, Equalizer.

Which quickly converts the 18-band GEQ (with less accurate gain adjustments) to the 31-band GEQ (with more accurate gain adjustments), almost instantly....and for free.

To get even better results:
For Windows, you can use 'Equalizer APO' or 'Peace' (both free) to get the more accurate PEQ.
For iOS/iPadOS, you can use 'Neutron Music Player' (paid) to get the more accurate PEQ.
 

GWolfman

Senior Member
Forum Donor
Joined
Nov 3, 2020
Messages
386
Likes
454
Hmm, I'm still on the borderline for this...

Here's what I wrote earlier (in another thread):


Which quickly converts the 18-band GEQ (with less accurate gain adjustments) to the 31-band GEQ (with more accurate gain adjustments), almost instantly....and for free.

To get even better results:
For Windows, you can use 'Equalizer APO' or 'Peace' (both free) to get the more accurate PEQ.
For iOS/iPadOS, you can use 'Neutron Music Player' (paid) to get the more accurate PEQ.
I forgot about that EQ, as a matter in fact I might already have it installed. Stick with the 31-band. Thanks for the reminder.
 

GWolfman

Senior Member
Forum Donor
Joined
Nov 3, 2020
Messages
386
Likes
454
I need someone else with an Android (I can't, since I have an iPhone), to install 'Wavelet' (free app), and try to import any of my 127-band GEQs.
I'm not sure if the issue is because I tried doing this all on my phone or not (including creating the text file in Google Docs and exporting to a .txt file), but the attached file did not import. (I think this is the Sony MDR-ZX110.)
 

Attachments

  • WaveletTest.txt
    1.3 KB · Views: 56

GWolfman

Senior Member
Forum Donor
Joined
Nov 3, 2020
Messages
386
Likes
454
@sweetchaos I've got some other ideas to automate some of the steps so it's less manually intensive. Let me know if you're interested.
 

dorirod

Active Member
Joined
Oct 9, 2019
Messages
228
Likes
206
I'm not sure if the issue is because I tried doing this all on my phone or not (including creating the text file in Google Docs and exporting to a .txt file), but the attached file did not import. (I think this is the Sony MDR-ZX110.)
I would try a straight upload of a text file to your phone. I did the same thing you did, and the one from Google Docs (exported to txt) wouldn't import at all, but one from my computer would import (and just not do anything).
 

GWolfman

Senior Member
Forum Donor
Joined
Nov 3, 2020
Messages
386
Likes
454
I would try a straight upload of a text file to your phone. I did the same thing you did, and the one from Google Docs (exported to txt) wouldn't import at all, but one from my computer would import (and just not do anything).
I'll try later today. If it works, I'll compare the two and try to find out what's different.
 

dorirod

Active Member
Joined
Oct 9, 2019
Messages
228
Likes
206
I'll try later today. If it works, I'll compare the two and try to find out what's different.
This doesn't import:
$ file HifimanHE400i-AmirM.txt
HifimanHE400i-AmirM.txt: UTF-8 Unicode (with BOM) text, with very long lines

This imports:
$ file HifimanHE400i2016-GEQ-AmirM.txt
HifimanHE400i2016-GEQ-AmirM.txt: ASCII text, with very long lines
 

GWolfman

Senior Member
Forum Donor
Joined
Nov 3, 2020
Messages
386
Likes
454
This doesn't import:
$ file HifimanHE400i-AmirM.txt
HifimanHE400i-AmirM.txt: UTF-8 Unicode (with BOM) text, with very long lines

This imports:
$ file HifimanHE400i2016-GEQ-AmirM.txt
HifimanHE400i2016-GEQ-AmirM.txt: ASCII text, with very long lines
I can confirm that your profile works when ASCII-formatted (possibly even UTF-8), but not when the BOM (byte order mark) is included (e.g., when creating and exporting from Google Docs).
 
OP
sweetchaos

sweetchaos

Major Contributor
Forum Donor
The Curator
Joined
Nov 29, 2019
Messages
2,216
Likes
5,397
Location
BC, Canada
Added Improvements:

For anyone using VLC media player:
By default, VLC comes with a 10-band GEQ profile, with frequencies 60,170,310,600,1000,3000,6000,12000,14000,16000
But this is non-standard and won't match with the typical ISO standard with frequencies 32,64,125,250,500,1000,2000,4000,8000,16000.
To fix this, go to:
1. Preferences
2. Show "All" settings (on the bottom left)
3. Select "Audio" Tab, then "Filters" sub-tab, then "Equalizer" Tab
4. Disable the option "Use VLC frequency bands".
1612903084877.png
Now you can use the typical 10-band GEQ with frequencies 32,64,125,250,500,1000,2000,4000,8000,16000
 
Last edited:

t$$

New Member
Joined
Feb 26, 2021
Messages
3
Likes
8
Hi,

I was able to load the Sony WH-1000XM4 127 band GEQ into the Wavelet App. One funny thing is that when you import a file, it is merely added to the database. Then you must search for and choose it before it can be selected. I was confused at first because I assumed that importing the file would automatically select it. Nope, it is a 2 step process.

Here is the process that I used:

1. Copy/Pasted the line into a text file (UTF-8, LF, no BOM)
2. Saved the file as Sony WH-1000XM4(Amir).txt
2. Downloaded the file onto my Google Pixel 5, Download folder
3. Imported the file, nothing obvious will happen
4. Search for XM4, selected the Sony WH-1000XM4(Amir)

Attached below are screenshots of the GEQ loaded from here, also for academic interest, I attached a screenshot of the built-in AutoEQ for the XM4.
Screenshot_20210225-234522 (Medium).png
Screenshot_20210225-234547 (Medium).png
Screenshot_20210225-234611 (Medium).png
 
Last edited:
Top Bottom