Old 04-15-2022, 03:42 PM   #1
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 361
Default Item Modifiers

ITEM MODIFIERS
Item Modifiers is a script that hooks up to my Functional Console script and allows for real-time procedural workflows for creating and mangling items.
People that have experience with 3D software packages (like Houdini or Blender) are likely familiar with workflows like this.



There is a lot to cover in this post, so I will start by explaining the design methodology behind item modifiers.
The main idea is to select an item or some items, and build up a modifier stack to process them in various ways. Modifiers are components that take the output from the previous component, process it, and pass it along to the next one. Here is a simple example:

In the example above, I am using the "Delay Builder" modifier to create a delay out of the selected item, using a pattern to select it, then reversing that pattern.
I can then hit the "Apply" button to apply all the existing modifiers and keep stacking. It is also possible to save entire modifier stacks as a file and load them later.


Another useful option is the generate lua script option through the copy menu:

This generates a lua script that executes what the entire modifier stack does in one go. So if you built up a modifier stack that does something you really like, you can integrate it deeply into your workflow.

In the example above you can see me triggering the generated lua script from the simple delay stack I built above with a hotkey.


I will list the installation steps next, then go into more detail about features and usage after that. Enjoy




INSTALLATION
  • Install ReaPack
  • Add my repository to your ReaPack repositories.
    Code:
    https://raw.githubusercontent.com/Bird-Bird/ReaScript_Testing/main/index.xml
  • Install Item Modifiers through ReaPack.
  • Install ReaImGui through ReaPack.
  • Install js_ReaScript_API through ReaPack. Installing this is optional, however it needs to be installed if you want to use the "generate lua script" feature.
Launch BirdBird_Item Modifiers.lua




MODIFIERS
As described in the introduction, modifiers are the building blocks that create modifier stacks and are the backbone of the script.
While most of the names they have are self explanatory, I will list some special ones down below, this list will likely expand in the future. There are 39 modifiers in total at the time of writing this post.

Tag:

Tags an item selection with a name anywhere during the modifier stack. You can then use the "Get Tag" modifier to retrieve this selection. It is often useful to sandwich modifiers between "Tag" and "Get Tag" modifiers to run operations and keep working on a specific subset of the items.

Pattern Selection:

Selects items in a pattern determined by the checkboxes on the modifier GUI. Repeats and pattern selections combined with tagging is a good base to start building more musical modifier stacks.
  • Note that you can ctrl/cmd click any of the sliders you see to input a value manually. This will also let you go beyond the default ranges for the parameters.



BUTTONS

In this part I will go into what the buttons on the interface do.


Apply: Applies the modifier stack and clears it
Reset: Resets all parameters on the current modifier stack
Clear: Clears the modifier stack and reverts to your initial selection
Seed: Generates a new seed that is used for modifiers that include randomness, this is useful to explore variations

Select: Makes the modifier stack run on your new selection of items instead
Save: Lets you save entire modifier stacks as a ".modstk" file that can be loaded through the load button.
Load: Lets you load modifier stacks from ".modstk" files, or directly from the clipboard.
Copy: There are a few options in the menu accessed through this button:
  • Copy as preset to clipboard
    - This option copies the entire modifier stack to clipboard, which can then be loaded through the load menu. This makes it easy for people to share modifier stacks without having to toss files around.
  • Copy as command to clipboard
    - This option copies the entire modifier stack as a valid Functional Console command.
  • Generate lua script
    - This option generates a lua script that does what the entire modifier stack does in one go. You can then load it through the actions menu and use it however you want. This option will be greyed out if you don't have js_ReaScript_API installed.



MODIFIER LIST

The modifier list on the left is where you add modifiers to the modifier stack. By default the selected modifiers will go at the end of the stack. However you can drag the modifiers themselves to reorder them in the stack.
The filter box at the top lets you search all of the existing modifiers directly. You can focus this filter anywhere in the script by hitting the "f" key on your keyboard.
You can also right click modifiers to add or remove them to your favourites.


That is all of the basic functionality at the moment. In the post under this I will go into how the modifiers themselves were created, and how you can create them yourself.



