Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EasyEffects - How to copy my former equalizer settings from PulseEffects? #1013

Closed
ratcheer opened this issue Jul 11, 2021 · 41 comments
Closed

Comments

@ratcheer
Copy link

I looked through the .config directories and copied the *.json files from .config/pulseeffects/output to .config/easyeffects/output

EasyEffects "sees" these files and offers a Load button for them, but clicking that button does not apply my settings; nothing changes. So, I'm apparently not doing this, correctly. How should I do it? Is it even possible?

@wwmm
Copy link
Owner

wwmm commented Jul 11, 2021

At some point in EasyEffects development I had to do a tough call. The library I was using before to handle json files (c++ Boost) was a source of headaches to many package maintainers. But when I finally found a better replacement nlohmann json I realized that it saved json files using a different convention that is incompatible with the old library.

As in a way EasyEffects is a "new application" I decided that if we were ever going to move to another library there would be no better moment than this. But now we have to deal with this preset incompatibility problem somehow. The main issue is on how the old library saved numbers. Instead of writing something like "pi": 3.14159265359 what it did was "pi": "3.14159265359". All the numbers are surrounded by quotation marks. That is not what other c++ libraries for json do.

Same problem with boolean variables. Instead of writing "enable": true the old library did "enable": "true". Hopefully in the future someone will figure out how to write a script that does the conversion. For now what you can do is using this site https://csvjson.com/json_beautifier and checking the option to remove quotes on numbers. It is on the panel at the right side. Where the processed output will be displayed. But unfortunately it does not remove quotation marks from boolean variables. So that ones with true or false will have to be fixed manually.

@wwmm wwmm pinned this issue Jul 11, 2021
@Mlocik97
Copy link
Contributor

I can create website that will remove quotes on both number and booleans.

@wwmm
Copy link
Owner

wwmm commented Jul 11, 2021

I can create website that will remove quotes on both number and booleans.

That would be very helpful. While we could try to have a converter embedded in EasyEffects the more people decide to have a "fresh start" in EasyEffects the less useful this code will become. And we already have too much code for the amount of people actually taking care of it.

@Mlocik97
Copy link
Contributor

At least I know JavaScript so... I already started working on it.

@ratcheer
Copy link
Author

Thank you, wwmm. I hand copied (on paper) my PulseEffects settings and recreated them in EasyEffects. They are loading, now.

However, my output volume is now much too low. I have to turn it up to +23 dB to get anything like what I was getting with PulseEffects. I have verified that the volumes are correctly set in pavucontrol and EasyEffects - all at 100%. I will open a new Issue on this, if you want.

@wwmm
Copy link
Owner

wwmm commented Jul 11, 2021

However, my output volume is now much too low. I have to turn it up to +23 dB to get anything like what I was getting with PulseEffects. I have verified that the volumes are correctly set in pavucontrol and EasyEffects - all at 100%. I will open a new Issue on this, if you want.

It is probably better to open a new issue for this. When you do that kill the current instance easyeffects -q and restart it in debug mode G_MESSAGES_DEBUG=easyeffects easyeffects so we can see what is going on. There should not be much difference in volume between EasyEffects and PulseEffects.

@ratcheer
Copy link
Author

Will do. Thank you.

@Mlocik97
Copy link
Contributor

Snímka obrazovky z 2021-07-11 18-31-41

it seems to work little, it contains bug, downloading doesn't work yet, and uploading too. But converting is working.

@wwmm
Copy link
Owner

wwmm commented Jul 11, 2021

I think it will be a good idea to create a section in the wiki for this site.

@Mlocik97
Copy link
Contributor

Snímka obrazovky z 2021-07-11 19-09-31

I think it's working fine, Now I need only to fix few things and it will be complete.

@Mlocik97
Copy link
Contributor

Mlocik97 commented Jul 11, 2021

So it's working, also file upload, and file download... ofc, I still didn't fix some problems and mainly I'm not checking type of input file, so You can upload even .png file to it, it will just crash. But with correct inputs it works. I'm going to upload it to repo and give You link to website. Also website is not responsive, but I don't think it's needed because no one would use this on mobile device.

@Mlocik97
Copy link
Contributor

Mlocik97 commented Jul 11, 2021

https://pe-to-ee-preset-converter.herokuapp.com/

@wwmm

@Mlocik97
Copy link
Contributor

Added to Wiki

@wwmm
Copy link
Owner

wwmm commented Jul 11, 2021

Added to Wiki

Thanks! :-)

@bphd
Copy link

bphd commented Jul 12, 2021

https://pe-to-ee-preset-converter.herokuapp.com/

@wwmm

Thanks for your dedication

I tested it and

Screenshot_20210712_095034

Screenshot_20210712_095258

Screenshot_20210712_095424

