Old 10-31-2017, 01:59 PM   #1
Publicradio
Human being with feelings
 
Join Date: Apr 2008
Posts: 262
Default Alphabetize presets

Hi, I'm trying to think of a way to do this. It would be a pretty nice feature, but in the meantime, I'm thinking it could be done with regex, maybe.

The pattern in the .ini files is:

[Preset0]
Data=327184971983712...
Data_1=3483290482093...
Data_2=299230-293932...
Data_3=2390920391123...
Name=Preset name
Len=3994
[Preset1]
Data=398209383982089...

And so on. So the script, or regex command, would have to take everything from [ to [, and sort each chunk by Name=X. Then [PresetY] would have to be reset to numeric order.

Maybe there's someone out there who's better at regex or scripting than me and would be interested in figuring this one out with me. Hopefully Reaper will get some better preset management, one day.
Publicradio is offline   Reply With Quote
Old 11-03-2017, 06:29 AM   #2
Publicradio
Human being with feelings
 
Join Date: Apr 2008
Posts: 262
Default

OK, someone at StackExchange helped me with this, and I have a function in my bashrc script that will sort presets. I am on Linux, so I don't know what the equivalent would be for Windows. I know you can run bash commands on a mac.

Code:
function sortpresets(){
head -2 $1;
sed -r ':a;N;s/\n/|/;/Len=/{s/(.*Name=)(.*)(Len=.*)/\2\1\3/p;d};ba' $1 |
sort |
while read line; do
sed -r 's/(.*\|)(\[Preset)[0-9]+(\].*)(Len=.*)/\2'$((i++))'\3\1\4/;s/\|/\n/g' <<<"$line"
done
}
The first line of this function copies the first two lines of the ini, [general] and the number of presets. Then the rest grabs each preset, rearranges them in alphabetical order by preset name, then resets the preset numbers in order, starting with [Preset0].

To invoke the function you would type, in your command line:

Code:
cd /path/to/Reaper/presets
sortpresets vst-ProSoloVst.ini > vst-ProSoloVst.ini
Or, if you want to output to a different file, to make sure it worked:

Code:
sortpresets vst-ProSoloVst.ini > vst-ProSoloVst_new.ini
It looks like a lot of Reaper functions are written in Python, and I don't know Python, but it would be nice to integrate this into the presets menu somehow. There's already 'move up' and 'move down', and it would be nice to add 'move to top' 'move to bottom' and 'Alphabetize'.

I always put 'Lead', 'Bass', 'Arp', 'Pad', 'Seq' and so on into my preset names to alphabetizing helps organize it all together.

Last edited by Publicradio; 11-03-2017 at 08:14 AM.
Publicradio is offline   Reply With Quote
Old 11-04-2017, 12:20 AM   #3
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

I never use RegEx, that stuff looks crazy! I'm too old to learn new/more langs.

Have to say, One of the coolest things about Reaper tho is data is mostly plain text which makes it pretty easy to edit! Whipped this up in like 15 minutes in vb.net.

Edgemeal is offline   Reply With Quote
Old 11-04-2017, 04:06 AM   #4
Publicradio
Human being with feelings
 
Join Date: Apr 2008
Posts: 262
Default

That's pretty interesting.
Publicradio is offline   Reply With Quote
Old 11-04-2017, 07:30 AM   #5
Stella645
Human being with feelings
 
Stella645's Avatar
 
Join Date: Sep 2008
Location: UK
Posts: 3,648
Default

Quote:
Originally Posted by Edgemeal View Post
I never use RegEx, that stuff looks crazy! I'm too old to learn new/more langs.

Have to say, One of the coolest things about Reaper tho is data is mostly plain text which makes it pretty easy to edit! Whipped this up in like 15 minutes in vb.net.

For the mere mortals among us who have zero understanding of visual basic is this something you would be able to share or post idiot proof instruction for??
Stella645 is offline   Reply With Quote
Old 11-04-2017, 09:04 AM   #6
Publicradio
Human being with feelings
 
Join Date: Apr 2008
Posts: 262
Default

Even better would be if we could get this into a format that could go in the the reapack repos.
Publicradio is offline   Reply With Quote
Old 11-04-2017, 10:59 AM   #7
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

Quote:
Originally Posted by Publicradio View Post
The pattern in the .ini files is:

[Preset0]
Data=327184971983712...
Data_1=3483290482093...
Data_2=299230-293932...
Data_3=2390920391123...
Name=Preset name
Len=3994
Hmmm none of my preset files have more then one 'Data=' line per [Preset] in the ini file. Is that real data from an ini file or just made up data for testing? Thanks!
Edgemeal is offline   Reply With Quote
Old 11-04-2017, 11:57 AM   #8
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

Quote:
Originally Posted by Stella645 View Post
For the mere mortals among us who have zero understanding of visual basic is this something you would be able to share or post idiot proof instruction for??
Not even sure presets have more then one 'DATA=' entry per [Preset]. None of mine do, so the code is based on that!
Also this is only for .INI files, .RPL files will need some diff code.

If interested in trying, First backup your presets folder, copy the exe into your presets folder (or you'll have to find the preset folder in file dialog).

You can drag-drop items with left mouse, right click for other options, unlike the gif this version doesn't sort on the fly(subject to change), so you have to select one of the sorting options to re-sort after changing a name, etc.

Last edited by Edgemeal; 11-04-2017 at 09:34 PM.
Edgemeal is offline   Reply With Quote
Old 11-04-2017, 12:49 PM   #9
Stella645
Human being with feelings
 
Stella645's Avatar
 
Join Date: Sep 2008
Location: UK
Posts: 3,648
Default

Quote:
Originally Posted by Edgemeal View Post
Not even sure presets have more then one 'DATA=' entry per [Preset]. None of mine do, so the code is based on that!
Also this is only for .INI files, .RPL files will need some diff code.

If interested in trying, First backup your presets folder, copy the exe into your presets folder (or you'll have to find the preset folder in file dialog).

You can drag-drop items with left mouse, right click for other options, unlike the gif this version doesn't sort on the fly(subject to change), so you have to select one of the sorting options to re-sort after changing a name, etc.
Will give it a go...thanks for sharing.

EDIT: Working great here. Good job and thank you again! Sure a lot of people will find this useful.

Last edited by Stella645; 11-04-2017 at 01:01 PM.
Stella645 is offline   Reply With Quote
Old 11-04-2017, 03:41 PM   #10
Publicradio
Human being with feelings
 
Join Date: Apr 2008
Posts: 262
Default

Edgemeal, all my .ini files have multiple data parameters. Not sure why it would be different.
Publicradio is offline   Reply With Quote
Old 11-04-2017, 06:49 PM   #11
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

Quote:
Originally Posted by Publicradio View Post
Edgemeal, all my .ini files have multiple data parameters. Not sure why it would be different.
Could you Zip up a couple of the ini files and attach to post? Thanks!

Last edited by Edgemeal; 11-04-2017 at 06:55 PM.
Edgemeal is offline   Reply With Quote
Old 11-04-2017, 09:36 PM   #12
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

Quote:
Originally Posted by Stella645 View Post
Will give it a go...thanks for sharing.

EDIT: Working great here. Good job and thank you again! Sure a lot of people will find this useful.
Thanks for the feedback!

Last edited by Edgemeal; 11-06-2017 at 11:37 AM. Reason: REMOVE v0.7
Edgemeal is offline   Reply With Quote
Old 11-06-2017, 07:27 AM   #13
Publicradio
Human being with feelings
 
Join Date: Apr 2008
Posts: 262
Default

OK See attached zip.
Attached Files
File Type: zip presets.zip (114.0 KB, 236 views)
Publicradio is offline   Reply With Quote
Old 11-06-2017, 11:35 AM   #14
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

Quote:
Originally Posted by Publicradio View Post
OK See attached zip.
THANKS!
I see those are 32-bit VSTi, so maybe that's why they save data that way?
v0.8 should have that covered now as well.

Last edited by Edgemeal; 03-20-2018 at 11:08 AM.
Edgemeal is offline   Reply With Quote
Old 11-06-2017, 02:25 PM   #15
Publicradio
Human being with feelings
 
Join Date: Apr 2008
Posts: 262
Default

It doesn't actually work for me. When I sort ascending, it lists 'FX', then 'Bass', 'Bells'... When I sort descending it goes from Arp, to Vox, to Chord. So I don't know what this is sorting by but it's not by letter.
Publicradio is offline   Reply With Quote
Old 11-06-2017, 04:20 PM   #16
Stella645
Human being with feelings
 
Stella645's Avatar
 
Join Date: Sep 2008
Location: UK
Posts: 3,648
Default

Quote:
Originally Posted by Publicradio View Post
It doesn't actually work for me. When I sort ascending, it lists 'FX', then 'Bass', 'Bells'... When I sort descending it goes from Arp, to Vox, to Chord. So I don't know what this is sorting by but it's not by letter.
It works perfectly with the ini files you uploaded before....is there something different about the ones you are trying to sort now??
Stella645 is offline   Reply With Quote
Old 11-06-2017, 05:00 PM   #17
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

Quote:
Originally Posted by Publicradio View Post
It doesn't actually work for me. When I sort ascending, it lists 'FX', then 'Bass', 'Bells'... When I sort descending it goes from Arp, to Vox, to Chord. So I don't know what this is sorting by but it's not by letter.
If not sorted as expect then I can only guess those names have a space char (or some other char) at the very beginning.
Edgemeal is offline   Reply With Quote
Old 11-07-2017, 08:11 AM   #18
Publicradio
Human being with feelings
 
Join Date: Apr 2008
Posts: 262
Default

They don't, but I am running Reaper in wine, which is a windows emulation layer for Linux. So if it's working for Windows users, consider me an edge case.
Publicradio is offline   Reply With Quote
Old 11-07-2017, 11:58 AM   #19
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

Quote:
Originally Posted by Publicradio View Post
They don't, but I am running Reaper in wine, which is a windows emulation layer for Linux. So if it's working for Windows users, consider me an edge case.

I have no way to test that, but it could be the Windows API (StrCmpLogicalW) I'm using to do logical sorting.

v0.9 has option to turn that off and use the .Net (non logical) sort, if you care to try.

Last edited by Edgemeal; 01-23-2019 at 08:08 AM.
Edgemeal is offline   Reply With Quote
Old 12-21-2017, 02:32 PM   #20
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default Reaper Presets v0.10 , v0.12 for Windows

v0.10.
Only real difference is the ini files are now listed in left column and a Save Ini button, so is now a bit quicker to load and save ini files, Though you need to run this exe from the Reaper Presets folder! See READ ME!



Minor updates
v0.12 - June 16, 2018
* ReOrder preset names using Control+Arrow keys.
* Save dialog: Add Cancel, show filename.
* On Exit: Ask to save if unsaved changes.

Last edited by Edgemeal; 01-23-2019 at 08:08 AM.
Edgemeal is offline   Reply With Quote
Old 05-10-2018, 07:33 AM   #21
skippertag
Human being with feelings
 
Join Date: Jun 2015
Posts: 474
Default

Quote:
Originally Posted by Edgemeal View Post
v0.10.
Only real difference is the ini files are now listed in left column and a Save Ini button, so is now a bit quicker to load and save ini files, Though you need to run this exe from the Reaper Presets folder! See READ ME!
HOLY MOLY - you're my guys!!

Finally something that works... great

THANK YOU!!!

Another idea anyhow is this......there is a script that I've found somewhere which is working sometimes quit good...(I attached it) ... but not always...doing that sorting directly within REAPER.. maybe...if someone may want to watch the code and find the error... would be even better than having an extra program doing it, no?

Many many thanks again and in advance!!
Attached Files
File Type: lua Sort presets of focused FX.lua (1.4 KB, 301 views)
skippertag is offline   Reply With Quote
Old 09-05-2018, 12:08 PM   #22
Paul99
Human being with feelings
 
Join Date: Aug 2014
Location: Netherlands
Posts: 882
Default

Great tool. Thanks Edgemeal!
Paul99 is offline   Reply With Quote
Old 10-24-2018, 06:18 AM   #23
Sju
Human being with feelings
 
Join Date: Jun 2015
Posts: 685
Default

Exactly what I needed, the drag&drop is very useful. Thank you!
Sju is offline   Reply With Quote
Old 01-09-2019, 12:35 PM   #24
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 633
Default

Quote:
Originally Posted by skippertag View Post

Another idea anyhow is this......there is a script that I've found somewhere which is working sometimes quit good...(I attached it) ... but not always...doing that sorting directly within REAPER.. maybe...if someone may want to watch the code and find the error... would be even better than having an extra program doing it, no?
Can you send an ini file that doesn't work? Maybe I can figure it out. I've looked at the code on this one, and so far it's worked fine for me.
__________________
eric moon
Very Stable Genius
https://gogolab.com/
woodslanding is offline   Reply With Quote
Old 01-11-2019, 05:15 AM   #25
skippertag
Human being with feelings
 
Join Date: Jun 2015
Posts: 474
Default

Quote:
Originally Posted by woodslanding View Post
Can you send an ini file that doesn't work? Maybe I can figure it out. I've looked at the code on this one, and so far it's worked fine for me.
Thanks for trying to help... here is my .ini that won't sort completely
Attached Files
File Type: zip vst-reaeq.zip (15.2 KB, 170 views)
skippertag is offline   Reply With Quote
Old 01-20-2019, 02:52 PM   #26
Eliseat
Human being with feelings
 
Eliseat's Avatar
 
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
Default

Quote:
Originally Posted by Edgemeal View Post
Glad it helps, minor update...

v0.13 - Sept 05, 2018
* Selected ini was not re-loaded after using Refresh.
* Sort ini file list by file name.
Edgemeal, many thanks for this small but handy tool. Very useful! ☜(゚ヮ゚☜)
__________________
☆.。.:*・°☆.。.:*・°☆.。.:*・°☆REAPER//✿◔‿◔)°☆.。.:*・°☆.。.:*・°☆
Eliseat is offline   Reply With Quote
Old 02-23-2019, 08:51 AM   #27
edhr
Human being with feelings
 
Join Date: Nov 2018
Posts: 1
Default no link?

found it! Thanks this is very helpful!

Last edited by edhr; 02-23-2019 at 08:53 AM. Reason: silly
edhr is offline   Reply With Quote
Old 03-31-2019, 02:53 AM   #28
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

Seems for a long time I had similar code I used for such task, just not shared.

See ReaPack/mpl_Sort focused FX presets alphabetically.lua (it uses SWS/BR ini files parser, I was too lazy for INI parsing, and also some tricks to update preset list properly right from REAPER).
mpl is offline   Reply With Quote
Old 04-01-2019, 01:17 AM   #29
skippertag
Human being with feelings
 
Join Date: Jun 2015
Posts: 474
Default

Quote:
Originally Posted by mpl View Post
Seems for a long time I had similar code I used for such task, just not shared.

See ReaPack/mpl_Sort focused FX presets alphabetically.lua (it uses SWS/BR ini files parser, I was too lazy for INI parsing, and also some tricks to update preset list properly right from REAPER).

Thank you!

As it seems all sorting apps/scripts/.. do sort the preset list with regards to the initials (at first the capitals and then the minor initials). 'Is it possible to make the alphabetical sorting ignoring the state of the initial?

Many thanks in advance!
skippertag is offline   Reply With Quote
Old 07-11-2019, 03:21 AM   #30
Anantich
Human being with feelings
 
Join Date: Apr 2017
Posts: 7
Default How to use Sort FX Script?

Can anybody please give step-by-step guide for using mpl_Sort focused FX presets alphabetically.lua script?
Anantich is offline   Reply With Quote
Old 07-12-2019, 04:37 AM   #31
Phazma
Human being with feelings
 
Join Date: Jun 2019
Posts: 2,872
Default

Quote:
Originally Posted by Anantich View Post
Can anybody please give step-by-step guide for using mpl_Sort focused FX presets alphabetically.lua script?
+1

Tried to run the action while the floating fx which I want to sort was in focus yet nothing happened.
Phazma is offline   Reply With Quote
Old 07-12-2019, 07:32 AM   #32
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

Quote:
Originally Posted by Phazma View Post
Tried to run the action while the floating fx which I want to sort was in focus yet nothing happened.
REAPER only loads the presets for an FX when it is first opened, So after sorting you'll need to close the FX window and re-open it to see the changes.
Edgemeal is offline   Reply With Quote
Old 07-12-2019, 08:03 AM   #33
Phazma
Human being with feelings
 
Join Date: Jun 2019
Posts: 2,872
Default

Quote:
Originally Posted by Edgemeal View Post
REAPER only loads the presets for an FX when it is first opened, So after sorting you'll need to close the FX window and re-open it to see the changes.
Didn't help. Just tried with a Cockos plugin and it worked perfectly. I guess this somehow does not work for third party plugins.
Phazma is offline   Reply With Quote
Old 10-18-2019, 12:13 PM   #34
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

REAPER FX Presets Sorter
Sort, re-order, edit, delete, import, REAPER FX presets.
https://forum.cockos.com/showpost.ph...2&postcount=81

My other Windows apps for REAPER
https://forum.cockos.com/showthread.php?t=219817

Last edited by Edgemeal; 07-28-2021 at 12:32 PM. Reason: Direct link to page
Edgemeal is offline   Reply With Quote
Old 12-15-2019, 06:21 AM   #35
triplex
Human being with feelings
 
Join Date: Dec 2010
Posts: 17
Default

Quote:
Originally Posted by Edgemeal View Post
For Windows Only!
Works fine on Mac via wine
triplex is offline   Reply With Quote
Old 03-05-2020, 12:50 PM   #36
ArtemiHo
Human being with feelings
 
Join Date: Mar 2019
Posts: 205
Default

Hello to all!
I've used sorting plugin and it worked, now my presets are sorted.
Problem is... none of them are working now, any idea how to return it backwards, or should I say bye bye to them?
ArtemiHo is offline   Reply With Quote
Old 03-05-2020, 01:34 PM   #37
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

Quote:
Originally Posted by ArtemiHo View Post
Hello to all!
I've used sorting plugin and it worked, now my presets are sorted.
Problem is... none of them are working now, any idea how to return it backwards, or should I say bye bye to them?
What sorting plugin?
Do you mean the script in post #21?
Or mpl script in post #28?
Or a Windows exe I posted?
Something else?

BTW, one should always have backups of their important data! I always make backup of known working REAPER before I change/update it.

Last edited by Edgemeal; 03-05-2020 at 02:40 PM.
Edgemeal is offline   Reply With Quote
Old 03-05-2020, 11:10 PM   #38
ArtemiHo
Human being with feelings
 
Join Date: Mar 2019
Posts: 205
Default

Quote:
Originally Posted by Edgemeal View Post
What sorting plugin?
Do you mean the script in post #21?
Or mpl script in post #28?
Or a Windows exe I posted?
Something else?

BTW, one should always have backups of their important data! I always make backup of known working REAPER before I change/update it.
I used ReaPack/mpl_Sort focused FX presets alphabetically.lua

Last edited by ArtemiHo; 03-07-2020 at 12:15 AM.
ArtemiHo is offline   Reply With Quote
Old 06-22-2020, 05:28 AM   #39
hardwarebob
Human being with feelings
 
Join Date: Nov 2019
Posts: 1
Default

thanks @Edgemeal amazing plugin, thanks, really helps me get these organised!

Due to some plugins not having great 'preset managers' built into them, I'm resorting to a collection of presets per song I work on, then I export them as an reaper preset lib (I just delete the plugin ini and import, to keep it clean) and compare the various settings (like A/B) while mixing.

One thing though I would love to see in reaper (not sure if you know a way for this - doesn't seem possible via reaper actions?), is a 'next/prev' preset browser as per https://forum.cockos.com/project.php?issueid=214
hardwarebob is offline   Reply With Quote
Old 06-22-2020, 08:15 AM   #40
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

Quote:
Originally Posted by hardwarebob View Post
One thing though I would love to see in reaper (not sure if you know a way for this - doesn't seem possible via reaper actions?), is a 'next/prev' preset browser as per https://forum.cockos.com/project.php?issueid=214
Welcome to the forum!

Not really sure what you mean but REAPER API has functions to get/set the preset (by name or index) for focused Track and Take FX. So for example to select next/previous track FX I made these Lua scripts. Tested from toolbar buttons and F-keys here, otherwise you may need set shortcuts as global, hopefully you know how to add lua scripts & wire them up to keys/toolbar buttons.

Code:
-- Increment focused track FX preset.lua 

function Main()
  local retval, trnum, _, fxnum = reaper.GetFocusedFX()
  if retval ~= 1 then return end -- not track fx
  local track = reaper.GetTrack(0,trnum-1)
  local preset_index, numberOfPresets = reaper.TrackFX_GetPresetIndex(track, fxnum)
  if preset_index == numberOfPresets then
    preset_index = -1
  elseif preset_index + 1 >= numberOfPresets then
     return -- end of list
  end
  reaper.TrackFX_SetPresetByIndex(track, fxnum, preset_index+1)
end

Main()
reaper.defer(function () end)

Code:
-- Decrement focused track FX preset.lua

function Main()
  local retval, trnum, _, fxnum = reaper.GetFocusedFX()
  if retval ~= 1 then return end -- not track fx 
  local track = reaper.GetTrack(0,trnum-1)
  local preset_index, numberOfPresets = reaper.TrackFX_GetPresetIndex(track, fxnum) 
  reaper.TrackFX_SetPresetByIndex(track, fxnum, preset_index-1) 
end

Main()
reaper.defer(function () end)
EDIT
If you install the SWS extension it has actions to do this also, but oddly they only work if the FX is currently set to a preset and they also roll-over when at the bottom or the very top of the list.
SWS/S&M: Trigger previous preset for last touched FX
SWS/S&M: Trigger next preset for last touched FX

Last edited by Edgemeal; 06-22-2020 at 08:44 AM.
Edgemeal is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:28 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.