Extra Notes
* This is an early version and may contain bugs.
* Undo points are finnicky with scripts that update the project in this manner, I am still thinking about how to handle them.
* Feel free to throw any cool modifier stacks that you have created into the thread here. I can build modifiers out of the cool ones and include them in the next versions under the special tag.
* Thanks to all friends that dealt with my ramblings on programming while I was developing this



_
__________________
ReaScript Discord Server | Scripts

Last edited by BirdBird; 04-17-2022 at 11:57 PM.
BirdBird is offline   Reply With Quote
Old 04-15-2022, 03:43 PM   #2
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 361
Default

MODIFIER BUILDER
The modifier builder is the companion script shipped with the main script that lets you create modifiers and test them on the fly. The new modifiers created through here will automatically show up in the main script as long as the user_modifiers.json file is selected during launch.

This editor is what I created first to create the default modifiers that are included with the script itself.
The controls for modifiers are generated from multiline text input on the fly, and can be tested live.


FORMAT
The multiline text has a simple format. It is a sequence of sections seperated by '>' on every line. The full format is:
Quote:
commands > controller_type controller parameters seperated by spaces > label
The "commands" mentioned here are Functional Console commands.
The parameters fetched from the controller are appended to the commands themselves during runtime.
The current controller types are:
  • sd -> slider double, expects 3 parameters (default value, min value, max value)
  • si -> slider int, expects 3 parameters (default value, min value, max value)
  • cb -> checbox, expects 1 parameter (default value, 1 = on, 0 = off)
    - Checboxes let you filter out the entirety of commands in the first section during runtime
  • inpd -> double text input, expects 1 parameter (default value)
  • inpi -> integer text input, expects 1 parameter (default value)
  • inps -> string text input, expects 1 parameter (default value)
  • selp -> selection pattern
    - This one has variable number of parameters determined by the first value in the second section. IE "selp=5 1 0 0 1 0" means that it has 5 parameters by default, and the sequence of 1s 0s afterwards are the default values.

The "Select" button lets you reset your initial selection to a new selection of items like it does in the main script.
Note that this is a developer tool at the moment, and while I put some safeguards in it is likely that I didn't test it as well as the main script. I will likely refine the editor more in the future.


_
__________________
ReaScript Discord Server | Scripts
BirdBird is offline   Reply With Quote
Old 04-15-2022, 03:48 PM   #3
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 1,918
Default

Crazy ideas once again, you're on fire! Thanks
Vagelis is online now   Reply With Quote
Old 04-15-2022, 06:26 PM   #4
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 8,390
Default

This is madness !! 🤯🤯🤯
X-Raym is offline   Reply With Quote
Old 04-15-2022, 07:25 PM   #5
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 1,699
Default

If you are using this you are one of the coolest kids in the playground


Thanks for your work BirdBird this script is very good, and inspiring !

Last edited by daniellumertz; 04-15-2022 at 09:21 PM.
daniellumertz is offline   Reply With Quote
Old 04-15-2022, 08:50 PM   #6
rgryrgryrgry
Human being with feelings
 
Join Date: Apr 2022
Location: Taiwan
Posts: 10
Default

wow this is insane!
rgryrgryrgry is offline   Reply With Quote
Old 04-15-2022, 11:36 PM   #7
cool
Human being with feelings
 
Join Date: Dec 2017
Location: Sunny Siberian Islands
Posts: 563
Default

AMAZING!
cool is online now   Reply With Quote
Old 04-16-2022, 02:29 AM   #8
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 430
Default

Speechless. I can't wait for the holidays to end to try this!

Thank you Birdbird
reapero is offline   Reply With Quote
Old 04-16-2022, 05:54 AM   #9
jrk
Human being with feelings
 
Join Date: Aug 2015
Posts: 2,145
Default

boss
__________________
it's meant to sound like that...
jrk is offline   Reply With Quote
Old 04-16-2022, 06:01 AM   #10
hans
Human being with feelings
 
Join Date: Aug 2020
Posts: 141
Default

Incredible! I see myself using this a lot in design.
hans is offline   Reply With Quote
Old 04-16-2022, 09:43 AM   #11
tonalstates
Human being with feelings
 
tonalstates's Avatar
 
Join Date: Jun 2020
Posts: 346
Default

King Birbird! Dammmmmnnnnnn, being a blender n00b I thoroughly appreciate this man, incredible idea.
tonalstates is offline   Reply With Quote
Old 04-17-2022, 10:29 AM   #12
JonLinnarson
Human being with feelings
 