And other similar

I looked through the .config directories and copied the *.json files from .config/pulseeffects/output to .config/easyeffects/output

EasyEffects "sees" these files and offers a Load button for them, but clicking that button does not apply my settings; nothing changes. So, I'm apparently not doing this, correctly. How should I do it? Is it even possible?

Mine works OOB, but it's like in a church, very faint and very echoey. And applying Mlocik97's correction doesn't change anything. For me that'll be global bypass probably till next update (and side remark, despite the global bypass being activated, sometimes the filters applies anyway. I have to deactivate and reactivate the global bypass to have no filters)

@Mlocik97
Copy link
Contributor

Mlocik97 commented Jul 12, 2021

And applying Mlocik97's correction doesn't change anything.

So converted JSON doesn't load? Is there something else that changed in JSON structure? Can @wwmm provide me few JSON samples from latest PE version and from EE?
The best would be having same JSON for both EE and PE so I can compare what it changed... by what was said there, the only thing I'm now doing in converter is changing data type of numeric strings to numbers and booleanish strings to booleans.

About testing does it has some other problems?

@Mlocik97
Copy link
Contributor

Mlocik97 commented Jul 12, 2021

I just put @Digitalone1 's presets to Diff, and I see new preset contain blacklist property, is it required now by EE? Also I see properties state are removed, instead plugin_order array contain only active plugins. ALso spectrum settings are removed from preset, should I remove it in converter too?

@bphd
Copy link

bphd commented Jul 12, 2021

And applying Mlocik97's correction doesn't change anything.

So converted JSON doesn't load?

Mine works OOB

Is there something else that changed in JSON structure?

From my rapid look, no other kind of things than what I screenshotted, explaining the same result as before the change

The best would be having same JSON for both EE and PE so I can compare what it changed...

I just put @Digitalone1 's presets to Diff

In my previous post it's @Digitalone1 's preset that I converted and diffed. But yeah, I didn't compare to an officially supported EE json

About testing does it has some other problems?

Like I said, it's the same in EE with and without your modifier (church and faint)

And the modifications done by your modifier are highlighted in my screenshot of diff

@Mlocik97
Copy link
Contributor

Mlocik97 commented Jul 12, 2021

The best would be having same JSON for both EE and PE so I can compare what it changed...

Sry for misunderstanding, I was talking about presets not from my converter but about two working samples from application from PE version and from EE version. So I can see what changed in structure and update my converter as needed. This is more question to @wwmm .

@bphd
Copy link

bphd commented Jul 12, 2021

The best would be having same JSON for both EE and PE so I can compare what it changed...

Sry for misunderstanding, I was talking about presets not from my converter but about two working samples from application from PE version and from EE version. So I can see what changed in structure and update my converter as needed. This is more question to @wwmm .

Sure, I didn't understand for 2 minutes but soon after I edited to correct my words

@Mlocik97
Copy link
Contributor

My bad English doesn't help...

so what I see, is that my converter is working as it should, but somehow EasyEffects still doesn't load converted presets.

@Mlocik97
Copy link
Contributor

I just in 10 minutes added 2 new features to converter... Now You can change JSON even after it was uploaded. It also add blocklist property to structure...

When I will have time, I will also convert "state" if plugin is active, and add feature to upload multiple files and download multiple files at once.

@wwmm
Copy link
Owner

wwmm commented Jul 12, 2021

While Boost saved empty blocklist as "blocklist": "" instead of "blocklist": [] as the new library I do not see yet a reason why this should be breaking the whole conversion process. Strange...

When I will have time, I will also convert "state" if plugin is active, and add feature to upload multiple files and download multiple files at once.

The state variable is not used anymore. EasyEffects should just ignore it. But it may still be useful for the preset converter. In EasyEffects the plugins_order parameter has only the plugins that the user has manually added in EasyEffects window and not all the available plugins like it was in PulseEffects. Maybe the converter can use the value of the state variable to decide which names have to be in the plugins_order array.

@bphd
Copy link

bphd commented Jul 12, 2021

It's very difficult without PE/EE to have a big audio system in a quiet environment, any sound change in a video/song makes my audio bang, and it's very uncomfortable for the people around. I hope the soft will work soon

@wwmm
Copy link
Owner

wwmm commented Jul 12, 2021

I hope the soft will work soon

I am not sure I understand. The application is not working in your computer? I know that the old presets cannot "just be used" in EasyEffects. But the application itself should be working and it should be possible to manually set the parameters.

@bphd
Copy link

bphd commented Jul 12, 2021

I hope the soft will work soon

I am not sure I understand. The application is not working in your computer? I know that the old presets cannot "just be used" in EasyEffects. But the application itself should be working and it should be possible to manually set the parameters.

