sergree / matchering

🎚️ Open Source Audio Matching and Mastering
https://pypi.org/project/matchering/
GNU General Public License v3.0
1.33k stars 155 forks source link

Windows GUI for matchering (Claude created) #58

Open nigelp opened 1 week ago

nigelp commented 1 week ago

PySimpleGUI-based GUI for Matchering

I've created a simple GUI for Matchering using PySimpleGUI. This solution provides an easy-to-use interface for those who prefer a graphical approach over command-line usage.

Features:

Requirements:

A. Install matchering as per instructions

python -m pip install -U matchering

B. Install GUI pip install PySimpleGUI matchering

C. Save the code below in a file called
matchering_gui.py

in your matchering folder.


import PySimpleGUI as sg import matchering as mg

def create_window(): layout = [ [sg.Text('Target Track:'), sg.Input(key='-TARGET-'), sg.FileBrowse()], [sg.Text('Reference Track:'), sg.Input(key='-REFERENCE-'), sg.FileBrowse()], [sg.Text('Output Formats:')], [sg.Checkbox('16-bit WAV', default=True, key='-16BIT-'), sg.Checkbox('24-bit WAV', default=False, key='-24BIT-')], [sg.Button('Process'), sg.Button('Exit')] ] return sg.Window('Matchering GUI', layout)

def main(): window = create_window()

while True:
    event, values = window.read()
    if event == sg.WINDOW_CLOSED or event == 'Exit':
        break
    if event == 'Process':
        target = values['-TARGET-']
        reference = values['-REFERENCE-']
        results = []
        if values['-16BIT-']:
            results.append(mg.pcm16(f"{target.rsplit('.', 1)[0]}_master_16bit.wav"))
        if values['-24BIT-']:
            results.append(mg.pcm24(f"{target.rsplit('.', 1)[0]}_master_24bit.wav"))

        if not target or not reference or not results:
            sg.popup('Please fill in all fields and select at least one output format.')
            continue

        try:
            mg.log(print)
            mg.process(
                target=target,
                reference=reference,
                results=results,
            )
            sg.popup('Processing complete!')
        except Exception as e:
            sg.popup_error(f'An error occurred: {str(e)}')

window.close()

if name == 'main': main()


Usage:

  1. Double click the file to run the script: python matchering_gui.py
  2. Use the GUI to select files and process audio
  3. Enjoy!

This GUI provides a user-friendly alternative to command-line usage and might be helpful for users who prefer graphical interfaces. It's ugly as sin, but does the job.

I take no responsibility at all, it's all Claude Sonnet 3.5's fault. :)

sergree commented 1 week ago

Great job, bro 😊

nigelp commented 1 week ago

My pleasure. :)

On Wed, Oct 9, 2024 at 8:18 AM Сергей Гришаков @.***> wrote:

Great job, bro 😊

— Reply to this email directly, view it on GitHub https://github.com/sergree/matchering/issues/58#issuecomment-2401527600, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAX43M2ILP62L5IAXZNL3DZ2TKEZAVCNFSM6AAAAABPSRQVDWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBRGUZDONRQGA . You are receiving this because you authored the thread.Message ID: @.***>