JonLinnarson's Avatar
 
Join Date: Jul 2020
Posts: 489
Default

You are on fire lately. Awesome script, as usual!
JonLinnarson is online now   Reply With Quote
Old 04-17-2022, 11:54 PM   #13
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 361
Default

Just pushed a new version.
There is now a small display that shows the initial selection the stack is working on.

  • User experience regarding initial selection to operate on has also been improved to iron out some of the rough edges and weirdness.
  • The select button no longer clears the stack, it instead switches the existing stack to run on the newly selected items.
  • Fixed modifier stacks not being ran when loading them.
  • Removed extra Functional Console dependency from the script, a version of it now ships with the script itself. (I have figured that having multiple packages that depend on eachother like I had at the beginning is a can of worms I don't want to open.)

There has been a lot of internal changes in this update, so please let me know if anything broke on your end.






_
BirdBird is offline   Reply With Quote
Old 04-18-2022, 02:38 AM   #14
valankar
Human being with feelings
 
Join Date: Jan 2016
Location: Switzerland
Posts: 71
Default

Really awesome. Quick question, is it possible to apply the same operations on 2 or more clips that are in the same position in the timeline? See attachment, it applies different operations to the 2 clips.
Attached Images
File Type: jpg item 2.jpg (94.4 KB, 38 views)
valankar is offline   Reply With Quote
Old 04-18-2022, 02:42 AM   #15
strachupl
Human being with feelings
 
strachupl's Avatar
 
Join Date: Jan 2013
Posts: 524
Default

This looks amazing. Pro level product!
__________________
It's Easier To Fool People Than To Convince Them That They've Been Fooled.
strachupl is offline   Reply With Quote
Old 04-18-2022, 04:35 AM   #16
Broken-Form
Human being with feelings
 
Join Date: Dec 2018
Posts: 23
Default

This looks awesome. Have to try this tommorrow in the studio
Broken-Form is offline   Reply With Quote
Old 04-18-2022, 05:05 AM   #17
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 13,868
Default

I thought I'd seen everything after your other scripts but no!!!!!

It gets even better!
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 04-18-2022, 05:36 AM   #18
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 13,868
Default

Will give this a proper go soon but on first try apart from being amazing the only thing I wasn't keen on was that space bar got "captured" by the search bar at the top instead of start/stopping reaper.

I don't always use space bar as I've got other hardware to play/stop but sometimes I do and it was slightly frustrating (I feel bad to niggle about anything at all for such an amazing script lol)

I can see why you would want search to be the focus though so I don't mind either way really


Also. Do you take donations/have paypal etc. I checked but I couldn't find one on.
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 04-18-2022, 07:23 AM   #19
Broken-Form
Human being with feelings
 
Join Date: Dec 2018
Posts: 23
Default

All these item modifiers show above.are they in the script when I install or do I need to set it up myself?
Really looking forward to trying this tommorrow
Broken-Form is offline   Reply With Quote
Old 04-18-2022, 07:45 PM   #20
tonalstates
Human being with feelings
 
tonalstates's Avatar
 
Join Date: Jun 2020
Posts: 346
Default

I've been testing out your script and it's sooo cool man hahah really original for a DAW to have this kind of tool.

I was wondering if it was possible to consider a few things I thought would be cool to have while trying it out

A way to toggle bypass already inserted modifiers
A way to collapse and un-collapse all modifiers with a button maybe

Modifiers to filter out items by a volume threshold (so silent cuts are filtered out), another to arrange items by length and another to reposition items by time (either seconds, beats, ms, etc) between items, like separate items on the end by 1 second or 1/8, etc. like nvk's "reposition selected items" script basically.


For now that's what crossed my mind, so yeah. Thanks for the awesome script.

Last edited by tonalstates; 04-18-2022 at 11:32 PM.
tonalstates is offline   Reply With Quote
Old 04-18-2022, 08:26 PM   #21
Klangfarben
Human being with feelings
 
Join Date: Jul 2016
Location: Los Angeles, CA
Posts: 1,483
Default

This is genius.
Klangfarben is offline   Reply With Quote
Old 04-19-2022, 02:19 AM   #22
SubbaseDnB
Human being with feelings
 
Join Date: May 2017
Posts: 439
Default

it seems i need opengl support for this,my laptop doesent have that.do i need that for this script to work?
SubbaseDnB is offline   Reply With Quote
Old 04-21-2022, 08:13 AM   #23
hans
Human being with feelings
 
Join Date: Aug 2020
Posts: 141
Default

Really good script!

What about adding a function with a slider that grows/shrinks item edges on both sides?
hans is offline   Reply With Quote
Old 04-21-2022, 08:38 AM   #24
kartalex
Human being with feelings
 
Join Date: Dec 2015
Posts: 143
Default

It's soo cool!


Can we make own modifiers, like.. plugins for this script? It could be very interesting, if you make a template for this. :P
kartalex is offline   Reply With Quote
Old 04-21-2022, 03:01 PM   #25
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 3,387
Default

Looks like magic, thanks for sharing.

First idea coming to my mind for what I could test this (did not try anything yet): Take a 1 bar loop you like. Repeat 64 times, so you have 64 bars.

Then experimenting with your tool, bringing more interest into this 64 bar loop, adding mutes after few (4 or 8 or 16) bars here and there (on different tracks, e.g. 1beat mutes on kick, or 1bar bass mutes). Or some fade ins, fade outs here and there. All with one click. Not sure if your tool can do all these already. Maybe detecting certain tracks from the track name (kick, bd, bass drum for example).
TonE is offline   Reply With Quote
Old 04-21-2022, 10:28 PM   #26
Broken-Form
Human being with feelings
 
Join Date: Dec 2018
Posts: 23
Default

Would love to use this script. But cant as it seems to rely on opengl
Broken-Form is offline   Reply With Quote
Old 04-22-2022, 10:18 PM   #27
Pink Wool
Human being with feelings
 
Pink Wool's Avatar
 
Join Date: Apr 2020
Posts: 1,050
Default

This is super cool!

Thanks BirdBird!
Pink Wool is offline   Reply With Quote
Old 04-23-2022, 01:57 AM   #28
Broken-Form
Human being with feelings
 
Join Date: Dec 2018
Posts: 23
Default

When I try to use this i get a message with something about Realmgui and OpenGL.and i have to close the script??
Broken-Form is offline   Reply With Quote
Old 04-23-2022, 02:31 AM   #29
Pink Wool
Human being with feelings
 
Pink Wool's Avatar
 
Join Date: Apr 2020
Posts: 1,050
Default

Quote:
Originally Posted by Broken-Form View Post
When I try to use this i get a message with something about Realmgui and OpenGL.and i have to close the script??
Code:
INSTALLATION

    Install ReaPack
    Add my repository to your ReaPack repositories.
    Code:

    https://raw.githubusercontent.com/Bi...main/index.xml

    Install Item Modifiers through ReaPack.
    Install ReaImGui through ReaPack.
    Install js_ReaScript_API through ReaPack. Installing this is optional, however it needs to be installed if you want to use the "generate lua script" feature.

Launch BirdBird_Item Modifiers.lua
Pink Wool is offline   Reply With Quote
Old 04-23-2022, 09:19 AM   #30
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 361
Default

Thanks everyone for the nice words
Quote:
Originally Posted by SubbaseDnB View Post
it seems i need opengl support for this,my laptop doesent have that.do i need that for this script to work?
Quote:
Originally Posted by Broken-Form View Post
Would love to use this script. But cant as it seems to rely on opengl
I currently use ReaImGui for the user interface, which uses the GPU to render and uses OpenGL, unfortunately there is nothing I can do short of writing a fallback GUI at the moment which would be a massive undertaking.
Edit: Check the following post: https://forum.cockos.com/showpost.ph...6&postcount=32



Quote:
Originally Posted by musicbynumbers View Post
Will give this a proper go soon but on first try apart from being amazing the only thing I wasn't keen on was that space bar got "captured" by the search bar at the top instead of start/stopping reaper.
I have a flag to disable this in the codebase as I have also found it to annoy myself at times as well, but it has not made its way to user settings yet
For the time being you can comment or delete this line out to disable filter auto-focus.


Quote:
Originally Posted by valankar View Post
Really awesome. Quick question, is it possible to apply the same operations on 2 or more clips that are in the same position in the timeline? See attachment, it applies different operations to the 2 clips.
I have ideas on how to get this to work but it requires some big internal changes. As it stands I will likely be away from scripting for a while, so don't know when it would make it in.

Last edited by BirdBird; 04-24-2022 at 12:14 AM.
BirdBird is offline   Reply With Quote
Old 04-23-2022, 09:32 AM   #31
Broken-Form
Human being with feelings
 
Join Date: Dec 2018
Posts: 23
Default

Quote:
Originally Posted by BirdBird View Post
Thanks everyone for the nice words


I currently use ReaImGui for the user interface, which uses the GPU to render and uses OpenGL, unfortunately there is nothing I can do short of writing a fallback GUI at the moment which would be a massive undertaking.
A shame i could especially use the beat chopper and randomize features for my DnB Project
Broken-Form is offline   Reply With Quote
Old 04-23-2022, 01:26 PM   #32
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 361
Default

For folks getting the "failed to initialize OpenGL context" error, it would help to try and report what glview is saying in the ReaImGui thread as cfillion is describing in this post.
He also has a simple solution there with a .dll file to run ReaImGui scripts without OpenGL
BirdBird is offline   Reply With Quote
Old 04-24-2022, 02:57 AM   #33
Broken-Form
Human being with feelings
 
Join Date: Dec 2018
Posts: 23
Default

Quote:
Originally Posted by BirdBird View Post
For folks getting the "failed to initialize OpenGL context" error, it would help to try and report what glview is saying in the ReaImGui thread as cfillion is describing in this post.
He also has a simple solution there with a .dll file to run ReaImGui scripts without OpenGL
Awesome gonna look into it tommorrow when im in the studio
Broken-Form is offline   Reply With Quote
Old 04-25-2022, 02:12 AM   #34
SubbaseDnB
Human being with feelings
 
Join Date: May 2017
Posts: 439
Default

Quote:
Originally Posted by BirdBird View Post
For folks getting the "failed to initialize OpenGL context" error, it would help to try and report what glview is saying in the ReaImGui thread as cfillion is describing in this post.
He also has a simple solution there with a .dll file to run ReaImGui scripts without OpenGL

hi Got it working now,this is awesome,thanks
SubbaseDnB is offline   Reply With Quote
Old 04-25-2022, 07:26 AM   #35
Reapology
Human being with feelings
 
Reapology's Avatar
 
Join Date: Apr 2022
Posts: 319
Default

Wow yes this is clever..and works with video too!
Nice,thanks for sharing your creations.
Reapology is offline   Reply With Quote
Old 04-25-2022, 11:32 AM   #36
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 13,868
Default

Quote:
Originally Posted by BirdBird View Post
I have a flag to disable this in the codebase as I have also found it to annoy myself at times as well, but it has not made its way to user settings yet
For the time being you can comment or delete this line out to disable filter auto-focus.
Thanks and all good
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 05-16-2022, 12:04 PM   #37
MrTsonts
Human being with feelings
 
MrTsonts's Avatar
 
Join Date: Apr 2019
Location: Ukraine, Kyiv
Posts: 144
Default

Wanted to test.
Version reaper657+dev0514_x64.
The script runs but when I try
activate any function Reaper crashes.
Perhaps this is due to the version of Reaper?
MrTsonts is offline   Reply With Quote
Old 05-16-2022, 01:06 PM   #38
hans
Human being with feelings
 
Join Date: Aug 2020
Posts: 141
Default

Same here. Crashes on same build
hans is offline   Reply With Quote
Old 05-16-2022, 01:18 PM   #39
strachupl
Human being with feelings
 
strachupl's Avatar
 
Join Date: Jan 2013
Posts: 524
Default

here same 6.57dev0514 win7x64
__________________
It's Easier To Fool People Than To Convince Them That They've Been Fooled.
strachupl is offline   Reply With Quote
Old 05-16-2022, 01:33 PM   #40
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 3,955
Default

The crash should be fixed in the next REAPER rc/dev. https://forum.cockos.com/showthread.php?p=2558945

(There also seem to be a bug in the script triggering this: mod.display_id is nil at gui_main.lua:309.)

Last edited by cfillion; 05-16-2022 at 02:02 PM.
cfillion 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 07:04 AM.


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