I don't really set manually my parameters, I haven't made years of studies in audio for that
(manner of speaking, but you understand)

EDIT: Never mind, I downloaded the new digitalone1 preset

A little detail, the global bypass button is messy both in PE and EE, sometimes it's "pressed" and it deactivates the effects, and sometimes it's the contrary. So I never can estimate if the effects are ON with the graphic of the button. I would like to have a textual hint of if the global bypass is activated or not

@wwmm
Copy link
Owner

wwmm commented Jul 12, 2021

Ok. No problems :-). But as I did not do many tests trying to force an PulseEffects preset to be loaded in EasyEffects it is possible that some side effects were caused that we are not aware of yet. When you test the application again try to reset it first from our settings menu or from the command line easyeffects -r.

@Mlocik97
Copy link
Contributor

Mlocik97 commented Jul 12, 2021

New version of converter should also convert state of plugin. Btw. my code is mess of 3-level try/catch I should rewrite.

@Mlocik97
Copy link
Contributor

Can someone try to convert PulseEffects preset and use it for EasyEffects if it will work now? I don't see what else should change in preset.

@wwmm
Copy link
Owner

wwmm commented Jul 12, 2021

I did a quick test now and it was fine. I see no issues so far.

@Mlocik97
Copy link
Contributor

I see only one problem, and that's Heroku,... when web app is inactive, server goes to sleep mode after 30 minutes (in free plan), and when someone open web app, it takes little more time to load,... maybe I can create server-side script that will ping it's server every x minutes so server doesn't go to sleep mode.

@wwmm
Copy link
Owner

wwmm commented Jul 12, 2021

maybe I can create server-side script that will ping it's server every x minutes so server doesn't go to sleep mode

Honestly I think you could just add a note to the wiki warning users about the page loading time. It is not the end of the world waiting a little longer for it to load.

@Mlocik97
Copy link
Contributor

Mlocik97 commented Jul 13, 2021

I think I solved performance problem. I was also thinking to migrate it to another PaaS/IaaS service or to Github Pages,... but there is one big problem with Github Pages, I would need to solve.

@AbsurdlySuspicious
Copy link

AbsurdlySuspicious commented Jul 15, 2021

Simple script to convert everything including plugins order
Numbers are not parsed so they preserved as is without any float rounding errors

#!/usr/bin/env bash

# Replace with 'input' if you want to convert input preset
section='output'

# Convert boolean and numeric strings + replace invalid empty blocklist
perl -i -pe 's/"(true|false|[\d\.-]+)"/$1/g; s/(?<="blocklist": )""/[]/g' "$@"

# Fix plugins order using v5 state field (your set up plugin order is preserved)
for f in "$@"; do

  # Extract active plugins in right order
  po_src=$(jq ".$section"' | . as $out | .plugins_order | .[] | . as $pn | select($out | to_entries | .[] | .key as $key | select(["blocklist", "plugins_order"] | any(. == $key) | not) | select(.value.state != false) | .key == $pn)' "$f" -r)

  # Replace order array in config with new one
  jq --arg po "$po_src" '($po | split("\n")) as $poa | '".$section.plugins_order"' = $poa' "$f" >tmp
  mv tmp "$f"
done

Use it like this: bash convert.sh *.json
Requires jq and perl installed
License: CC0 (do with it whatever you want)

@Mlocik97
Copy link
Contributor

Mlocik97 commented Jul 15, 2021

@AbsurdlySuspicious Can I include Your script on my website and to wiki for download?

@AbsurdlySuspicious
Copy link

AbsurdlySuspicious commented Jul 15, 2021

Yeah, sure, assume it's licensed under CC0 :D

@Mlocik97
Copy link
Contributor

Script is avaiable for download on website.

@radimsuckr
Copy link

@wwmm it'd be good if this was highlighted somewhere in the readme. I spent a few weeks without easyeffects because I didn't have time to dive into the issue and as it turned out, it's actually quite easy and took me around 30 seconds to resolve with this thread. 🙏

@Mlocik97
Copy link
Contributor

Mlocik97 commented Jul 30, 2021

This was mentioned in Changelog, in Wiki and in pinned issue. I think it's visible enough.

@wwmm
Copy link
Owner

wwmm commented Jul 30, 2021

This was mentioned in Changelog, in Wiki and in pinned issue.

It is true. But I don't mind having this information in the readme. Eventually the pinned issue will be replaced by another. And as most distributions will take a lot of time until they have the required dependencies to move from PulseEffects to EasyEffects by the time some people are able to install EasyEffects they may have forgotten that the wiki has the guide to convert presets.

@radimsuckr
Copy link

Yeah it definitely is documented but I suspect I'm not the only busy (lazy) one. And for us it'd be useful to see it on the main page of the repository. 😁 Especially when the migration process is so simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants