|
|
|
10-31-2017, 01:59 PM
|
#1
|
Human being with feelings
Join Date: Apr 2008
Posts: 262
|
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.
|
|
|
11-03-2017, 06:29 AM
|
#2
|
Human being with feelings
Join Date: Apr 2008
Posts: 262
|
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.
|
|
|
11-04-2017, 12:20 AM
|
#3
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
|
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.
|
|
|
11-04-2017, 04:06 AM
|
#4
|
Human being with feelings
Join Date: Apr 2008
Posts: 262
|
That's pretty interesting.
|
|
|
11-04-2017, 07:30 AM
|
#5
|
Human being with feelings
Join Date: Sep 2008
Location: UK
Posts: 3,648
|
Quote:
Originally Posted by Edgemeal
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??
|
|
|
11-04-2017, 09:04 AM
|
#6
|
Human being with feelings
Join Date: Apr 2008
Posts: 262
|
Even better would be if we could get this into a format that could go in the the reapack repos.
|
|
|
11-04-2017, 10:59 AM
|
#7
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
|
Quote:
Originally Posted by Publicradio
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!
|
|
|
11-04-2017, 11:57 AM
|
#8
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
|
Quote:
Originally Posted by Stella645
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.
|
|
|
11-04-2017, 12:49 PM
|
#9
|
Human being with feelings
Join Date: Sep 2008
Location: UK
Posts: 3,648
|
Quote:
Originally Posted by Edgemeal
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.
|
|
|
11-04-2017, 03:41 PM
|
#10
|
Human being with feelings
Join Date: Apr 2008
Posts: 262
|
Edgemeal, all my .ini files have multiple data parameters. Not sure why it would be different.
|
|
|
11-04-2017, 06:49 PM
|
#11
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
|
Quote:
Originally Posted by Publicradio
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.
|
|
|
11-04-2017, 09:36 PM
|
#12
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
|
Quote:
Originally Posted by Stella645
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
|
|
|
11-06-2017, 07:27 AM
|
#13
|
Human being with feelings
Join Date: Apr 2008
Posts: 262
|
OK See attached zip.
|
|
|
11-06-2017, 11:35 AM
|
#14
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
|
Quote:
Originally Posted by Publicradio
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.
|
|
|
11-06-2017, 02:25 PM
|
#15
|
Human being with feelings
Join Date: Apr 2008
Posts: 262
|
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.
|
|
|
11-06-2017, 04:20 PM
|
#16
|
Human being with feelings
Join Date: Sep 2008
Location: UK
Posts: 3,648
|
Quote:
Originally Posted by Publicradio
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??
|
|
|
11-06-2017, 05:00 PM
|
#17
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
|
Quote:
Originally Posted by Publicradio
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.
|
|
|
11-07-2017, 08:11 AM
|
#18
|
Human being with feelings
Join Date: Apr 2008
Posts: 262
|
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.
|
|
|
11-07-2017, 11:58 AM
|
#19
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
|
Quote:
Originally Posted by Publicradio
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.
|
|
|
12-21-2017, 02:32 PM
|
#20
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
|
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.
|
|
|
05-10-2018, 07:33 AM
|
#21
|
Human being with feelings
Join Date: Jun 2015
Posts: 474
|
Quote:
Originally Posted by Edgemeal
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!!
|
|
|
09-05-2018, 12:08 PM
|
#22
|
Human being with feelings
Join Date: Aug 2014
Location: Netherlands
Posts: 882
|
Great tool. Thanks Edgemeal!
|
|
|
10-24-2018, 06:18 AM
|
#23
|
Human being with feelings
Join Date: Jun 2015
Posts: 685
|
Exactly what I needed, the drag&drop is very useful. Thank you!
|
|
|
01-09-2019, 12:35 PM
|
#24
|
Human being with feelings
Join Date: Mar 2007
Location: Denver, CO
Posts: 633
|
Quote:
Originally Posted by skippertag
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.
|
|
|
01-11-2019, 05:15 AM
|
#25
|
Human being with feelings
Join Date: Jun 2015
Posts: 474
|
Quote:
Originally Posted by woodslanding
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
|
|
|
01-20-2019, 02:52 PM
|
#26
|
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
Quote:
Originally Posted by 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.
|
Edgemeal, many thanks for this small but handy tool. Very useful! ☜(゚ヮ゚☜)
__________________
☆.。.:*・°☆.。.:*・°☆.。.:*・°☆REAPER//✿◔‿◔)°☆.。.:*・°☆.。.:*・°☆
|
|
|
02-23-2019, 08:51 AM
|
#27
|
Human being with feelings
Join Date: Nov 2018
Posts: 1
|
no link?
found it! Thanks this is very helpful!
Last edited by edhr; 02-23-2019 at 08:53 AM.
Reason: silly
|
|
|
03-31-2019, 02:53 AM
|
#28
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
|
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).
|
|
|
04-01-2019, 01:17 AM
|
#29
|
Human being with feelings
Join Date: Jun 2015
Posts: 474
|
Quote:
Originally Posted by mpl
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!
|
|
|
07-11-2019, 03:21 AM
|
#30
|
Human being with feelings
Join Date: Apr 2017
Posts: 7
|
How to use Sort FX Script?
Can anybody please give step-by-step guide for using mpl_Sort focused FX presets alphabetically.lua script?
|
|
|
07-12-2019, 04:37 AM
|
#31
|
Human being with feelings
Join Date: Jun 2019
Posts: 2,872
|
Quote:
Originally Posted by Anantich
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.
|
|
|
07-12-2019, 07:32 AM
|
#32
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
|
Quote:
Originally Posted by Phazma
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.
|
|
|
07-12-2019, 08:03 AM
|
#33
|
Human being with feelings
Join Date: Jun 2019
Posts: 2,872
|
Quote:
Originally Posted by Edgemeal
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.
|
|
|
12-15-2019, 06:21 AM
|
#35
|
Human being with feelings
Join Date: Dec 2010
Posts: 17
|
Quote:
Originally Posted by Edgemeal
For Windows Only!
|
Works fine on Mac via wine
|
|
|
03-05-2020, 12:50 PM
|
#36
|
Human being with feelings
Join Date: Mar 2019
Posts: 205
|
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?
|
|
|
03-05-2020, 01:34 PM
|
#37
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
|
Quote:
Originally Posted by ArtemiHo
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.
|
|
|
03-05-2020, 11:10 PM
|
#38
|
Human being with feelings
Join Date: Mar 2019
Posts: 205
|
Quote:
Originally Posted by Edgemeal
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.
|
|
|
06-22-2020, 05:28 AM
|
#39
|
Human being with feelings
Join Date: Nov 2019
Posts: 1
|
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
|
|
|
06-22-2020, 08:15 AM
|
#40
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
|
Quote:
Originally Posted by hardwarebob
|
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.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 06:05 PM.
|