Old 10-31-2017, 01:59 PM   #1
Publicradio
Human being with feelings
 
Join Date: Apr 2008
Posts: 183
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: 183
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: 1,206
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: 183
Default

That's pretty interesting.
Publicradio is offline   Reply With Quote
Old 11-04-2017, 07:30 AM   #5
Stella645
Human being with feelings
 
Join Date: Sep 2008
Location: UK
Posts: 1,148
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: 183
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: 1,206
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:13 AM   #8
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,206
Default

Quote:
Originally Posted by Publicradio View Post
Even better would be if we could get this into a format that could go in the the reapack repos.
From some of the Lua scripts I've seen posted here it seems like that should be possible, maybe too much hassle or no real interest in it?
Edgemeal is offline   Reply With Quote
Old 11-04-2017, 11:57 AM   #9
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,206
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   #10
Stella645
Human being with feelings
 
Join Date: Sep 2008
Location: UK
Posts: 1,148
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   #11
Publicradio
Human being with feelings
 
Join Date: Apr 2008
Posts: 183
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   #12
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,206
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   #13
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,206
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   #14
Publicradio
Human being with feelings
 
Join Date: Apr 2008
Posts: 183
Default

OK See attached zip.
Attached Files
File Type: zip presets.zip (114.0 KB, 43 views)
Publicradio is offline   Reply With Quote
Old 11-06-2017, 11:35 AM   #15
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,206
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   #16
Publicradio
Human being with feelings
 
Join Date: Apr 2008
Posts: 183
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   #17
Stella645
Human being with feelings
 
Join Date: Sep 2008
Location: UK
Posts: 1,148
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   #18
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,206
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   #19
Publicradio
Human being with feelings
 
Join Date: Apr 2008
Posts: 183
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   #20
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,206
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   #21
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,206
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   #22
skippertag
Human being with feelings
 
Join Date: Jun 2015
Posts: 396
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, 70 views)
skippertag is offline   Reply With Quote
Old 09-05-2018, 12:08 PM   #23
Paul99
Human being with feelings
 
Join Date: Aug 2014
Location: Netherlands
Posts: 838
Default

Great tool. Thanks Edgemeal!
Paul99 is offline   Reply With Quote
Old 09-05-2018, 02:38 PM   #24
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,206
Default

Quote:
Originally Posted by Paul99 View Post
Great tool. Thanks Edgemeal!
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.
Attached Files
File Type: zip Preset Sorter v0.13.zip (26.0 KB, 71 views)
Edgemeal is offline   Reply With Quote
Old 10-24-2018, 06:18 AM   #25
Sju
Human being with feelings
 
Join Date: Jun 2015
Posts: 682
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   #26
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 391
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   #27
skippertag
Human being with feelings
 
Join Date: Jun 2015
Posts: 396
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, 22 views)
skippertag is offline   Reply With Quote
Old 01-20-2019, 02:52 PM   #28
Eliseat
Human being with feelings
 
Eliseat's Avatar
 
Join Date: Mar 2018
Location: Cologne
Posts: 1,163
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   #29
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-26-2019, 12:39 AM   #30
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,206
Default

Quote:
Originally Posted by Eliseat View Post
Edgemeal, many thanks for this small but handy tool. Very useful! ☜(゚ヮ゚☜)
OK

v0.15 - Mar, 26, 2019
* Simple ini file name filter.
* Inline item re-naming (F2 key), Removed input box.
* Item commands now accessible via shortcut keys.
* Other minor changes.
Attached Files
File Type: zip Preset Sorter v0.15.zip (29.4 KB, 45 views)
Edgemeal is offline   Reply With Quote
Old 03-31-2019, 02:53 AM   #31
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 2,461
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).
__________________
SoundCloud | MPL Scripts discussion | ReaPack | Donate
mpl is offline   Reply With Quote
Old 04-01-2019, 01:17 AM   #32
skippertag
Human being with feelings
 
Join Date: Jun 2015
Posts: 396
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   #33
Anantich
Human being with feelings
 
Join Date: Apr 2017
Posts: 3
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   #34
Phazma
Human being with feelings
 
Join Date: Jun 2019
Posts: 59
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   #35
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,206
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   #36
Phazma
Human being with feelings
 
Join Date: Jun 2019
Posts: 59
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
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 11:29 PM.


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