surge-synthesizer / surge

Synthesizer plug-in (previously released as Vember Audio Surge)
https://surge-synthesizer.github.io/
GNU General Public License v3.0
3.03k stars 387 forks source link

Support for user defined preset folder #1001

Closed mortfell closed 4 years ago

mortfell commented 4 years ago

It might be nice to give an option to set a user defined "User Presets" folder for Surge for patches. That way the folder can be shared on a network drive or cloud service (Dropbox, iCloud etc) and new presets will automatically accessible from any Surge installations that point to that folder.

I do a lot of sound design on a few different computers and find this to be a big time saver for me with synths that support it. (Serum, synthmaster/synthmaster One) If it isn't too difficult to implement maybe other users would find it as useful as I do.

baconpaul commented 4 years ago

Most folks have solved this by either making their ~/Documents folder a cloud drive or using a link for ~/Documents/Surge to some location. (and doing the equivalent on windows and linux with the locations there).

It's not difficult to implement at all with one exception: I need to keep user preferences somewhere and I need to load them with a well defined name. So if I implemented this the semantic (on mac - you get equivalent locations on windows and linux) would be

  1. There's a file ~/Documents/Surge/SurgeUserDefaults.xml
  2. That file contains a location to your user area which you set and we use that, or it doesn't and we use ~/Documents/Surge/

Unfortunately the SurgeUserDefaults.xml needs to be someplace I can "find" without reading the user defaults (of course!) and so the system documents directory seems the best place.

Comments on this idea welcome!

mortfell commented 4 years ago

Thanks for your response! I use a mac laptop and a windows desktop, so sharing drives and linking things can be a bit of a pain across platforms. I'm sure I could set up some sort of automation or something, and maybe I should because there is more applications which don't support custom preset folders than do, but anyway....

Perhaps there could be an optional line in the SurgeUserDefaults.xml JUST to define custom locations for presets and/or wavetables? That way the SurgeUserDefaults.xml file would always be in it's usual location (as per platform) and that would be the default location for presets as well, but if they wish the user could define an alternative location for Presets and/or Wavetables.

baconpaul commented 4 years ago

Yeah that’s exactly how it would be (also other defaults like zoom and more range would be per platform too since that file wouldn’t be shared).

Ok easy to add to the list. I’ll tag this 1.6.2 and get it somewhere into the release we plan this fall. Reasonable request.

mortfell commented 4 years ago

Great! Thank you. And thanks to everyone working on this synth since the source has been released!

This is such a wonderful project, it's so exciting to have such a powerful fully featured open source synth being actively developed. Really opens up a lot of possibilities for teaching sound design and sharing presets/knowledge across platforms and skill levels.

baconpaul commented 4 years ago

Thanks for the kind words! Appreciated

baconpaul commented 4 years ago

Turns out this is pretty easy in the code. The only trick is in the UI where I have to modify our file selectors to allow selection of a directory and creation of a directory on the three platforms.

Should have this feature in the nightlies after I get my next few day or two of dev time though. Maybe by this weekend.

mortfell commented 4 years ago

Oh nice!

baconpaul commented 4 years ago

Hi OK I just pushed a change which allows this. It will take about 30 minutes for the new nightly to build and you will, of course, need that nightly on both mac and win to use it on both platforms!

There's a new menu item under "menu/data and patches" called "set custom user data folder". That prompts you with a UI to pick and sets your default and immediately rescans.

This means that when you pick this all your custom parches and wavetables will disappear from the plugin but they are still on your hdd of course. Moving patches from old directory to new directory is something you have to do yourself - surge doesn't do it for you.

I'll leave this issue open until you test it. I did quite a bit of testing but want to make sure that this is what you had envisaged before I close it.

Thanks

mortfell commented 4 years ago

Great this is awesome! I'll try using it today and let you know if I notice any bugs or weird behaviour with it.

mortfell commented 4 years ago

Seems perfect to me. Tried saving presets between computers, works fin. Love the implementation of having it set from the Menu, no editing of config files needed!

very minor bug, but maybe worth looking at for stable release: On Mac OS Sierra, the file browser that opens when you select "Set Custom User Data Folder" opens behind the main Surge window and you have to move surge out of the way or close it. Seems to be all version/all hosts. (on that operating system at least)

baconpaul commented 4 years ago

Oh thanks I’ll figure out the bring to front message and add that then close this.

Glad it works!

baconpaul commented 4 years ago

Mojave doesn't do this, but in any case, there's a good objective c api to move the window forward, and I explicitly call it now. If that doesn't work I'm not quite sure what the fix is (may also depend on your host alas) but I'll merge that change anyway. Thanks!

mortfell commented 4 years ago

Just tested the most recent nightly on my laptop and a Mac Pro Trashcan running "high sierra" at a studio I'm at today . Strange.... still happening for me. Maybe it's helpful to mention: It's also happening with the browser that opens from "Open Wave Table from File"

Anyone else test this? Have tried VST2, VST3, AUi in REAPER and Live 10.1, and tried it in Logic X as well.... also tried it the other day on a Yosemite system my partner owns, had the same issue. No issue on Windows 10 though.

Maybe it's not really worth worrying about if it's only effecting older Mac OS installs anyway, and it's a pretty small problem. I imagine these tiny platform dependent file managment bugs are the most boring and annoying haha.

baconpaul commented 4 years ago

Yeah all the same codepath so good it is consistent.

Ok I’ll take another peek and see if I can see anything.

Out of curiosity are you running your daws in full screen mode?

mortfell commented 4 years ago

Ok cool. I'll keep testing. I sometimes do but haven't been, just tried with Ableton, seems the same.

baconpaul commented 4 years ago

Oh darn it I can reproduce it now. (My main testing DAW for the synth is a lightweigth AU hosting tool which doesn't do this; Logic has the plugin windows on a different level in the app).

Lemme work on fixing this. Will re-open the issue. Sorry about that!

baconpaul commented 4 years ago

OK I learned something about how Cocoa arranges window layers and why logic was different than my sample host. And that let me put in a somewhat more aggressive bring to front call which means in logic pro with the au and in bitwig with the vst3 it comes actually to the front.

Probably 30 minutes to a new nightly if you get a chance to look tomorrow or Monday.

Thanks!

mortfell commented 4 years ago

yeah it all appears to be fixed now for me as well !

baconpaul commented 4 years ago

Great thanks!

mortfell commented 4 years ago

thank you for squashing the bug